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

S3 command fails silently when copying large file to location without permission #1645

Closed
phss opened this issue Nov 16, 2015 · 3 comments
Closed
Assignees
Labels
bug This issue is a bug. s3

Comments

@phss
Copy link
Contributor

phss commented Nov 16, 2015

This only happens when copying files larger than a certain size, but not sure what is the threshold. For smaller files, when copying to a directory I don't have permission, I correctly see the permission denied error and the command exits with status 1. But for large files the command just stops, without printing to the output and the exit status is 0.

Steps to reproduce:

mkdir access-denied
sudo chown root:wheel access-denied/
aws s3 cp s3://some-bucket/large-file.gz access-denied/
# Result: nothing in the output and exit code is 0
# Expected: exit code of 1 and output showing premission denied

Looking at the code, it seems the S3 copy command behaves differently depending on the size of the file being copied. For smaller files it seem to just download the file in a single thread. But for larger files it starts multiple threads, each downloading parts of the file. The single threaded process correctly output the error, but the multi-threaded doesn't.

I suspect this might affect other S3 commands as well.

Pull request to follow.

@phss
Copy link
Contributor Author

phss commented Nov 16, 2015

I think this is also related to issues #1069 and #1442.

On #1069, the reported mentioned copying a large file. On #1442, there are mentions of the copy command failing silently and with 0 status code.

@jamesls jamesls self-assigned this Nov 17, 2015
@jamesls
Copy link
Member

jamesls commented Nov 17, 2015

Excellent, taking a look at this now.

@jamesls jamesls added pr:needs-review This PR needs a review from a Member. bug This issue is a bug. s3 confirmed and removed pr:needs-review This PR needs a review from a Member. labels Nov 17, 2015
@jamesls
Copy link
Member

jamesls commented Nov 17, 2015

@phss I've confirmed that your PR also fixes #1442:

$ aws s3 cp s3://bucket/larger ~/tmpfs/larger2
download failed: s3://bucket/larger to ../../tmpfs/larger2
[Errno 28] No space left on device: u'/Users/jamessar/tmpfs/larger2'
$ echo $?
1

Thanks!

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. s3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants