[SERVER-221] Can connect to localhost, but not 127.0.0.1 Created: 10/Aug/09  Updated: 10/Sep/09  Resolved: 10/Aug/09

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: sandstrom Assignee: Eliot Horowitz (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux k226741 2.6.18-028stab053.17 #1 SMP Mon Jun 9 20:42:43 MSD 2008 x86_64 GNU/Linux (Ubuntu 8.04.2)


Participants:

 Description   

Can connect to localhost, but not 127.0.0.1.
Let me know if you need more system info.

// work

alexander@k226741:~$ mongo localhost:127017
MongoDB shell version: 0.9.7
url: localhost:127017
connecting to: localhost:127017
type "help" for help
> exit
bye

// don't work

alexander@k226741:~$ mongo 127.0.0.1:127017
terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
what(): boost::filesystem::path: invalid name "127.0.0.1:127017" in path: "127.0.0.1:127017"
Mon Aug 10 14:04:30 mongo got signal 6 (Aborted), stack trace:
Mon Aug 10 14:04:30 0x411912 0x2aaaab6b3100 0x2aaaab6b3095 0x2aaaab6b4af0 0x2aaaaafac0e4 0x2aaaaafaa076 0x2aaaaafaa0a3 0x2aaaaafaa18a 0x470083 0x470911 0x412b0a 0x2aaaab69f1c4 0x411359
mongo(_Z12quitAbruptlyi+0x3c2) [0x411912]
/lib/libc.so.6 [0x2aaaab6b3100]
/lib/libc.so.6(gsignal+0x35) [0x2aaaab6b3095]
/lib/libc.so.6(abort+0x110) [0x2aaaab6b4af0]
/usr/lib/libstdc++.so.6(ZN9gnu_cxx27_verbose_terminate_handlerEv+0x114) [0x2aaaaafac0e4]
/usr/lib/libstdc++.so.6 [0x2aaaaafaa076]
/usr/lib/libstdc++.so.6 [0x2aaaaafaa0a3]
/usr/lib/libstdc++.so.6 [0x2aaaaafaa18a]
mongo [0x470083]
mongo [0x470911]
mongo [0x412b0a]
/lib/libc.so.6(__libc_start_main+0xf4) [0x2aaaab69f1c4]
mongo(__gxx_personality_v0+0x239) [0x411359]



 Comments   
Comment by Eliot Horowitz (Inactive) [ 10/Sep/09 ]

closed b/c resolved more than 2 week ago

Comment by sandstrom [ 10/Aug/09 ]

Thanks! My bad

Comment by Eliot Horowitz (Inactive) [ 10/Aug/09 ]

You're not quite using the shell params correctly.

in "mongo <x>"
x is a db url
a db url is a datbase name, with an option host prefix

so:
mongo foo - connects to foo database
mongo localhost:27017 - connects to the localhost:27017 database
mongo localhost:27017/foo connects to the foo db on localhost

or you can use
mongo --host localhost
mongo --port 1111

etc...

Comment by sandstrom [ 10/Aug/09 ]

sorry, wrong port. this is the correct one:

root@k226741:/home/alexander# mongo localhost:27017
MongoDB shell version: 0.9.7
url: localhost:27017
connecting to: localhost:27017
type "help" for help
> exit
bye
root@k226741:/home/alexander# mongo 127.0.0.1:27017
terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
what(): boost::filesystem::path: invalid name "127.0.0.1:27017" in path: "127.0.0.1:27017"
Mon Aug 10 14:12:35 mongo got signal 6 (Aborted), stack trace:
Mon Aug 10 14:12:35 0x411912 0x2aaaab6b3100 0x2aaaab6b3095 0x2aaaab6b4af0 0x2aaaaafac0e4 0x2aaaaafaa076 0x2aaaaafaa0a3 0x2aaaaafaa18a 0x470083 0x470911 0x412b0a 0x2aaaab69f1c4 0x411359
mongo(_Z12quitAbruptlyi+0x3c2) [0x411912]
/lib/libc.so.6 [0x2aaaab6b3100]
/lib/libc.so.6(gsignal+0x35) [0x2aaaab6b3095]
/lib/libc.so.6(abort+0x110) [0x2aaaab6b4af0]
/usr/lib/libstdc++.so.6(ZN9gnu_cxx27_verbose_terminate_handlerEv+0x114) [0x2aaaaafac0e4]
/usr/lib/libstdc++.so.6 [0x2aaaaafaa076]
/usr/lib/libstdc++.so.6 [0x2aaaaafaa0a3]
/usr/lib/libstdc++.so.6 [0x2aaaaafaa18a]
mongo [0x470083]
mongo [0x470911]
mongo [0x412b0a]
/lib/libc.so.6(__libc_start_main+0xf4) [0x2aaaab69f1c4]
mongo(__gxx_personality_v0+0x239) [0x411359]
root@k226741:/home/alexander#

Generated at Thu Feb 08 02:53:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.