“Socket Hang Up” / ECONNRESET Error while uploading to Google Cloud Storage

拜拜、爱过 提交于 2020-01-06 07:00:46

问题


We're using Google Cloud Storage to store pictures uploaded by our users. For some reason, it stopped to work today.

var googleapis = require('googleapis');
var GoogleAuth = require('google-auth-library');

var googleAuth = new GoogleAuth();
var authClient = new googleAuth.JWTClient(
    accountEmail, keyFile, null,
    'https://www.googleapis.com/auth/devstorage.read_write'
);

authClient.authorize(function (err) {
    // Error here: { [Error: socket hang up] code: 'ECONNRESET' }
});

So it seems like I can not establish a connection to the Google Cloud Storage.


回答1:


I was using Node v0.12 and required the longjohn package. When I exclude the longjohn package (which is only for longer stack traces), it works. I don't know why, but maybe it helps someone.



来源:https://stackoverflow.com/questions/31998079/socket-hang-up-econnreset-error-while-uploading-to-google-cloud-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!