Rocket.chat: MongoError: failed to connect to server [localhost:27017] on first connect

Created on 27 Sep 2016  路  9Comments  路  Source: RocketChat/Rocket.Chat

**Hi

After "node main.js" i have this error**

ubuntu@ip-10-0-1-57:~/Rocket.Chat$ export MONGO_URL=mongodb://localhost:27017/rocketchat
ubuntu@ip-10-0-1-57:~/Rocket.Chat$ export PORT=3000
ubuntu@ip-10-0-1-57:~/Rocket.Chat$ node main.js

/home/ubuntu/Rocket.Chat/programs/server/node_modules/fibers/future.js:313
throw(ex);
^
MongoError: failed to connect to server [localhost:27017] on first connect
at Object.Future.wait (/home/ubuntu/Rocket.Chat/programs/server/node_modules/fibers/future.js:449:15)
at new MongoConnection (packages/mongo/mongo_driver.js:216:27)
at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
at Object. (packages/mongo/remote_collection_driver.js:38:10)
at Object.defaultRemoteCollectionDriver (packages/underscore/underscore.js:750:1)
at new Mongo.Collection (packages/mongo/collection.js:103:40)
at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
at new AccountsServer (packages/accounts-base/accounts_server.js:18:5)
at meteorInstall.node_modules.meteor.accounts-base.server_main.js (packages/accounts-base/server_main.js:9:12)
at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
- - - - -
at [object Object]. (/home/ubuntu/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:313:35)
at emitOne (events.js:77:13)
at [object Object].emit (events.js:169:7)
at [object Object]. (/home/ubuntu/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:260:12)
at [object Object].g (events.js:260:16)
at emitTwo (events.js:87:13)
at [object Object].emit (events.js:172:7)
at Socket. (/home/ubuntu/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:162:49)
at Socket.g (events.js:260:16)
at emitOne (events.js:77:13)

Can you help me plz

deployment support

Most helpful comment

This might be a dumb question, but is your MongoDB server running?

All 9 comments

This might be a dumb question, but is your MongoDB server running?

@gertmenke thanks

ubuntu@ip-10-0-1-57:~$ sudo service mongod start

Failed to start mongod.service: Unit mongod.service not found.

i used this link and i update nodejs to 4.5.0
https://www.digitalocean.com/community/tutorials/how-to-install-configure-and-deploy-rocket-chat-on-ubuntu-14-04

That howto did work fine for me a while ago. Did you encounter any errors during the installation of MongoDB? Looks like it is not installed (correctly).

no errors during the installation of MongoDB

Just to be sure, check that MongoDB is really there:
dpkg-query -L mongodb-org-server
Then, check if this applies to you:
http://askubuntu.com/questions/770054/mongodb-3-2-doesnt-start-on-lubuntu-16-04lts-as-service

@gertmenke thanks so much is working now :D

i used this link and is working now

https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-14-04

but why is not working here
https://rocket.chat/docs/installation/manual-installation/ubuntu/

Probably some confusion caused by Ubuntu's switch from upstart to systemd.
Glad you got it working.

thanks so much

In Mac Docker, arising same exception.
rocketchat_1 | rocketchat_1 | /app/bundle/programs/server/node_modules/fibers/future.js:313 rocketchat_1 | throw(ex); rocketchat_1 | ^ rocketchat_1 | MongoError: failed to connect to server [db.27017:27017] on first connect rocketchat_1 | at Object.Future.wait (/app/bundle/programs/server/node_modules/fibers/future.js:449:15) rocketchat_1 | at new MongoConnection (packages/mongo/mongo_driver.js:211:27)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Buzzele picture Buzzele  路  3Comments

mddvul22 picture mddvul22  路  3Comments

Kiran-Rao picture Kiran-Rao  路  3Comments

karlprieb picture karlprieb  路  3Comments

antn89 picture antn89  路  3Comments