{"action":"created","issue":{"url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/27","repository_url":"https://api.github.com/repos/googleapis/nodejs-storage","labels_url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/27/comments","events_url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/27/events","html_url":"https://github.com/googleapis/nodejs-storage/issues/27","id":259646668,"node_id":"MDU6SXNzdWUyNTk2NDY2Njg=","number":27,"title":"Storage: lots of \"socket hang up\" errors","user":{"login":"lukesneeringer","id":4346,"node_id":"MDQ6VXNlcjQzNDY=","avatar_url":"https://avatars0.githubusercontent.com/u/4346?v=4","gravatar_id":"","url":"https://api.github.com/users/lukesneeringer","html_url":"https://github.com/lukesneeringer","followers_url":"https://api.github.com/users/lukesneeringer/followers","following_url":"https://api.github.com/users/lukesneeringer/following{/other_user}","gists_url":"https://api.github.com/users/lukesneeringer/gists{/gist_id}","starred_url":"https://api.github.com/users/lukesneeringer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukesneeringer/subscriptions","organizations_url":"https://api.github.com/users/lukesneeringer/orgs","repos_url":"https://api.github.com/users/lukesneeringer/repos","events_url":"https://api.github.com/users/lukesneeringer/events{/privacy}","received_events_url":"https://api.github.com/users/lukesneeringer/received_events","type":"User","site_admin":false},"labels":[{"id":958354218,"node_id":"MDU6TGFiZWw5NTgzNTQyMTg=","url":"https://api.github.com/repos/googleapis/nodejs-storage/labels/:rotating_light:","name":":rotating_light:","color":"FFFFFF","default":false},{"id":699306494,"node_id":"MDU6TGFiZWw2OTkzMDY0OTQ=","url":"https://api.github.com/repos/googleapis/nodejs-storage/labels/priority:%20p2","name":"priority: p2","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"stephenplusplus","id":723048,"node_id":"MDQ6VXNlcjcyMzA0OA==","avatar_url":"https://avatars0.githubusercontent.com/u/723048?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"assignees":[{"login":"stephenplusplus","id":723048,"node_id":"MDQ6VXNlcjcyMzA0OA==","avatar_url":"https://avatars0.githubusercontent.com/u/723048?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false}],"milestone":null,"comments":17,"created_at":"2017-09-21T22:05:24Z","updated_at":"2018-10-09T15:12:07Z","closed_at":null,"author_association":"MEMBER","body":"_From @ovaris on September 21, 2017 8:31_\n\n#### Environment details\r\n\r\n  - OS:\r\n  - Node.js version: 8.5.0\r\n  - npm version: 5.3.0\r\n  - google-cloud-node/storage version: 1.2.1\r\n\r\nI have a utlity nodejs script that checks existence of few thousands of files in cloud storage.\r\nI run script locally, so not in Cloud environment.\r\nI'm executing those checks (`bucket.file(fileName).exists()`) in batch of 20, so not all checks are fired concurrently.\r\nI'm seeing lots of these errors when trying to run script:\r\n```\r\n{ Error: socket hang up\r\n    at TLSSocket.onHangUp (_tls_wrap.js:1140:19)\r\n    at Object.onceWrapper (events.js:314:30)\r\n    at emitNone (events.js:110:20)\r\n    at TLSSocket.emit (events.js:207:7)\r\n    at endReadableNT (_stream_readable.js:1059:12)\r\n    at _combinedTickCallback (internal/process/next_tick.js:138:11)\r\n    at process._tickCallback (internal/process/next_tick.js:180:9)\r\n  code: 'ECONNRESET',\r\n  path: null,\r\n  host: 'accounts.google.com',\r\n  port: 443,\r\n  localAddress: undefined }\r\n```\r\nand these:\r\n```\r\n{ Error: read ECONNRESET\r\n    at _errnoException (util.js:1026:11)\r\n    at TLSWrap.onread (net.js:606:25) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }\r\n```\r\naaand these:\r\n```\r\n{ Error: socket hang up\r\n    at createHangUpError (_http_client.js:345:15)\r\n    at TLSSocket.socketOnEnd (_http_client.js:437:23)\r\n    at emitNone (events.js:110:20)\r\n    at TLSSocket.emit (events.js:207:7)\r\n    at endReadableNT (_stream_readable.js:1059:12)\r\n    at _combinedTickCallback (internal/process/next_tick.js:138:11)\r\n    at process._tickCallback (internal/process/next_tick.js:180:9) code: 'ECONNRESET' }\r\n```\r\nI have added this fix (suggested here: https://github.com/GoogleCloudPlatform/google-cloud-node/issues/2254):\r\n```\r\nconst gcs = storage();\r\n//https://github.com/GoogleCloudPlatform/google-cloud-node/issues/2254\r\ngcs.interceptors.push({\r\n    request: function(reqOpts) {\r\n        reqOpts.forever = false;\r\n        return reqOpts\r\n    }\r\n});\r\n```\r\n\r\nI have tried to reduce the check batch size, but it didn't have any effect. \n\n_Copied from original issue: GoogleCloudPlatform/google-cloud-node#2623_"},"comment":{"url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/comments/428231748","html_url":"https://github.com/googleapis/nodejs-storage/issues/27#issuecomment-428231748","issue_url":"https://api.github.com/repos/googleapis/nodejs-storage/issues/27","id":428231748,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODIzMTc0OA==","user":{"login":"avishnyak","id":6599079,"node_id":"MDQ6VXNlcjY1OTkwNzk=","avatar_url":"https://avatars1.githubusercontent.com/u/6599079?v=4","gravatar_id":"","url":"https://api.github.com/users/avishnyak","html_url":"https://github.com/avishnyak","followers_url":"https://api.github.com/users/avishnyak/followers","following_url":"https://api.github.com/users/avishnyak/following{/other_user}","gists_url":"https://api.github.com/users/avishnyak/gists{/gist_id}","starred_url":"https://api.github.com/users/avishnyak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avishnyak/subscriptions","organizations_url":"https://api.github.com/users/avishnyak/orgs","repos_url":"https://api.github.com/users/avishnyak/repos","events_url":"https://api.github.com/users/avishnyak/events{/privacy}","received_events_url":"https://api.github.com/users/avishnyak/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T15:12:07Z","updated_at":"2018-10-09T15:12:07Z","author_association":"NONE","body":"Getting the same issue as @Scarysize when streaming a files from GCS using CreateReadStream.\r\n\r\nThe one difference is that we are using byte range parameters in the read stream so we are guaranteed that the amount of data downloaded is about 2mb.\r\n\r\n```js\r\n        return gcs.file(key).createReadStream({\r\n          start,\r\n          end,\r\n        })\r\n```\r\n\r\nWe still encounter ESOCKETTIMEDOUT after 60 seconds on random requests.  (Serving about 10 RPS)"}}
{"actor":{"display_login":"avishnyak"}}