tanweerdev
When request hangs control gained back is not printed(when I try to upload files bigger than 20 mb) But I see below error in my console
[warn] ExAws: HTTP ERROR: :closed for URL: "https://logs.us-east-2.amazonaws.com/" ATTEMPT: 1
I use below code to upload files
res = files_list
|> Task.async_stream(&upload_file(&1, images_upload), max_concurrency: 4, timeout: 1_500_000)
|> Stream.run()
IO.inspect "control gained back"
res
and
def upload_file({file_type, local_file_path, file_name}, %ImagesUpload{} = images_upload) do
file = File.read!(local_file_path)
destination_path = Path.join([images_upload.upload_id, @file_types[file_type], file_name])
S3.put_object(component_bucket(), destination_path, file)
|> ExAws.request!()
Logger.info("uploaded image #{destination_path}")
{:ok, destination_path}
end
and in postman I get msg
Could not get response
Error: socket hang up
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hi everyone.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
How Can I Optimise Compile Time Dependencies
I have been building an elixir application for about 2 years now. Many modules and files ha...
New
Other Trending Topics
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Eiji
@tanweerdev Connection could be closed for various reasons more or less related with client. However if you did not reached any edge-case I think that you hit some timeout. Did you tried changing
hackneyoptions? Did you triedretriesconfiguration?I guess you have just started using this library or some configuration you have is still default (
ATTEMPT: 1so most probably no retries configuration). For bigger files and especially for slow internet connection chance for timeout may be really big, so it’s important that proper download/upload strategy is used regardless of service/software you use as everything have limits.Also is your internet stable? I don’t think it’s that, but it’s just a good example … Some time ago fiber network I’m using was overloaded (people stay at home - read: “facebook” - because of covid restrictions) and I had many connection problems that time.
tanweerdev
I see, in some cases it retried upto 5 times. I have added provided 25 mins timeout option Task.async_stream but before even 25 mins, request is closed and control is not returned back
tanweerdev
It could be the reason. But I and also my friend has tried on stable internet connection and same happens when files total size is more than 20 mb
tanweerdev
The problem is I am always returning {:ok, some_response} so it should give back cotrol even if something didnt go expected
tanweerdev
No. But Trying now
tanweerdev
Now I have added below configs
and
Just to be on safe side
Eiji
Hmm … previously I used only smaller files, so I don’t really know what may go wrong, but I found this site:
What do you think about playing a bit with
multipart_chunksize? Maybe it could be good for you to set to something like10mbor maybe even smaller … For sure it’s more like workaround, but could also optimize your project. Again I did not made such things before, but it should work asex_awsprovides a way to readconfigurationfrom AmazonCLIfiles.tanweerdev
Could it be related to socket or request processing? why I think it could be because as soon as I see below msg
All the processing stops for sure. Even if there is no warning or something
Note: Last time POST request hang up after 6-7 mins although I have 25 mins timeout option almost everywhere
Eiji
I’m of course not sure, but asked myself if there is a problem with
20mbfile then how it would work in case we would send exactly same file in smallerchunks?ok, I see that most probably I would not able to reproduce that … I have 100/100 Mbps fiber internet, so sending
20mbfile would definitely not take so much timeI saw similar problems in other libraries (other languages) and there with exactly same error people found that the configuration was incorrect, but it does not looks like your use case …
tanweerdev
We upload 50 mb zipped file for testing purpose. Potentially file can be as big as 3 GB according to requirements at least in production. We have to unzip the file, upload each individual image/document which isnt normally bigger than few mbs.