Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#96 s3cmd exits with zero return code after certain S3 errors

Malfunction
open
nobody
s3cmd (117)
5
2014-03-06
2011-07-06
Michael Gardner
No

When s3cmd encounters an error, it generally exits with a nonzero return code, as expected. But for certain S3 errors (namely those in S3.codes), it returns zero, indicating success. I'm not sure if this is by design, but it's definitely unexpected and unwanted behavior for me.

Discussion

  • Jason Woodall
    Jason Woodall
    2013-04-02

    This occurs for s3cmd ls:
    10:17 /cygdrive/d/(s3_build)$ ./tools/s3cmd/s3cmd ls s3://downloads1
    ERROR: Bucket 'downloads1' does not exist
    10:28 /cygdrive/d/(s3_build)$ echo $?
    0

    Expected result would be 1 (or other error code)

     
  • Simon Boulet
    Simon Boulet
    2013-05-21

    Same for "backup: ERROR: Upload of 'XXX' failed too many times. Skipping that file." (that was from 1.0.0 perhaps it has changed in newer releases).

    This is a major issue to us and make it a little more difficult to automate uploading files to S3 from bash scripts (and making sure they were actually uploaded).

     
  • Buggz
    Buggz
    2014-03-06

    "ERROR: Upload of 'XXX' failed too many times. Skipping that file."
    return status is 0, which is wrong. found this problem in s3cmd version 1.0.1.

    I believe priority of this should be increased .