-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 s3 silently fails to handle filesystem exceptions (e.g. broken symlinks) #425
Comments
Looks like there's two things needed to fix this:
|
@jamesis for number 2 I'd say: return non-success if there's any indication that files that were requested to be put on S3 didn't make it there. For my uses, I'd be happy if the exception that happens is propagated up to the user in some form and the sync/cp stops dead in its tracks. |
So perhaps (1) should be something you opt into, e.g |
You will now see an error message shown as well as a non zero RC: $ aws s3 sync anotherdir/ s3://jamesls-test-sync/ [Errno 2] No such file or directory: '/private/tmp/symlnk/anotherdir/z-badsylmink' $ echo $? 1 There is potential to add something like a ``--skip-bad-symlinks`` option, but the default behavior is to let the user know that we've hit a bad symlink. Fies aws#425 and aws#487.
You will now see an error message shown as well as a non zero RC: $ aws s3 sync anotherdir/ s3://jamesls-test-sync/ [Errno 2] No such file or directory: '/private/tmp/symlnk/anotherdir/z-badsylmink' $ echo $? 1 There is potential to add something like a ``--skip-bad-symlinks`` option, but the default behavior is to let the user know that we've hit a bad symlink. Fies aws#425 and aws#487.
I have a similar problem with a mounted file system. For example, aws s3 sync $src $dest --exclude ".backup/" --exclude ".git/" --exclude " Completed 12 part(s) with ... file(s) remaining The $src is in an AFS file system (I suspect it would have similar problem with NFS file system). The last component .backup is a AFS mounted mount point, which doesn't exist anymore. The entire images directory would be skipped, no other files get copied over. --exclude doesn't seem to work for a directory that has file system level problem underneath. Maybe to provide an option to skip and report errors but copy other objects over? Xueshan |
Symptoms
When trying to sync/cp from a local directory to S3,
aws cli
will exit silently, and with a non-error (0) exit status, if it runs into a filesystem exception. This issue can be reproduced with aws-cli v1.2.0.I noticed this problem while trying to sync a directory hierarchy that contained a broken symlink. The sync would begin, and then prematurely stop before all files had been sync'ed up, with no clear explanation as to why.
Turning on debug will provide the actual exception. In my case, it was an
os.stat
on a broken symlink:Reproducing The Problem
Create a set of test subdirectories/files, along with a broken symlink.
Setup an S3 bucket with nothing in it, to sync into.
Attempt to sync your test subdirectory into S3.
Note that nothing was put into the bucket, and no errors were reported.
Now, remove the broken symlink.
Note that files were sync'ed to the S3 bucket.
The text was updated successfully, but these errors were encountered: