Anouar Kacem Anouar Kacem - 5 months ago 150
Node.js Question

Getting Error: connect ECONNREFUSED node.js

I am trying to connect to odoo via odoo-xmlrpc

var odoo = new Odoo({
url: '',
port: 80,
db: 'Data_Base',
username: 'username',
password: 'password'

my debugger shows "client normal" for the second line (console.log(err)) of the code below

odoo.connect(function (err) {
if (err) { return console.log(err); }
console.log('Connected to Odoo server.');

and this Error for the 3rd line :

{ Error: connect ECONNREFUSED
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
syscall: 'connect',
address: '',
port: 80 }

I am using meanjs 0.5.0, this is the development configuration

port: process.env.PORT || 3000,
host: process.env.HOST || 'localhost',

I tried to use the same code on loopbackjs and it worked, but i need to deploy my app on meanjs why am I getting this error ?

Answer Source

I was using odoo-xmlrpc 1.0.5 on loopbackjs and 1.0.6 on meanjs ... When I downgraded to to 1.0.5 it worked on meanjs and to be sure about that i upgraded the package on loopback and i had the same error ...

so it is a version issue at the moment. thank you for passing by.


Must use http://url or https://url

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download