I've set up an arangodb cluster within google cloud kubernetes. When I try to call methods using ArangoJS, it randomly throws following error.
Error: read ECONNRESET
at exports._errnoException (util.js:1020:11)
at TLSWrap.onread (net.js:580:26)
code: 'ECONNRESET',
errno: 'ECONNRESET',
syscall: 'read',
Also within the error there's a line with
authorizationError: 'SELF_SIGNED_CERT_IN_CHAIN',
It doesn't seems to occur when the server is already reading from the database, but when it reads from database after some idle period. (There's a load balancer in-between also)
Can anyone help me here?
Related
I have created a MongoDB Cloud Database to test my NodeJs Backend.
Ocassionally (probably the 70% of the time), I cant connect and the connect and the console throws the following error log:
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
Error: querySrv ESERVFAIL _mongodb._tcp.cluster0.u08yi.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (node:dns:213:19) {
errno: undefined,
code: 'ESERVFAIL',
syscall: 'querySrv',
hostname: '_mongodb._tcp.cluster0.u08yi.mongodb.net'
}
The weird thing is that I can connect sometimes. Is it because it is free and then it is prone to fail? It is getting frustrating since sometimes I have to keep updating my nodemon hoping for the ddbb to connect.
I already allowed my IP access.
Im using Mongoose and connecting this way:
mongoose.connect(`mongodb+srv://username:password#cluster0.u08yi.mongodb.net/mydatabase?retryWrites=true&w=majority`,(err)=>{
if(err) throw err;
console.log("MongoDB Connected Successfully");
})
mongodb connection error with node and express.
The error:
at QueryReqWrap.onresolve [as oncomplete] (dns.js:206:19) {
errno: undefined,
code: 'ECONNREFUSED',
syscall: 'querySrv',
hostname: '_mongodb._tcp.clustr0-a1rol.mongodb.net'
}
Here are some possible issues with this case:
Check your IP address is whitelisted with your MongoDB client
Check your connection URI once again to check the possible error with that.
Please check this other problem and solution. link
I have faced the same issue, whatever I done is:
restart my node server.
change my database user.
change my network and waiting sometime.
then tried to connect.
this time mongo connection was fine.
N.B- you can check your connection URI too, if its ok. then try with a different network.
My set-up consists of Node.js on Express on the back-end connected to mongoDB through mongoose. When I start the server, I get this error:
Mongo error { Error: querySrv ENODATA `database_hostname`
at errnoException (dns.js:55:10)
at QueryReqWrap.onresolve [as oncomplete] (dns.js:243:19)
code: 'ENODATA',
errno: 'ENODATA',
syscall: 'querySrv',
hostname: `database_hostname` }
This results in me not being able to run my application on localhost due to it being constantly loaded.
At the same time connecting using MongoDB Compass works fine.
The database used to be working fine, but after I changed the location where I have been using it and created manually a new collection in Compass, which did not have a set-up locally, I started getting this error.
Cluster configuration:
SRV Record: off
Read Preference: Primary
SSL: System CA / Atlas Deployment
SSH Tunnel: None
This is related to migration to parse server from api.parse.com.
On windows server, installed mongo db and nodeJS.
Installed Python.
Installed Parse Server.
Getting following error messages.
StyleChat is the name of the app.
http://localhost:1337/stylechat
parse-server-example running on port 1337. info: Parse LiveQuery
Server starts running warn: Unable to ensure uniqueness for usernames:
Error: read ECONNRESET
at exports._errnoException (util.js:1036:11)
at TCP.onread (net.js:564:26) warn: Unable to ensure uniqueness for user email addresses: Error: read ECONNRESET
at exports._errnoException (util.js:1036:11)
at TCP.onread (net.js:564:26) (node:252160) UnhandledPromiseRejectionWarning: Unhandled promise rejection
(rejection id: 4): MongoError: read ECONNRESET (node:252160)
UnhandledPromiseRej
if you run nodejs on window, you should use iisnode to run nodejs on iis.
i found this here
have fun.
I'm a begginer in NodeJS and when i run node MainApp.js in console I get this error:
C:\Assigment 2 (NodeJS)\node_modules\mongodb\lib\server.js:235
process.nextTick(function() { throw err; })
^
Error: getaddrinfo ENOTFOUND . .:27017
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
I don't know what this means. Inside MainApp I connect mongoose: mongoose.connect("./DataBase"); where DataBase is the folder where I run mongod --dbpath "C:\[...]\DataBase. The database server seems to start successfully, the console printing: [...] waiting for connections on port 27017.
server.js lines 231-236:
// Try to callback
try {
callback(err);
} catch(err) {
process.nextTick(function() { throw err; })
}
Package versions:
"express": "~4.13.1",
"mongodb": "~2.1.0",
"mongoose": "~4.3.1"
make sure that your database is up and running.
Go to your terminal and in your app directory run:
mongod
Then restart your node server and you should be good go
I do not understand the whole process yet, but I hope this answer will provide some insight:
It seems that running node or npm start without starting up the database returns this error.
If database is started, then changing
mongoose.connect("./DataBase"); (which previously caused the error)
to mongoose.connect('mongodb://localhost/database');fixes the issue.
Intuitively this seems to simply be the error MongoDB returns when it can't find the database used by the server, however this might not be the precise description of the issue.
If someone can provide further insight into the problem, such help would be appreciated.
I changed connection string from mongodb://localhost:27017/ to mongodb://127.0.0.1:27017/ and it worked.