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.
22 Replies
Project ID:
N/A
N/A
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
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.
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
Could you give me an example of that please?
Because I am partitioning the files for upload
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
Ok, thank you very much anyway, that makes it clear to me that we have to do the uploading in another way
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
I just checked, and we are using chunked loads
you'd need to split the chunks into small enough pieces so that no single chunk can take longer than 5 minutes to upload
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
some request to your app is taking longer than 5 minutes then
If we make this asynchronous, could that help?
as long as no single request takes 5 minutes, your problem is solved
How can I read logs on the server?
you've already shown me the logs? meaning you know how to read them?
ye, show me locally but not on the server
as long as you log unbuffered to stdout / stderr you will see the log in the deployments log window
They should appear there but I don't see any sout that I have
I'm sorry, I'm not a java developer, I can only tell you about your issues at a high level
Ok, I'll check further with other coding tests