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 sync, s3 cp no space left on device errors handling #1442

Closed
vinogradovs opened this issue Aug 10, 2015 · 12 comments
Closed

s3 sync, s3 cp no space left on device errors handling #1442

vinogradovs opened this issue Aug 10, 2015 · 12 comments
Labels
bug This issue is a bug. s3

Comments

@vinogradovs
Copy link

aws s3 sync and aws s3 cp to local disk don't handle free space left on device errors

aws s3 sync puts IOError: [Errno 28] No space left on device errors but still tries to continue sync
aws s3 cp doesn't give any error, tries to continue coping and returns 0 exit code at the end

@jamesls
Copy link
Member

jamesls commented Aug 10, 2015

Can you confirm what version of the CLI you're using (aws --version)?

@vinogradovs
Copy link
Author

1.7.44,
Hm, it seems strange, but now exit code is 1 if the whole bucket is synced. I will check this on other machine later.
The other problem is that if there are a lot of files to sync, it is needed to wait until utility finishes to try syncing of all of them, and syncing can be going for hours or in some cases even days.

@jamesls
Copy link
Member

jamesls commented Aug 11, 2015

Not sure I understand. Could you provide a script that demonstrates the issue. Here's what I tried. I'm seeing 0 rc's if the bucket is synced:

/tmp/foo $ aws s3 sync . s3://bucket/
upload: ./foo.txt to s3://bucket/foo.txt
/tmp/foo $ echo $?
0
/tmp/foo $ aws s3 sync . s3://bucket/
/tmp/foo $ echo $?
0

Note that if an error occurred during the syncing process a non zero will happen but we still keep trying to sync the remaining files for you. Here's some additional docs on the return codes used by the CLI: http://docs.aws.amazon.com/cli/latest/topic/return-codes.html#cli-aws-help-return-codes You can also see these docs by running aws help return-codes.

@jamesls jamesls added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed response-needed labels Aug 11, 2015
@chumaitoe
Copy link

I can confirm that aws s3 cp onto a device with insufficient space results in a partial copy and return code 0. aws-cli/1.7.44

@vinogradovs
Copy link
Author

Execuse me for long waiting,

simple script:
aws s3 sync s3://mybucket/ /mnt/mount_point_with_no_space_left/test/
echo $#

The second one with cp
aws s3 cp --recursive s3://mybucket/ /mnt/mount_point_with_no_space_left/test/
echo $#
In both cases I get 0 exit code, but also I get errors like this:

download failed: s3://mybucket//test/setup.log to ../mnt/mount_point_with_no_space_left/test/setup.log Could not create directory s3://mybucket/ /mnt/mount_point_with_no_space_left/test/test5: [Errno 28] No space left on device: 's3://mybucket/ /mnt/mount_point_with_no_space_left/test/test5'
Completed 201 of 227 part(s) with 1 file(s) remaining

And if we have a bucket with billions of files we can wait for a very long time to get the result of 0 after several days, it seems more efficient to stop copy/sync in case of error with no space left.

@chumaitoe
Copy link

Did you get those errors on the console? I got nothing.

I think you mean "$?" where you wrote "$#" there.

@vinogradovs
Copy link
Author

yes, It's a typo, I mean $?

@vinogradovs
Copy link
Author

Strange, on other machine it works as expected, it seems the problem is local

@mtdowling
Copy link
Member

Is this issue indeed local to your machine, or is there a reproducible test case you can provide that works on any/all machines? I'm trying to understand if this issue should remain open based on your last comment.

@chumaitoe
Copy link

In all my testing, copying a file onto a device with insufficient space (as opposed to no space) resulted in success return code with no complaint text - i.e., success behavior. So that seems like a test case to me..? Tried a couple of different machines, but not many - not sure what constitutes "different".

@mtdowling mtdowling added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 4, 2015
@alexaandru
Copy link

I also run into the "aws s3 cp" issue (not enough disk space, no error and exit code 0). Took me a while to figure out what the error was :) An error message would be very useful :) Cheers!

@jamesls jamesls added bug This issue is a bug. s3 confirmed and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Nov 17, 2015
@jamesls
Copy link
Member

jamesls commented Nov 18, 2015

Fixed via #1648.

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

No branches or pull requests

5 participants