我在服务器上有一个看起来像这样的脚本。
request = require('request');
require('longjohn');
request.post(
{
url : 'https://example.com/api/thing/',
form : {
api_key : "blahblah",
thing_id : 0
},
json : true
},
function(error, response, body){
console.log(error, response);
}
);
当我在本地运行时,它工作得很好,但是当我在服务器上运行它时,我得到了这个。
{ [Error: read ECONNRESET]
code: 'ECONNRESET',
errno: 'ECONNRESET',
syscall: 'read',
__cached_trace__:
[ { receiver: [Object],
fun: [Function: errnoException],
pos: 22969 },
{ receiver: [Object], fun: [Function: onread], pos: 14584 },
{},
{ receiver: [Object], fun: [Function], pos: 19529 },
{ receiver: [Object], fun: [Function], pos: 49346 },
{ receiver: [Object],
fun: [Function: _tickCallback],
pos: 14030 },
{ receiver: [Object], fun: [Function], pos: 14031 },
{ receiver: [Object], fun: [Object], pos: 4502 },
{ receiver: [Object], fun: [Function], pos: 28039 },
{},
{ receiver: [Object], fun: [Function], pos: 48679 },
{ receiver: [Object], fun: [Function], pos: 36057 },
{ receiver: [Object], fun: [Object], pos: 40546 },
{ receiver: [Object], fun: [Function], pos: 3570 },
{ receiver: [Object], fun: [Function], pos: 17260 },
{ receiver: [Object], fun: [Function], pos: 36440 },
{ receiver: [Object], fun: [Function], pos: 11960 },
{},
{ receiver: [Object], fun: [Function], pos: 11634 },
{ receiver: [Object], fun: [Object], pos: 2292 },
{ receiver: [Object], fun: [Object], pos: 1738 },
{ receiver: [Object], fun: [Function], pos: 3238 },
{ receiver: {}, fun: [Function], pos: 121 },
{ receiver: [Object], fun: [Function], pos: 12854 },
{ receiver: [Object], fun: [Function], pos: 13365 },
{ receiver: [Object], fun: [Function], pos: 10114 } ],
__previous__:
{ [Error]
id: 73,
location: 'Readable.on (_stream_readable.js:679)',
__location__: 'EventEmitter.on',
__previous__:
{ [Error]
id: 60,
location: 'ClientRequest.onSocket (http.js:1700)',
__location__: 'process.nextTick',
__previous__: [Object],
__trace_count__: 2,
__cached_trace__: [Object] },
__trace_count__: 3,
__cached_trace__:
[ [Object],
[Object],
[Object],
[Object],
[Object],
[Object],
{},
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
{},
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object] ] } }
我不熟悉tcp套接字的细节。如果有人有任何想法或者您需要更多信息,请告诉我。
答案 0 :(得分:0)
最终由我们的rackspace托管支持团队解决了 - 这是一个硬件配置问题。
看起来你的问题是防火墙和防火墙之间的问题 负载均衡器。
看来这个问题是由DNS的医生引起的 防火墙。
如果我在xxx-node-prod-1上的/ etc / hosts文件中设置了ip地址 对于production.xxx.com是xxx.xxx.xxx.xxx,一切都很完美。
当curl命令命中私有时出现问题 负载均衡器的nat nat。
我们使用硬件FW和LB进行此设置,并且他们身边的东西很棘手。