-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Timeout in FileAdapter or Empty response from server when trying to upload a small size file #3830
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
Comments
You need to set the maxUploadSize, it's 20Mb by default https://github.com/parse-community/parse-server/blob/master/src/ParseServer.js#L122 |
@flovilmart So why can't I upload a 19MB file |
@flovilmart I just set the maxUploadSize to '30mb' and result is exactly the same. |
ANd if you bump it even more? |
@flovilmart Just set '100mb' and nothing changed |
I'll have a look |
Are you noticing the issue only locally? What are the logs when running with VERBOSE=1? |
I don't remember if this was the case at the time I created the issue. But now, with parse-server 2.6.3 on a remote server, there is no more timeout. |
@cjosepha Hi can you pls share how you did this i'm also facing the same issue, i cannot upload large files |
@Sarun1001 basically I upgraded to higher Parse version and also edited my nginx configuration to increase the request body maximum size |
Issue Description
I try to save a 19MB file via the rest api with Curl. Sometimes Curl indicates that the server response is empty, and sometimes the server respond with code 130 "Could not store file." This behavior is totally unpredictable and seems due to a timeout error in the FileAdapter.
I tried with both the S3Adapter and the default GridStoreAdapter and they produce the same behavior that I've just mentioned.
When response is
{"code":130,"error":"Could not store file."}
the server logs indicates a timeout in the FileAdapter:connection 6 to ... timed out
for the GridStoreAdapterConnection timed out after 120000ms
for the S3AdapterI think this unpredictable behavior is a bug that should be fixed to save debugging time as the first responses was empty in my cases, so I didn't know there was a timeout issue.
Also note that sometimes, the timeout error log on the server can appear after (a few minutes) the Curl command returns and indicates that response is empty.
Can anyone provide me some answers about this :
Steps to reproduce
curl -X POST
-H "X-Parse-Application-Id: APP_ID"
-H "X-Parse-Master-Key: MASTER_KEY"
-H "Content-Type: text/plain"
-d "@file.txt"
http://localhost:1337/parse/files/file.txt
Expected Results
File successfully created as the file is under the 20MB limit.
Actual Outcome
Either an empty response or code 130 "Could not store file.", randomly.
Environment Setup
Server
Database
Logs/Trace
With GridStoreAdapter:
connection 6 to ... timed out MongoError: connection 6 to ... timed out
at Function.MongoError.create (/Users/.../dist/node_modules/mongodb-core/lib/error.js:29:11)
at Socket. (/Users/.../dist/node_modules/mongodb-core/lib/connection/connection.js:188:20)
at Socket.g (events.js:291:16)
at emitNone (events.js:86:13)
at Socket.emit (events.js:185:7)
at Socket._onTimeout (net.js:339:8)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
With S3Adapter:
Connection timed out after 120000ms TimeoutError: Connection timed out after 120000ms
at ClientRequest. (/Users/.../dist/node_modules/aws-sdk/lib/http/node.js:83:34)
at ClientRequest.g (events.js:291:16)
at emitNone (events.js:86:13)
at ClientRequest.emit (events.js:185:7)
at TLSSocket.emitTimeout (_http_client.js:626:10)
at TLSSocket.g (events.js:291:16)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket.Socket._onTimeout (net.js:339:8)
at ontimeout (timers.js:365:14)
The text was updated successfully, but these errors were encountered: