Skip to content

sync with wrong object name fails but exits successfully #869

Open

Description

@feliqarnot

When I try to sync an s3 object file with a local folder that doesn't exist, it throws an error message but still exits successfully (0 exit code).
Here are the code to reproduce :

$ s5cmd --credentials-file ~/.aws/credentials                         --profile my-profile                         --endpoint-url https://my.endpoint.url                         sync s3://source-bucket/prefix /non-existing/folder/
ERROR "sync s3://source-bucket/prefix/s3_obj /non-existing/folder/": no object found
$ echo $?
0

I would instead expect s5cmd to return a non-zero exit code when an "ERROR" happens.

Related: #824

Activity

  1. terryrankine commented on Sep 18, 2026

    @terryrankine

    Root cause: sync only surfaced errors from the executed cp/rm subcommands; anything printed while listing or planning (no object found, Glacier objects, sort failures) was dropped from the exit code. Fixed in terryrankine/s5cmd (terryrankine#18): every printed ERROR now makes sync exit 1. Released in v2.4.1 of that fork; upstream PR to follow once #879–#886 get a review.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions