RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
See original GitHub issueI’m getting this error once in a while when making a putObject call.
What is the root cause of the error and what’s the best way to avoid it?
According to API response looks like this error is non-retryable. Is there a way to configure aws-sdk to make a retry when this type of error happens?
example response: {“message”:“Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.”,“code”:“RequestTimeout”,“time”:“2014-05-21T00:50:25.709Z”,“statusCode”:400,“retryable”:false,“_willRetry”:false}
Issue Analytics
- State:
- Created 9 years ago
- Comments:29 (5 by maintainers)
Top Results From Across the Web
You See: Your Socket Connection to the Server Was Not ...
If you get an error that says "your socket connection to the server was not read from or written to within the timeout...
Read more >amazon s3 upload file time out - Stack Overflow
Error Message : Your socket connection to the server was not read from or written to within the timeout period. Idle connections will...
Read more >S3 idle connection timeout | AWS re:Post
I have noticed that connection is closed by server after 3 - 5 seconds if it is not used for sending requests to...
Read more >S3(fix): Remove socket timeout for op to support upload large ...
S3Exception : Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be...
Read more >Error Responses - Amazon Simple Storage Service
Error Code Description HTTP Status Code
AccessControlListNotSupported The bucket does not allow ACLs. 400 Bad Request
AccessDenied Access Denied 403 Forbidden
BucketAlreadyOwnedByYou 409 Conflict (in all...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Now I have pinned point the issue on
2.68.0<=2.67.0have no problems.Further investigation:
The release change on
2.68.0is:Setting
signatureVersiontov2solve this problem:const s3 = new AWS.S3({signatureVersion: 'v2'});The followings don’t work:
const s3 = new AWS.S3();=>RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.const s3 = new AWS.S3({signatureVersion:'v4');=>RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.const s3 = new AWS.S3({signatureVersion:'v3');=>AccessDenied: Access DeniedI don’t have time to debug this, but I got the error as well. I uploaded a file from a website to my server (Node) using Ajax, and then uploaded it from my serverto S3 with code looking like this:
The funny thing is that it always fails for the first Ajax request I send, but it works for all that comes after. I don’t know if this is a bug in the AWS SDK or the package
multer(with express) I use to receive the uploaded file on my server (although I receive the file perfectly well as far as I can tell; it’s saved on my server).However, when I change my code to:
It works for all my Ajax request.
I might have done a mistake somewhere (I’m not an experience Node programmer), but hopefully this will help someone.