Skip to content
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

mc mv returns non-zero on empty source #5007

Open
udf2457 opened this issue Aug 5, 2024 · 6 comments
Open

mc mv returns non-zero on empty source #5007

udf2457 opened this issue Aug 5, 2024 · 6 comments

Comments

@udf2457
Copy link

udf2457 commented Aug 5, 2024

mc mv returns non-zero on an empty source bucket.

This causes problems with scripts that check for bad exits, i.e. mc mv .... || report_bad_stuff

It would be nice to have one of the following:

  1. Do not return non-zero on empty source (since, technically it is not an error situation, it is a fact ... i.e. nothing to move)
  2. Add an igore-empty-source flag or similar to achieve the same effect (i.e. not consider empty sources an error)

mc version RELEASE.2024-07-15T17-46-06Z (commit-id=11034f9de1e9f993c36fbad961f76f876a753328)
Runtime: go1.22.5 linux/amd64

@allanrogerr
Copy link
Contributor

Reviewing

@allanrogerr
Copy link
Contributor

What is your minio version? Also, please post of a sample script where you provoke the error.

@udf2457
Copy link
Author

udf2457 commented Aug 6, 2024

minio version was already provided.....

You should be able to replicate the error by doing what I said, mc mv .... || report_bad_stuff, so for example mc mv ... || { logger -p user.error -t "mytag" "mc failed"; exit 1; }

@allanrogerr
Copy link
Contributor

mc mv returns non-zero on an empty source bucket.

This causes problems with scripts that check for bad exits, i.e. mc mv .... || report_bad_stuff

It would be nice to have one of the following:

  1. Do not return non-zero on empty source (since, technically it is not an error situation, it is a fact ... i.e. nothing to move)
  2. Add an igore-empty-source flag or similar to achieve the same effect (i.e. not consider empty sources an error)

mc version RELEASE.2024-07-15T17-46-06Z (commit-id=11034f9de1e9f993c36fbad961f76f876a753328) Runtime: go1.22.5 linux/amd64

Provide minio --version

@udf2457
Copy link
Author

udf2457 commented Aug 6, 2024

And that is what I posted ........ surely the Copyright and License lines are irrelevant ? I gave you the mc version and runtime lines.

@klauspost
Copy link
Contributor

@udf2457 You have provided the mc version - not the minio (server) version. It may or may not be relevant, but it is good to have for a precise reproducer in case the error is related to specific server behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants