You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intermittent RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
#4573
Open
hetpatel33 opened this issue
Jan 16, 2024
· 2 comments
Getting request timeout in a pipeline job intermittently when trying to upload a directory of assets to S3 using aws-sdk. The error persists once it occurs in a workspace. Already checked connectivity, couldn't find any issue with that. Tried increasing the timeout also, that was not helpful too.
20:22:13 at Request.callListeners (/mnt1/jenkins/workspace/spr-template-preview-build-v2@2/node_modules/aws-sdk/lib/sequential_executor.js:116:18) { 20:22:13 code: 'RequestTimeout', 20:22:13 region: null, 20:22:13 time: 2024-01-05T14:52:09.752Z, 20:22:13 requestId: 'KXS1VEZVPB199NDR', 20:22:13 extendedRequestId: 'e8aDplpOSLzfFhfHaGt8NACPl3cAxEnImTuDxOP6XKx6nkJ0cTNlK5Rf4w7gwAGQqG8EsekJPA4=', 20:22:13 cfId: undefined, 20:22:13 statusCode: 400, 20:22:13 retryable: true 20:22:13 } 20:22:13 RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
Expected Behavior
Should be able to upload the directly all the time without the timeout.
Current Behavior
Uploading failed with request timeout.
Reproduction Steps
No specific steps to reproduce, used below piece of code to upload the assets.
Can we start with verifying which upload operations (s3.upload or s3.putObject) and also share the part of the code where you're calling the operation method?
Hi @aBurmeseDev, below is the code snippet which we are using for uploading
consts3=require('s3');constAWS=require('aws-sdk');functiongetS3Client(){consts3ClientParams={};if(envConfig.storage.aws.region){s3ClientParams.region=envConfig.storage.aws.region;}if(envConfig.storage.aws.key){s3ClientParams.accessKeyId=envConfig.storage.aws.key;}if(envConfig.storage.aws.secret){s3ClientParams.secretAccessKey=envConfig.storage.aws.secret;}consts3Client=newAWS.S3(s3ClientParams);returns3.createClient({ s3Client });}/** * Syncs the directory at localDirPath, * with the directory at dirPrefix in the s3 bucket specified in environment * @returns {Promise} of uploading the directory */exportfunctionuploadDir(localDirPath,{ compress }){returnnewPromise((resolve,reject)=>{constclient=getS3Client();constuploader=client.uploadDir({localDir: localDirPath,s3Params: {Bucket: envConfig.storage.aws.bucket,Prefix: envConfig.storage.aws.prefix||'',ContentEncoding: compress ? 'gzip' : '',ACL: 'public-read',},});uploader.on('end',resolve);uploader.on('error',reject);});}
`
Describe the bug
Getting request timeout in a pipeline job intermittently when trying to upload a directory of assets to S3 using aws-sdk. The error persists once it occurs in a workspace. Already checked connectivity, couldn't find any issue with that. Tried increasing the timeout also, that was not helpful too.
20:22:13 at Request.callListeners (/mnt1/jenkins/workspace/spr-template-preview-build-v2@2/node_modules/aws-sdk/lib/sequential_executor.js:116:18) { 20:22:13 code: 'RequestTimeout', 20:22:13 region: null, 20:22:13 time: 2024-01-05T14:52:09.752Z, 20:22:13 requestId: 'KXS1VEZVPB199NDR', 20:22:13 extendedRequestId: 'e8aDplpOSLzfFhfHaGt8NACPl3cAxEnImTuDxOP6XKx6nkJ0cTNlK5Rf4w7gwAGQqG8EsekJPA4=', 20:22:13 cfId: undefined, 20:22:13 statusCode: 400, 20:22:13 retryable: true 20:22:13 } 20:22:13 RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
Expected Behavior
Should be able to upload the directly all the time without the timeout.
Current Behavior
Uploading failed with request timeout.
Reproduction Steps
No specific steps to reproduce, used below piece of code to upload the assets.
Possible Solution
No response
Additional Information/Context
No response
SDK version used
2.1336.0
Environment details (OS name and version, etc.)
Jenkins Pipeline Job
The text was updated successfully, but these errors were encountered: