MEAN One click installation problem with Mongodb

June 10, 2017 2.9k views
MEAN MongoDB Ubuntu 16.04

I have just deployed my first droplet using MEAN one click installation. Droplet started off fine and connected with SSH. Now when I try to start the example app as given in the tutorial, it fails to start because it is unable to connect to mongodb.
Here is the error log:

+ Important warning: config.domain is empty. It should be set to the fully qualified domain of the app.
Could not connect to MongoDB!
{ MongoError: failed to connect to server [localhost:27017] on first connect
    at Pool.<anonymous> (/opt/mean/node_modules/mongoose/node_modules/mongodb-core/lib/topologies/server.js:313:35)
    at emitOne (events.js:96:13)
    at Pool.emit (events.js:188:7)
    at Connection.<anonymous> (/opt/mean/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:271:12)
    at Connection.g (events.js:291:16)
    at emitTwo (events.js:106:13)
    at Connection.emit (events.js:191:7)
    at Socket.<anonymous> (/opt/mean/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:165:49)
    at Socket.g (events.js:291:16)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1278:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  name: 'MongoError',
  message: 'failed to connect to server [localhost:27017] on first connect' }
/usr/bin/nodejs[3525]: ../src/ node::debugger::Agent::Stop(): Assertion `(err) == (0)' failed.
 1: node::Abort() [node]
 2: node::Assert(char const* const (*) [4]) [node]
 3: 0x10c1bc2 [node]
 4: node::debugger::Agent::~Agent() [node]
 5: node::Start(int, char**) [node]
 6: __libc_start_main [/lib/x86_64-linux-gnu/]
 7: _start [node]
Aborted (core dumped)
[16:12:37] [nodemon] app crashed - waiting for file changes before starting…code

Isn’t MongoDB supposed to be installed out of the box? What am I missing here?

1 comment
  • I used the apt list --installed command and didn’t find MongoDB installed. I am installing it now but I believe it should be installed out of the box.

    Also did a sudo apt-get update and got the following report:

    Ign:1 xenial/mongodb-org/3.4 InRelease
    Hit:2 xenial/mongodb-org/3.4 Release
    Hit:3 xenial InRelease
    Hit:4 xenial-security InRelease
    Hit:5 main InRelease
    Get:6 xenial/mongodb-org/3.4 Release.gpg [801 B]
    Ign:6 xenial/mongodb-org/3.4 Release.gpg
    Hit:7 xenial InRelease
    Hit:8 xenial-updates InRelease
    Hit:9 xenial-backports InRelease
    Fetched 801 B in 2s (353 B/s)
    Reading package lists… Done
    W: GPG error: xenial/mongodb-org/3.4 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BC711F9BA15703C6
    W: The repository ' xenial/mongodb-org/3.4 Release' is not signed.
    N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
2 Answers

Hi @KodeBlox

I just tried spinning up a MEAN 16.04 droplet and I’m getting the same error. Actually it seems like MongoDB is not installed, which means the initialization script also fails (/var/lib/cloud/scripts/per-once/002-mongodb)

Can you create a ticket under Support in the control panel? You can link to this thread.

Have another answer? Share your knowledge.