After updating my mongo client to 2.0.2 the error has changed significantly.
New issue opened here: MongoDB connect error
when I try to connect to my mongo server, running on a Vagrant VM, CentOS 6, i get this magical error shown here: http://pastium.org/view/7efba4e90f0ba228ccad377204bb9f17.
Vagrant forwards the standard mongo part to 37017.
MongoDB's standard port is 27017.
Turns out this was an issue with IP Tables so the forwarded port was getting blocked.
Related
I have tried to connect to my mongodb on a server i own via an ssh tunnel via the following apps but nothing will connect:
compass
robomongo
nosqlbooster4mongo
phpstorm inbuilt mongodb java connector
Server and mongo:
Server: ubuntu 18lts
Mongo: latest community version
The Connection URL in all instances is the same (also tried removing the query params) and this url works on the node app:
mongodb://localhost:27017/data-aggregator?retryWrites=true&w=majority
nosqlbooster4mongo's error message is:
But the connection url is 27017 and gets changed to 37903 for some reason
PHPStorm's error message is:
DBMS: Mongo DB Case sensitivity: plain=mixed, delimited=mixed Driver:
MongoDB JDBC Driver (ver. 1.13, JDBC4.2) Effective version: UNKNOWN
(ver. 0.0) Ping: 10 sec, 289 ms (keep-alive query results in error)
Timed out after 10000 ms while waiting to connect. Client view of
cluster state is {type=UNKNOWN, servers=[{address=localhost:42865,
type=UNKNOWN, state=CONNECTING,
exception={com.mongodb.MongoSocketReadException: Exception receiving
message}, caused by {java.net.SocketException: Connection reset}}].
Nothing works but i cannot understand why.
The SSH connection is working as confirmed by nosqlbooster4mongo and phpstorm
But as soon as it then tries to connect to the local mongodb instance it fails. I don't know if this is an issue with the SSH tunnel or the mongo setup. Via a terminal i can connect to mongo no issue, also the node app there can too.
The tunnels are using the same key as i use to connect to the server via terminal without issue which leads me to believe it is mongo but i don't know where to look :/
As the tunnel is established, then this says the server firewalls are not an issue.
I don't know what it is, is there an additional query param for ssh tunnel access?
Solved by #Jack_Woehr on: https://www.mongodb.com/community/forums/t/mongo-5-community-edition-cannot-connect-via-tunnel/151526
The trick was to not use the ssh tunnel from any of the tools listed and just create a the tunnel on the OS.
i think this question been asked many times, but i've had this issue also last year and another last year, i resolved it to use VPN provider like nordvpn and tunnelBear. my issue here my company has own VPN which to connect to some internal apps, but i cant connect with multi VPN, my company VPN not resolved the issue to connect Mongo Atlas into Compass, after i install NordVPN in my Linux Fedora, it was solve, but i can't open another internal app if i dont connect with my company VPN. so i tried connect my company VPN while my NordVPN connected as well, but it doesnt work. i need to turn off my private VPN to connect my company VPN. this is really confusing for me if keep to turn off and on my private VPN and Company VPN for my work.
wha i have tried to fix this issues but always failed
change DNS on my fedora /etc/resolv.conf into nameserver 0.0.0.0 or nameserver 8.8.8.8;
change net.bindIp on /etc/mongod.conf into 0.0.0.0 and my ip;
listed ip public in Mongo Atlas 0.0.0.0;
error on mongo compass after paste the URI:
querySrv ENODATA _mongodb._tcp.companyNameHere.ycex0.mongodb.net
error in mongo shell
MongoDB shell version v4.4.3
exception: Failed to look up service "_mongodb._tcp.companyNameHere.ycex0.mongodb.net": Success
exiting with code 1
error in Go app:
panic: error parsing uri: lookup _mongodb._tcp.companyNameHere.ycex0.mongodb.net on XXX.XXX.1.1:53: no such host
those ways not work in my Fedora, i cant connect Mongo Atlas URI in Compass, Go App and Shell as well,
is that any another way ?
my os is: Fedora 33
Try using the standard connection string , as SRV strings sometimes not resolvable by some of the images.
The standard connection string can be obtained in the Atlas UI for the version 3.4 earlier
I'm trying to follow this tutorial [1], but MongoDB is refusing connections, as error messages says:
"MongoError: failed to connect to server [127.0.0.1:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]"
Node-RED is running from a docker container, and MongoDB is on the host machine
MongoDB service is running properly, and when I type on browser "localhost:27017", appears "It looks like you are trying to access MongoDB over HTTP on the native driver port" message.
How to make, so, MongoDB accepts connections from NodeRED?
[1] https://www.youtube.com/watch?v=f5o4tIz2Zzc
I'm running Ubuntu 14.04 on an AWS EC2 instance with Apache2. This morning I upgraded my Apache2 settings to allow multiple virtual servers following these instructions: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
Just now I tried to access my MongoDB instance, but I cannot do it either through the PHP MongoDB driver or through the shell. I get this error when attempting to connect with a PHP MongoClient():
Failed to connect to: localhost:27017: Connection refused'
and I get this error when trying to run the mongo shell:
2015-06-03T19:23:57.307+0000 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-06-03T19:23:57.308+0000 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed
Everything was running fine just last night, and I haven't directly modified MongoDB settings. What can I do to fix this? How do Apache2 settings relate to MongoDB? I've been trying to look through the MongoDB docs, but I don't see anything that looks relevant.
You need to setup Security Group for your EC2 instance. And allow Inbound connection for the mongodb port, in your case 27017.
When I went through the logs, I saw a message that there was insufficient room for "journal file." I rebooted my AMI on an EC2 instance with more storage and reinstalled Mongo. That did the trick. I had uploaded a few files to the instance after updating my Apache2 settings, so those few more files must have pushed the instance past what Mongo could tolerate. Too bad the error message wasn't more helpful, but I should have checked the logs sooner. It would also be nice if the logs had a more explicit message.
I'm new to MongoDB. I'm trying to connect to my remote mongo database from my work machine( I tried for both mongohq as well as mongolab). I'm getting the error listed below. When I run the same command from my home machine it runs fine and does connect to remove mongo database. I'm not sure what is messed up on my work machine but I'd like to fix it. Thanks for you help.
MongoDB shell version: 2.4.9
connecting to: linus.mongohq.com:10097/mydb
Thu Jan 16 04:16:02.689 Error: couldn't connect to server linus.mongohq.com:10097
at src/mongo/shell/mongo.js:147
exception: connect failed
As per question comments, your mongo shell client can't connect to the mongo instance. Assuming that your internet connectivity is fine, the most common reason for the failure is that the ports are blocked on your network.
Some ISPs automatically block these ports by default as an additional security protection for users that don't need them open. Contact your ISP or network admin, they should be able to help you out.