Skip to content

Storage: lots of "socket hang up" errors #2623

Closed

Description

@ovaris

Environment details

  • OS:
  • Node.js version: 8.5.0
  • npm version: 5.3.0
  • google-cloud-node/storage version: 1.2.1

I have a utlity nodejs script that checks existence of few thousands of files in cloud storage.
I run script locally, so not in Cloud environment.
I'm executing those checks (bucket.file(fileName).exists()) in batch of 20, so not all checks are fired concurrently.
I'm seeing lots of these errors when trying to run script:

{ Error: socket hang up
    at TLSSocket.onHangUp (_tls_wrap.js:1140:19)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:110:20)
    at TLSSocket.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1059:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  code: 'ECONNRESET',
  path: null,
  host: 'accounts.google.com',
  port: 443,
  localAddress: undefined }

and these:

{ Error: read ECONNRESET
    at _errnoException (util.js:1026:11)
    at TLSWrap.onread (net.js:606:25) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }

aaand these:

{ Error: socket hang up
    at createHangUpError (_http_client.js:345:15)
    at TLSSocket.socketOnEnd (_http_client.js:437:23)
    at emitNone (events.js:110:20)
    at TLSSocket.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1059:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9) code: 'ECONNRESET' }

I have added this fix (suggested here: #2254):

const gcs = storage();
//https://github.com/GoogleCloudPlatform/google-cloud-node/issues/2254
gcs.interceptors.push({
    request: function(reqOpts) {
        reqOpts.forever = false;
        return reqOpts
    }
});

I have tried to reduce the check batch size, but it didn't have any effect.

Activity

  1. stephenplusplus commented on Sep 21, 2017

    @stephenplusplus
    Contributor

    Can you share a small gist or repo that I can use to try to reproduce?

  2. ovaris commented on Sep 21, 2017

    @ovaris
    Author
  3. stephenplusplus commented on Sep 21, 2017

    @stephenplusplus
    Contributor

    It's a bit hard to go from that, since I can't tap into the firebase instance. Can you try to replicate the problem without any external dependencies?

  4. lukesneeringer commented on Sep 21, 2017

    @lukesneeringer
    Contributor

    This issue was moved to googleapis/nodejs-storage#27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions