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

Error on empty bucket listing #722

Closed
Z9n2JktHlZDmlhSvqc9X2MmL3BwQG7tk opened this issue Jun 8, 2024 · 0 comments · Fixed by #732
Closed

Error on empty bucket listing #722

Z9n2JktHlZDmlhSvqc9X2MmL3BwQG7tk opened this issue Jun 8, 2024 · 0 comments · Fixed by #732
Assignees

Comments

@Z9n2JktHlZDmlhSvqc9X2MmL3BwQG7tk
Copy link

Z9n2JktHlZDmlhSvqc9X2MmL3BwQG7tk commented Jun 8, 2024

s5cmd finishes with error (exit code = 1) when listing empty bucket:

s5cmd ls s3://empty-bucket; echo exit_code=$?
ERROR "ls s3://empty-bucket": no object found
exit_code=1

The same exit code returns for non-existent buckets:

s5cmd ls s3://non-existent-bucket; echo exit_code=$?
ERROR "ls s3://non-existent-bucket": NotFound: Not Found status code: 404, request id: tx000000000000000000014-0066647b03-8d9195fc-default, host id:
exit_code=1

There is no way to differentiate empty and non-existent buckets.
I think it is better not to display any error and return 0 exit code.
For example: s3cmd works as expected:

s3cmd ls s3://empty-bucket; echo exit_code=$?
exit_code=0

s3cmd ls s3://non-existent-bucket; echo exit_code=$?
ERROR: Bucket 'non-existent-bucket' does not exist
ERROR: S3 error: 404 (NoSuchBucket)
exit_code=12

s5cmd version: 2.2.2

@ilkinulas ilkinulas added this to s5cmd Jun 28, 2024
@ilkinulas ilkinulas moved this to Planned in s5cmd Jul 2, 2024
@ilkinulas ilkinulas moved this from Planned to In Progress in s5cmd Jul 5, 2024
@ilkinulas ilkinulas moved this from In Progress to Review in s5cmd Jul 5, 2024
@github-project-automation github-project-automation bot moved this from Review to Done in s5cmd Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants