SAP-archive / starter-NodeJS

Recast.AI official starter-kit for NodeJS
MIT License
21 stars 39 forks source link

Error: connect ECONNREFUSED 54.72.152.240:443 #5

Open rlopmar opened 6 years ago

rlopmar commented 6 years ago

Hi, your website is refusing me when sending a request. This was working a couple of weeks ago. Here my NodeJS code:

const recastai = require('recastai').default;
const myBotToken = '7342ac85a271995d596f6d21acfa0b88';

function setRecastBot(botToken){
    //let recastClient = new recastai('7342ac85a271995d596f6d21acfa0b88');
    let recastClient = new recastai(botToken);
    return recastClient;
};

let recastBot = setRecastBot(myBotToken);

recastBot.request.analyseText("Hello").then((response) => {
    console.log('response:');
    console.log(response);
    console.log('intent:');
    console.log(response.intent());
});

error:

(node:12532) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: connect ECONNREFUSED 54.194.194.229:443

Could you please assist?

dbousque commented 6 years ago

Hi @rafachurre , what happens if you run curl https://api.recast.ai, do you get the same error ? This error makes me suspect you can't query https://recast.ai from your code for some reason, because the public IP of the server was resolved. So I would guess it's some kind of firewall issue on your part or something like that. Do you use a proxy ?

rlopmar commented 6 years ago

Yes, I'm behind my company proxy. Just tested now form the public network and it works. Any configuration you recommend to use Recast behind a proxy?

dbousque commented 6 years ago

I have no idea, but I would say that the problem occurs because our API is not authorized by your proxy, or something of this nature. Could you give me the public IP of the proxy if you know it ? You can query curl ipinfo.io/ip using the proxy to find this out.

rlopmar commented 6 years ago

I think I can't give you this right now. But I'll contact IT department and let you know afterwards. Thank you. Rafael

jjwallaby commented 5 years ago

It seems the module 'recastai' does not handle to be able to use a proxy. Example most firms/companies have proxy to go outside. I do see the module tries to use superagent and superagent-proxy but it does not ready environment variable HTTP_PROXY. Would be good if recastai module can handle proxy.

anuraggupta816 commented 5 years ago

I am facing same issues

{ Error: connect ECONNREFUSED 185.82.212.199:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14) message: 'connect ECONNREFUSED 185.82.212.199:443', errno: 'ECONNREFUSED', code: 'NetworkingError', syscall: 'connect', address: '185.82.212.199', port: 443, region: 'US West (Oregon)', hostname: 'tngproduction.s3.us', retryable: true, time: 2019-04-23T09:34:18.787Z }

anuraggupta816 commented 5 years ago

{ Error: getaddrinfo ENOTFOUND tngproduction.s3.us tngproduction.s3.us:443 0|server | at errnoException (dns.js:50:10) 0|server | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26) 0|server | message: 'getaddrinfo ENOTFOUND tngproduction.s3.us tngproduction.s3.us:443', 0|server | code: 'NetworkingError', 0|server | errno: 'ENOTFOUND', 0|server | syscall: 'getaddrinfo', 0|server | hostname: 'tngproduction.s3.us', 0|server | host: 'tngproduction.s3.us', 0|server | port: 443, 0|server | region: 'US West (Oregon)', 0|server | retryable: true, 0|server | time: 2019-04-23T09:18:08.454Z },

anuraggupta816 commented 5 years ago

please help me

JaskiranKaur93 commented 5 years ago

hi, I am trying to connect to app center by 1) installing npm package i.e I am running command : npm install -g appcenter-cli on cmd and 2) then run appcenter login command 3) you'll get a code on browser. copy and paste on cmd I am not able to connect to app center , instead I am seeing below error Error: connect ECONNREFUSED 104.209.152.237:443

Any ideas, on how this will work

pooja241 commented 4 years ago

Did you find the solution for this .https://github.com/SAPConversationalAI/starter-NodeJS/issues/5#issuecomment-485734620

Aswin123as commented 3 years ago

i have faced the same issue, i solved it by clearing the authorization from the header. The problem was authorization did not meet the requirement.Hope this help for someone