-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CommandException: No URLs matched when passing URLs to rm from stdin #490
Comments
Nope, I don't think you're missing anything -- I can reproduce this as well. Running the gsutil rm command above with the -DD flag shows that gsutil isn't even making an API call to check for the object in question. Looking in name_expansion.py, we're creating a PluralityCheckableIterator, which wraps a NameExpansionIterator, which wraps another PluralityCheckableIterator object that wraps the generator that's supposed to read lines from stdin (phew). Anyway, I threw a few debugging print statements into the _PopulateHead() method in plurality_checkable_iterator.py, and found that the underlying generator is throwing a StopIteration exception. Not quite sure why yet -- I'll continue to investigate soon. Notes to self:
|
I ran into this issue too today (gsutil version 4.28). Are there any known workarounds? |
Off the top of my head, I can only think of one: You could write a thin wrapper script to pass the arguments to gsutil yourself (using something like |
I'm seeing the same thing too... |
I'm seeing the same exception while copying a tar file to my bucket. |
Seeing the same problem. any suggested solutions? |
not sure if there is a resolution: and get this
when trying to execute:
Please let me know if I should post this elsewhere. |
I had the same problem, I have changed the name of the file and it worked :). |
Any news on this one? |
Same issue, on gsutil v4.59. Trying to remove the bucket and getting the same error even though the bucket clearly exists when looking at it on the console. |
Sorry for the delay in response. Our team is currently occupied with other priorities and does not have the bandwidth to address this issue at the moment. However, I did some investigation for future reference. This seems to be happening because the url_strs gets iterated twice, once here Line 269 in d8626ae
Line 288 in d8626ae
So essentially, we are trying to iterate over the iterator twice and hence on the second instance, we get an empty iterator. The easy fix would be to convert the iterator to a list, i.e changing Line 252 in d8626ae
But this can affect users who have really long list coming from stdin or users who are already using this feature in a pipeline and not really using the -r with -I. Note that this will only affect your if you are using -r and -I together. The ideal fix would be to remove the recursion special case and instead handle the bucket deletion based on the NameExpansionIterator result itself. A workaround would be something that is suggested here #490 (comment) Alternatively, you can avoid using recursion (-r option) and pass in the list
Note that the above command will empty the bucket, but will not remove the bucket and you will have to run a separate command to remove it. |
Hello @ElnazBigdeli, |
Any fix for this issue yet? A bit odd that this has been a known issue since (at least) 2018. |
Having the same issue. Having a workaround at least would be nice... |
Having same issue. Its not yet resolved??? |
same issue with gsutil cat , gsutil version 5.11 |
Just chiming in that this is still an issue for me, and still quite annoying when dealing with programmatically modifying even moderate size data sets in gcloud gs buckets. |
I'm trying to use
gsutil rm -I
and pass a list of URLs to delete through stdin.For an existing directory in, say,
gs://test-bucket/test-dir
, these are some commands I've tried:Am I missing something here?
The text was updated successfully, but these errors were encountered: