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 put_object returns {:error, :timeout} but uploads file correctly #154

Open
pulzzedavid opened this issue Mar 2, 2023 · 6 comments
Open

Comments

@pulzzedavid
Copy link

When putting larger files taking more than few seconds to upload, AWS.S3.put_object call returns {:error, :timeout} even with timeout and recv_timeout configured

AWS.S3.put_object(client, bucket, file_name, %{"Body" => file, "ContentMD5" => md5}, [timeout: 50_000, recv_timeout: 50_000])
What is the correct way of executing request that takes longer to complete?

@onno-vos-dev
Copy link
Member

@pulzzedavid Ill try and poke around the Elixir codebase over the weekend to see if I can get a more detailed answer to your question but depending on how large of a file you're dealing with the recommendation from AWS would be to use multipart uploads. How big is the file you're trying to upload as AWS recommends multipart for anything more than 100GB.

@pulzzedavid
Copy link
Author

Thanks @onno-vos-dev. I am using files between 5MB - 70MB in size

@onno-vos-dev
Copy link
Member

Sorry for dropping this... Could you try with something along the lines of: #168 (comment)

Would that resolve your issue? 🤔

@pulzzedavid
Copy link
Author

pulzzedavid commented Dec 17, 2023 via email

@grant-zukowski-xumo
Copy link

I'm inconsistently seeing {:error, :timeout} as well but during "regular" executions. For example, listing distributions.

For creating a Medialive for example, the medialive gets created, but I get a {:error, :timeout} back, even though the resource was created.

@grant-zukowski-xumo
Copy link

grant-zukowski-xumo commented Sep 11, 2024

@pulzzedavid I ended up switching our client to Finch and I've not seen a "timeout" since. We even ran 40 calls in a row that sometime produce timeouts and never got a single one. For anyone else having this problem I recommend changing the underlying client.

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

No branches or pull requests

3 participants