parse server migration cannot connect to mongo - mongodb

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.

Related

Connection with MongoDB Cloud frequently fail with ESERVFAIL error

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

strapi mongo flutter app connection error

When I install strapi via npm, then run "strapi new server" and then try to connect to mongodb atlas; It shows the following error.
(node:12564) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
⛔️ Connection test failed: failed to connect to server [oriapp-shard-00-01.pjvsw.mongodb.net:27017] on first connect [MongoNetworkError: connection 5 to oriapp-shard-00-01.pjvsw.mongodb.net:27017 closed
at TLSSocket. (C:\Users\Sharm\AppData\Local\Temp\strapi236c8a243294\node_modules\strapi-connector-mongoose\node_modules\mongodb\lib\core\connection\connection.js:356:9)
at Object.onceWrapper (events.js:422:26)
at TLSSocket.emit (events.js:315:20)
at TLSSocket.EventEmitter.emit (domain.js:483:12)
at net.js:674:12
at TCP.done (_tls_wrap.js:567:7) {
[Symbol(mongoErrorContextSymbol)]: {}
}]
So , the solution to the above problem:
Reinstall strapi using npm or yarn or any other package manager.
The ip whitelist in mongodb atlas in your cluster should have the ip address of your system.
when aysnchronous function is defined use Ipv4 in place of "localhost:1337".
Thus one will be good to go.

Can't connect to mongoDB: Mongo error { Error: querySrv ENODATA

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

MongoLab MongoDB login failed error

I'm getting this error when trying to login to MongoLab database via command line in Ubuntu
> 2015-07-02T13:44:05.682-0400 I NETWORK DBClientCursor::init call() failed
>2015-07-02T13:44:05.694-0400 E QUERY Error: error doing query: failed
at DBQuery._exec (src/mongo/shell/query.js:83:36)
at DBQuery.hasNext (src/mongo/shell/query.js:240:10)
at DBCollection.findOne (src/mongo/shell/collection.js:187:19)
at DB.runCommand (src/mongo/shell/db.js:58:41)
at DB.isMaster (src/mongo/shell/db.js:680:51)
at DB._getDefaultAuthenticationMechanism (src/mongo/shell/db.js:1227:27)
at DB._authOrThrow (src/mongo/shell/db.js:1252:33)
at (auth):6:8
at (auth):7:2 at src/mongo/shell/query.js:83
exception: login failed
Double-check that your client supports the version of MongoDB your server is running. If you're using one of our experimental databases, they were recently upgraded to MongoDB version 3.0 an its new SCRAM-SHA-1 authentication mechanism. Connecting to these databases now requires the 3.0 Mongo shell or a driver that supports SCRAM-SHA-1.
http://docs.mongodb.org/manual/release-notes/3.0-scram/#upgrade-drivers
If you have any questions, feel free to contact us at support#mongolab.com and we'd be happy to help.
Regards,
Jared

Error connecting meteor to external mongodb

I have a meteor web app that connects to a mongohq database. It's working correctly on heroku, but I can't get it to work on my localhost. It was working on localhost yesterday, but not today.
To be certain, I just ran a git clone in a new folder. Even this clone is throwing errors on localhost. Here's my terminal (FYI, I'm on a windows 8.1 machine that is running an Ubuntu virtual box; also, I've removed the username / password from the log, below):
adam#adam-VirtualBox:~/resSingleTestV2/faze1tables$ export MONGO_URL=mongodb://<username>:<password>#oceanic.mongohq.com:10033/test_db
adam#adam-VirtualBox:~/resSingleTestV2/faze1tables$ meteor
[[[[[ ~/resSingleTestV2/faze1tables ]]]]]
=> Started proxy.
=> Started your app.
=> App running at: http://localhost:3000/
I20140511-12:53:43.438(-4)? Exception in callback of async function: Error: failed to connect to [oceanic.mongohq.com:10033]
I20140511-12:53:43.637(-4)? at null.<anonymous> (/home/adam/.meteor/packages/mongo-livedata/0120179b5c/npm/node_modules/mongodb/lib/mongodb/connection/server.js:536:74)
I20140511-12:53:43.640(-4)? at EventEmitter.emit (events.js:106:17)
I20140511-12:53:43.641(-4)? at null.<anonymous> (/home/adam/.meteor/packages/mongo-livedata/0120179b5c/npm/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15)
I20140511-12:53:43.641(-4)? at EventEmitter.emit (events.js:98:17)
I20140511-12:53:43.643(-4)? at Socket.<anonymous> (/home/adam/.meteor/packages/mongo-livedata/0120179b5c/npm/node_modules/mongodb/lib/mongodb/connection/connection.js:516:10)
I20140511-12:53:43.643(-4)? at Socket.EventEmitter.emit (events.js:95:17)
I20140511-12:53:43.644(-4)? at net.js:440:14
I20140511-12:53:43.644(-4)? at process._tickCallback (node.js:415:13)
Any help appreciated. Thanks.
I'm connecting via my school's wifi. Turns out they must've done something to prevent me from connecting to mongoHQ because I'm able to connect via other networks.
Strange that it worked for a day or two and then stopped.