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

Do not throw exception if file exists #188

Open
ralphholz opened this issue Feb 16, 2021 · 2 comments
Open

Do not throw exception if file exists #188

ralphholz opened this issue Feb 16, 2021 · 2 comments

Comments

@ralphholz
Copy link

Version from pip3 - 2.1.0 - crashes when a file already exists in the bucket:

(s4cmd) $ s4cmd put bla.zip s3://bla/bla/
[Runtime Failure] File already exists: s3://bla/bla/bla.zip
Exception in thread Thread-1:ead(s)]
Traceback (most recent call last):
[Thread Failure] File already exists: s3://bla/bla/bla.zip

I wonder if an exception is unavoidable or if s3 can return an error to evaluate. I also think the exception needs to be caught and treated.

@kishaningithub
Copy link

@ralphholz did you find any work arounds for this?

@kishaningithub
Copy link

kishaningithub commented Apr 11, 2023

Found the workaround...

For those who stumble on this issue, the workaround is to use the --force flag when performing put operation, this flag makes sure that the command succeeds even if the file already exists

https://github.com/bloomreach/s4cmd#s4cmd-put-source-target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants