You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aws s3 cp ~/testfile s3://BUCKET/testfile does not upload when CWD does not exist anymore. However, it returns an exit code of zero indicating success!
Expected Behavior
The file is uploaded to S3. It does not matter when the CWD does not exist anymore.
Current Behavior
The command returns immediately, without uploading it and with an exit code of 0 which indicates success.
Reproduction Steps
Create a testfile with echo test > ~/testfile.
Create an empty directory, then change into it and remove that directory: mkdir ~/testdir && cd ~/testdir && rmdir ~/testdir. The current working directory of the terminal is now invalid.
Now, the command aws s3 cp ~/testfile s3://BUCKET/testfile will return immediately and not upload the file. However, it returns error code zero indicating success!
$ aws s3 cp ~/test s3://BUCKET/test
$ echo $?
0
Possible Solution
Upload the file when an absolute path is provided; or at least do not return a exit code of zero if it is not actually uploaded.
Hi @ustrahlendorf,
I am able to confirm that this is a bug related to CLI v1 and disappears in CLI v2.
The best way to work around this immediately would be to upgrade to one of the latest versions of aws-cli v2.
Will also keep this open for the team to prioritize a fix.
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
Describe the bug
aws s3 cp ~/testfile s3://BUCKET/testfile
does not upload when CWD does not exist anymore. However, it returns an exit code of zero indicating success!Expected Behavior
The file is uploaded to S3. It does not matter when the CWD does not exist anymore.
Current Behavior
The command returns immediately, without uploading it and with an exit code of 0 which indicates success.
Reproduction Steps
Create a testfile with
echo test > ~/testfile
.Create an empty directory, then change into it and remove that directory:
mkdir ~/testdir && cd ~/testdir && rmdir ~/testdir
. The current working directory of the terminal is now invalid.Now, the command
aws s3 cp ~/testfile s3://BUCKET/testfile
will return immediately and not upload the file. However, it returns error code zero indicating success!Possible Solution
Upload the file when an absolute path is provided; or at least do not return a exit code of zero if it is not actually uploaded.
Additional Information/Context
No response
CLI version used
aws-cli/1.22.87 Python/3.10.4 Linux/5.17.1-arch1-1 botocore/1.24.32
Environment details (OS name and version, etc.)
Linux 5.17.1-arch1-1 #1 SMP PREEMPT Mon, 28 Mar 2022 20:55:33 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: