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

aws cp ~/testfile s3://BUCKET/testfile silently fails to upload when current working directory does not exist aymore #6844

Closed
keisentraut opened this issue Apr 3, 2022 · 3 comments
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue s3 v1

Comments

@keisentraut
Copy link

keisentraut commented Apr 3, 2022

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!

$ 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.

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

@keisentraut keisentraut added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 3, 2022
@aaoswal aaoswal added the s3 label Apr 4, 2022
@aaoswal aaoswal self-assigned this Apr 4, 2022
@aaoswal aaoswal added needs-review This issue or pull request needs review from a core team member. v1 and removed needs-triage This issue or PR still needs to be triaged. labels Apr 4, 2022
@aaoswal
Copy link

aaoswal commented Apr 5, 2022

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.

@aaoswal aaoswal removed the needs-review This issue or pull request needs review from a core team member. label Apr 6, 2022
@tim-finnigan tim-finnigan added the p3 This is a minor priority issue label Nov 9, 2022
@tim-finnigan tim-finnigan self-assigned this Aug 20, 2024
@tim-finnigan
Copy link
Contributor

We recommend using v2, here are instructions on migrating. As this is an edge case in v1 I'm going to close this as not planned.

@tim-finnigan tim-finnigan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2024
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue s3 v1
Projects
None yet
Development

No branches or pull requests

3 participants