“套接字挂断"; /ECONNRESET在上传到Google Cloud Storage时出错 [英] "Socket Hang Up" / ECONNRESET Error while uploading to Google Cloud Storage

查看:68
本文介绍了“套接字挂断"; /ECONNRESET在上传到Google Cloud Storage时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Google Cloud Storage存储我们的用户上传的图片.由于某种原因,它今天停止工作.

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' }
});

因此,似乎无法建立与Google Cloud Storage的连接.

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

推荐答案

我正在使用Node v0.12,并且需要使用longjohn软件包.当我排除longjohn软件包(仅用于较长的堆栈跟踪)时,它可以工作.我不知道为什么,但是也许可以帮助某人.

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.

这篇关于“套接字挂断"; /ECONNRESET在上传到Google Cloud Storage时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆