R
Railway10mo ago
JuanseGm

Error uploading files

I'm trying to upload large files, it worked for me once and out of nowhere it stopped working on the server. I handle my exceptions and I don't see my custom messages, I'm also trying to see the error with logs and it doesn't show them to me, because this error only happens to me on the server, locally it works for me. I'm working with Java and uploading to amazon s3.
No description
22 Replies
Percy
Percy10mo ago
Project ID: N/A
JuanseGm
JuanseGmOP10mo ago
N/A
Brody
Brody10mo ago
you say you are uploading large files to s3, but where are these large files coming from because to me this error looks like an error from an unhandled exception of a large file being uploaded to your app since the error talks about reading, not writing
JuanseGm
JuanseGmOP10mo ago
The files come from my computer. The problem is that it gives me that error after exactly 5 minutes. Even so, it consumes server ram, network and cpu memory.
Brody
Brody10mo ago
right you didn't mention this was an error you get when uploading files to your app, so my assumption was dead on you said 5 minutes, railway has a max request time of 5 minutes, you would have to implement chunked uploads
JuanseGm
JuanseGmOP10mo ago
Could you give me an example of that please? Because I am partitioning the files for upload
Brody
Brody10mo ago
these help threads aren't really for coding help, but I'm sure there are a few server libraries for java that handle chunked uploads
JuanseGm
JuanseGmOP10mo ago
Ok, thank you very much anyway, that makes it clear to me that we have to do the uploading in another way
Brody
Brody10mo ago
though, depending on if your code needs to modify the uploaded files or not, you could return to the user a signed S3 url for the client to upload to still recommended to do chunked uploads for that too
JuanseGm
JuanseGmOP10mo ago
I just checked, and we are using chunked loads
Brody
Brody10mo ago
you'd need to split the chunks into small enough pieces so that no single chunk can take longer than 5 minutes to upload
JuanseGm
JuanseGmOP10mo ago
I don't know if it's time to convert the async method We have each part of the file at 5mb, with 10 threads
Brody
Brody10mo ago
some request to your app is taking longer than 5 minutes then
JuanseGm
JuanseGmOP10mo ago
If we make this asynchronous, could that help?
Brody
Brody10mo ago
as long as no single request takes 5 minutes, your problem is solved
JuanseGm
JuanseGmOP10mo ago
How can I read logs on the server?
Brody
Brody10mo ago
you've already shown me the logs? meaning you know how to read them?
JuanseGm
JuanseGmOP10mo ago
ye, show me locally but not on the server
Brody
Brody10mo ago
as long as you log unbuffered to stdout / stderr you will see the log in the deployments log window
JuanseGm
JuanseGmOP10mo ago
They should appear there but I don't see any sout that I have
Brody
Brody10mo ago
I'm sorry, I'm not a java developer, I can only tell you about your issues at a high level
JuanseGm
JuanseGmOP10mo ago
Ok, I'll check further with other coding tests
Want results from more Discord servers?
Add your server