Skip to content

Instantly share code, notes, and snippets.

@reggi
Created October 19, 2012 20:17
Show Gist options
  • Save reggi/3920451 to your computer and use it in GitHub Desktop.
Save reggi/3920451 to your computer and use it in GitHub Desktop.
Mongo output while trying to connect to server from local computer.
thomas@workstation:~$ mongo mongodb://username:password@domiain.com:27017/database
MongoDB shell version: 2.0.6
connecting to: mongodb://username:password@domiain.com:27017/database
Fri Oct 19 16:16:28 Assertion failure _setName.size() client/../db/../client/dbclient.h 156
0x100079aa3 0x10007b29c 0x1000b91c2 0x1000f90c7 0x10015d512 0x10015e115 0x100150883 0x10015cda9 0x10011279b 0x100107fc2 0x10001fef7 0x1000e912f 0x100008458 0x10000aaca 0x100001454
0 mongo 0x0000000100079aa3 _ZN5mongo12sayDbContextEPKc + 195
1 mongo 0x000000010007b29c _ZN5mongo8assertedEPKcS1_j + 300
2 mongo 0x00000001000b91c2 _ZN5mongo16ConnectionString5parseERKSsRSs + 2130
3 mongo 0x00000001000f90c7 _ZN5mongo26mongo_external_constructorEP9JSContextP8JSObjectjPlS4_ + 263
4 mongo 0x000000010015d512 js_Invoke + 1218
5 mongo 0x000000010015e115 js_InvokeConstructor + 261
6 mongo 0x0000000100150883 js_Interpret + 14899
7 mongo 0x000000010015cda9 js_Execute + 409
8 mongo 0x000000010011279b JS_EvaluateScript + 219
9 mongo 0x0000000100107fc2 _ZN5mongo7SMScope4execERKNS_10StringDataERKSsbbbi + 482
10 mongo 0x000000010001fef7 _ZN5mongo10shellUtils9initScopeERNS_5ScopeE + 279
11 mongo 0x00000001000e912f _ZN5mongo12ScriptEngine8newScopeEv + 47
12 mongo 0x0000000100008458 _Z5_mainiPPc + 4472
13 mongo 0x000000010000aaca main + 42
14 mongo 0x0000000100001454 start + 52
exception: assertion client/../db/../client/dbclient.h:156
thomas@workstation:~$ mongo -u username -p password domain.com:27017/database
MongoDB shell version: 2.0.6
connecting to: domain.com:27017/database
Fri Oct 19 16:24:16 Error: couldn't connect to server domain.com:27017 shell/mongo.js:86
exception: connect failed
thomas@workstation:~$
@reggi
Copy link
Author

reggi commented Oct 19, 2012

My mongodb rundown


Installed - Server (aka "vannevar")

thomas@vannevar:~$ mongo -version
MongoDB shell version: 2.2.0

Installed - Local Computer (aka "workstation")

thomas@workstation:~$ mongo --version
MongoDB shell version: 2.0.6

Process Stared

thomas@vannevar:~$ sudo service mongodb start
mongodb start/running, process 1783

Ports Listening

thomas@vannevar:~$ sudo lsof -iTCP -sTCP:LISTEN | grep mongo
mongod    1810   mongodb    7u  IPv4 4750868      0t0  TCP *:27017 (LISTEN)
mongod    1810   mongodb    8u  IPv4 4751408      0t0  TCP *:28017 (LISTEN)

Firewall - Ports Open

thomas@vannevar:~$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
3306                       ALLOW       Anywhere
27017                      ALLOW       Anywhere
28017                      ALLOW       Anywhere
3306                       ALLOW       Anywhere (v6)
27017                      ALLOW       Anywhere (v6)
28017                      ALLOW       Anywhere (v6)

Auth

Inside /etc/mongodb.conf I set auth to true.

auth = true

Process running

thomas@vannevar:~$ ps aux | grep mongodb
mongodb   1810  0.7  7.9 141516 40556 ?        Ssl  17:15   0:00 /usr/bin/mongod --config /etc/mongodb.conf
thomas    1830  0.0  0.1   4388   816 pts/2    S+   17:16   0:00 grep mongodb

Connecting Locally

I can connect locally just fine.

thomas@vannevar:~$ mongo
MongoDB shell version: 2.2.0
connecting to: test
> 

Connecting from another computer

thomas@workstation:~$ mongo ██████████.com/██████████ -u ██████████ -p ██████████ --verbose
MongoDB shell version: 2.0.6
Fri Oct 19 17:21:54 versionCmpTest passed
Fri Oct 19 17:21:54 versionArrayTest passed
connecting to: ██████████.com/██████████
Fri Oct 19 17:21:54 creating new connection to:██████████.com
Fri Oct 19 17:21:54 BackgroundJob starting: ConnectBG
Fri Oct 19 17:21:54 Error: couldn't connect to server ██████████.com shell/mongo.js:86
Fri Oct 19 17:21:54 User Assertion: 12513:connect failed
exception: connect failed
thomas@workstation:~$ 

@michaeldefoinplatel
Copy link

Hi Reggi,
did you managed to fix this issue with mongo ? I am actually runing into the very same situation now and I don't know where to look at....

Any idea ?

Best,
Michael

@pcg92
Copy link

pcg92 commented May 19, 2017

+1 Im getting the same error

@nikhil1983
Copy link

Have anyone solved the above issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment