{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1768","repository_url":"https://api.github.com/repos/aws/aws-sdk-js","labels_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1768/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1768/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1768/events","html_url":"https://github.com/aws/aws-sdk-js/issues/1768","id":267393553,"node_id":"MDU6SXNzdWUyNjczOTM1NTM=","number":1768,"title":"Amazon S3 file upload node js socket hang up and write ECONNRESET error ","user":{"login":"usamamashkoor","id":8676339,"node_id":"MDQ6VXNlcjg2NzYzMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/8676339?v=4","gravatar_id":"","url":"https://api.github.com/users/usamamashkoor","html_url":"https://github.com/usamamashkoor","followers_url":"https://api.github.com/users/usamamashkoor/followers","following_url":"https://api.github.com/users/usamamashkoor/following{/other_user}","gists_url":"https://api.github.com/users/usamamashkoor/gists{/gist_id}","starred_url":"https://api.github.com/users/usamamashkoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usamamashkoor/subscriptions","organizations_url":"https://api.github.com/users/usamamashkoor/orgs","repos_url":"https://api.github.com/users/usamamashkoor/repos","events_url":"https://api.github.com/users/usamamashkoor/events{/privacy}","received_events_url":"https://api.github.com/users/usamamashkoor/received_events","type":"User","site_admin":false},"labels":[{"id":36313613,"node_id":"MDU6TGFiZWwzNjMxMzYxMw==","url":"https://api.github.com/repos/aws/aws-sdk-js/labels/Feedback%20Requested","name":"Feedback Requested","color":"e102d8","default":false},{"id":13276310,"node_id":"MDU6TGFiZWwxMzI3NjMxMA==","url":"https://api.github.com/repos/aws/aws-sdk-js/labels/Question","name":"Question","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-21T16:19:09Z","updated_at":"2018-07-14T18:13:36Z","closed_at":null,"author_association":"NONE","body":"Hi i am uploading a video file to amazon s3 bucket the file is inside my project folder. but i am getting the following error  when i tries to upload the file.\r\n```\r\nerror in callback\r\n{ NetworkingError: socket hang up\r\n    at createHangUpError (_http_client.js:254:15)\r\n    at TLSSocket.socketOnEnd (_http_client.js:346:23)\r\n    at emitNone (events.js:91:20)\r\n    at TLSSocket.emit (events.js:185:7)\r\n    at endReadableNT (_stream_readable.js:974:12)\r\n    at _combinedTickCallback (internal/process/next_tick.js:74:11)\r\n    at process._tickDomainCallback (internal/process/next_tick.js:122:9)\r\n  message: 'socket hang up',\r\n  code: 'NetworkingError',\r\n  retryable: true,\r\n  statusCode: 400 }\r\nand sometimes i also get this error to \r\nError: write ECONNRESET\r\n  errno: 'ECONNRESET',\r\n```\r\nHere is my code for uploading the file \r\n```\r\nconst path = require('path');\r\nconst fs   = require('fs');\r\nconst AWS = require('aws-sdk');\r\n\r\nAWS.config.update({\r\n  region: \"us-east-1\",\r\n  accessKeyId: \"my key\",\r\n  secretAccessKey: \"my secret\",\r\n});\r\nlet S3 = new AWS.S3({httpOptions: {timeout: 0},params: {Bucket: bucket_name'}});\r\nfunction uploadToS3(file) {\r\n  fs.readFile(file, function (err, data) {\r\n      var params = {\r\n        Key: 'videoobitio360.mp4',\r\n        Body: data\r\n      };\r\n      var options = {partSize: 5 * 1024 * 1024, queueSize: 4};\r\n      S3.upload(params,options, function (err, data) {\r\n        if (err) {\r\n          console.log('error in callback');\r\n          console.log(err);\r\n        }\r\n        console.log('success');\r\n        console.log(data);\r\n      });\r\n });    \r\n} \r\n```\r\ni have tried setting httpOptions: {timeout: 0} to 0 also but it also did not work.\r\nkindly help me on this issue.\r\nThanks.\r\n\r\n  "},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-js/issues/comments/405040561","html_url":"https://github.com/aws/aws-sdk-js/issues/1768#issuecomment-405040561","issue_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1768","id":405040561,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTA0MDU2MQ==","user":{"login":"usamamashkoor","id":8676339,"node_id":"MDQ6VXNlcjg2NzYzMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/8676339?v=4","gravatar_id":"","url":"https://api.github.com/users/usamamashkoor","html_url":"https://github.com/usamamashkoor","followers_url":"https://api.github.com/users/usamamashkoor/followers","following_url":"https://api.github.com/users/usamamashkoor/following{/other_user}","gists_url":"https://api.github.com/users/usamamashkoor/gists{/gist_id}","starred_url":"https://api.github.com/users/usamamashkoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usamamashkoor/subscriptions","organizations_url":"https://api.github.com/users/usamamashkoor/orgs","repos_url":"https://api.github.com/users/usamamashkoor/repos","events_url":"https://api.github.com/users/usamamashkoor/events{/privacy}","received_events_url":"https://api.github.com/users/usamamashkoor/received_events","type":"User","site_admin":false},"created_at":"2018-07-14T18:13:36Z","updated_at":"2018-07-14T18:13:36Z","author_association":"NONE","body":"I think you will have to use queue mean upload file in chunks of 5 mb . You can open 4 queues."}}
{"actor":{"display_login":"usamamashkoor"}}