5

I have some issues with MongoDB (or Linux security, perhaps):

1 I am runing MongoDB 3.0 in an OpenSuSE 13.1 machine (which acts as the data server). I have a local network of 4 computers with different OSs.

2 I can connect from a Windows 8.1 Laptop using the mongo command, using the pymongo Python library, or Robomongo. Everything works just fine: I can query the server and insert things.

3 However, when I try to access port 27017 to see the "It looks like you're accessing..." message, the browser says "The connection was reset".

4 SuSe's Firewall and AppArmor are disabled.

QUESTION: There is one computer that can't access the address of the local server. Said computer is in the same local network and is running Windows 8.1. I tried with many other devices and OSs (see miniupdate in comments) and they all managed to access the 27017 port on the server. Of course, the server simply displayed the message "It looks like you are trying to access MongoDB over HTTP on the native driver port.". Do you have any ideas as to why the browser in the problematic computer keeps saying "Connection was reset" instead of showing the message mentioned above? Please note that this computer can do everything I mentioned in point 2. It's the browser thing that is puzzling me.

A R
  • 500
  • 2
  • 7
  • 20
  • Miniupdate: I tried a cellphoine with android, another machine with Windows 7, THE SAME COMPUTER BUT WITH FEDORA 21 (It's dual boot) and THEY ALL can access the local IP (192.168.etc.) and the suual message is displayed. I don't know why that one Windows 8 can't access the server... – A R Apr 02 '15 at 04:22
  • "Any ideas?" is not a good question. Most people have some (and I would not want to hear about them). Always be specific so we don't have to guess (or reread the title/question to see what you really want). You seem to expect that the protocol for accessing mongo's default port 27017 is the HTTP protocol. It is not, try using 28017 as the complete message says you should while trying to access 27017. – Anthon Apr 02 '15 at 05:29
  • Well, I say "any ideas?" Because I am completely lost. I want to know why this computer is the only one that can't display the "It looks like you are trying to access MongoDB over HTTP on the native driver port." message and why is the "connection was reset" message appearing instead? Like I said, other machines can access the port via http, but this one can't. Why would that be? I don0t really have any idea. – A R Apr 02 '15 at 05:55
  • pymongo didn't use HTTP the last time I looked at it – Anthon Apr 02 '15 at 06:02
  • I modified the original post to make it clearer. Hope this helps. – A R Apr 02 '15 at 06:12
  • What is the browser you are using when this doesn't work as expected? Chrome, Firefox, Opera? Does the same version work from a different system? Your question could probably be shortened to: *I have a working MongoDB on system X. When I access it from Y1 with browser Z1 I get a reset connection adn when I do so with from Y2 with browser Z2 I get the message `It looks ....`. What causes the difference?* to improve it. – Anthon Apr 02 '15 at 06:25
  • I'm using firefox, explorer and chrome from the problematic computer. They all display the same sort of problem. That computer also has Fedora 21 installed witht he exactly the same browsers (except explorer). They work from Fedora, but not from Windows (strange). – A R Apr 02 '15 at 07:01
  • FWIW, I can access my Linux MInt hosted mongodb on port 27017 with both IE and Firefox from both Windows XP and Windows 7 without getting a connection reset. – Anthon Apr 02 '15 at 07:22

2 Answers2

3

MongoDB's default port doesn't speak the http protocol. Which is what a browser can speak (among a few others). If you're looking for the web based status page, then that should be on port 28017 (27017 + 1000).

See http://docs.mongodb.org/manual/reference/default-mongodb-port/ for more details.

kashyap
  • 5,258
  • 3
  • 16
  • 11
  • Oh I know that, it's just that for some reason only that computer with that OS can't access the HTTP page (which simply tells me that it looks like I'm trying to access the Mongo port via HTTP). Also, in port 28017, it asks me for username and password, even though I haven't set any. – A R Apr 02 '15 at 04:20
3

Found the solution on my own: disable the "Web shield" of Avast Antivirus. It somehow resets the browser's connection to Mongo.

Again, I realize that Mongo doesn't talk HTTP on that port, but still the fact that all other devices but this one were able to connect (to simply get a message) was bugging me.

A R
  • 500
  • 2
  • 7
  • 20
  • I had the same issue with mongoDB running locally in Docker container, but in my case I was able sometimes to connect and see "It looks like you are trying to access MongoDB over HTTP on the native driver port.". Avast was blocking the connection. – Marian Gibala Mar 23 '16 at 14:05