connection refused Laravel 5 with mongoDB - mongodb

I am using laravel and I have a VM homestead set up in Vagrant. I have been having trouble connecting to my mongoDB database. I have so far added this extension to my laravel project with composer and followed its installation instructions. I have also also installed mongodb on homestead and it is reporting to be working. Now as I try to query something from my mongoDB I get the error:
MongoConnectionException in /home/vagrant/Code/flowtime/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Connection.php line 152:
Failed to connect to: localhost:29911: Connection refused
I have checked the connection info several times and it is correct. So could someone tell me if it is related to my VM setup or something else?

Related

Mongo Shell/Compass won't connect to mongodb container

I'm using Docker (running on WSL) and I have a MongoDB container running. Using mongo shell on my host I can connect to the instance, but I can't authenticate. I also get an authentication error when I try to go through MongoDB Compass, below is the error I keep getting. I've installed saslprep globally via npm on my host machine, but that didn't fix the problem either. Any help would be greatly appreciated!
> db.auth('admin-root', 'test')
Warning: no saslprep library specified. Passwords will not be sanitized
MongoError: Authentication failed.

MongoDB not getting connected to EC2 server

mongo mongodb+srv://root:<password>#cluster0-5etkj.mongodb.net:27017/cretanium?retryWrites=true
MongoDB shell version: 2.6.10
connecting to: mongodb+srv://root:<password>#cluster0-5etkj.mongodb.net:27017/cretanium?retryWrites=true
2020-01-08T12:14:51.648+0000 Assertion failure _setName.size() src/mongo/client/dbclientinterface.h 231
2020-01-08T12:14:51.649+0000 0x6b75c9 0x659e9f 0x636a32 0x5013b8 0x4fa7f1 0x6006fd 0x5eb869 0x7f8128226d76 0x3340f1406362
mongo(_ZN5mongo15printStackTraceERSo+0x39) [0x6b75c9]
mongo(_ZN5mongo10logContextEPKc+0x21f) [0x659e9f]
mongo(_ZN5mongo12verifyFailedEPKcS1_j+0x142) [0x636a32]
mongo(_ZN5mongo16ConnectionStringC1ENS0_14ConnectionTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_+0x208) [0x5013b8]
mongo(_ZN5mongo16ConnectionString5parseERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERS6_+0x201) [0x4fa7f1]
mongo(_ZN5mongo17mongoConsExternalEPNS_7V8ScopeERKN2v89ArgumentsE+0x11d) [0x6006fd]
mongo(_ZN5mongo7V8Scope10v8CallbackERKN2v89ArgumentsE+0xa9) [0x5eb869]
/usr/lib/libv8.so.3.14.5(+0x99d76) [0x7f8128226d76]
[0x3340f1406362]
2020-01-08T12:14:51.650+0000 Error: assertion src/mongo/client/dbclientinterface.h:231 at src/mongo/shell/mongo.js:148
exception: connect failed
I am trying to connect to mongo atlas using command line on EC2 Server and it is getting connected on my local machine but I cannot connect it on EC2 Server. I'm able to ping to google.com, so external connectivity is not an issue but I'm unable to connect to mongodb from ec2 command line as well.
You're using mongo shell version 2.6.10. This version is not supported anymore.
This is an expected error when you're trying to connect to a newer server version (Atlas is currently using either 3.6, 4.0, or 4.2 as of this moment) using an old shell version (see SERVER-16610).
Please upgrade your local MongoDB installation to a newer one. See Install MongoDB for an instruction for your specific OS.

MongoDB won't connect on Ubuntu 14.04

I am trying to install MongoDB on Ubuntu 14.04 LTS. I am following the article at the link below:
https://docs.mongodb.com/v3.0/tutorial/install-mongodb-on-ubuntu/
Everything is fine, and my log file shows the following line:
2016-12-18T20:47:19.476+0000 I NETWORK [thread1] waiting for connections on port 27017
I also get the following status when i run the following command:
bitnami#ip-172-31-58-13:service mongod status
bitnami#ip-172-31-58-13:mongod start/running, process 15587
however, as soon as i try to connect to mongo, I run into an error, which I simply cannot seem to resolve.
Command:
bitnami#ip-172-31-58-13:/var/log/mongodb$ mongo
Output:
MongoDB shell version: 3.0.7
connecting to: /opt/bitnami/mongodb/tmp/mongodb-27017.sock:27017/test
2016-12-19T00:08:48.809+0000 W NETWORK Failed to connect to /opt/bitnami/mongodb/tmp/mongodb-27017.sock:0, reason: errno:2 No such file or directory
2016-12-19T00:08:48.810+0000 E QUERY Error: couldn't connect to server /opt/bitnami/mongodb/tmp/mongodb-27017.sock:27017 (/opt/bitnami/mongodb/tmp/mongodb-27017.sock), connection attempt failed
at connect (src/mongo/shell/mongo.js:181:14)
at (connect):1:6 at src/mongo/shell/mongo.js:181
exception: connect failed
bitnami#ip-172-31-58-13:/var/log/mongodb$
I have tried everything on the internet (gone through about 50+ articles) but nothing seems to work - changing the .lock file, updating the permissions, even uninstalled and re-installed mongodb 2 times and so on.
I noticed that the mongodb-27017.sock is placed under /tmp rather than /opt/bitnami/mongodb/tmp/ but I am not sure if that is a problem?
Please help me in resolving this issue.
Thank you

CKAN: Error 500

Trying to install CKAN on Ubuntu 14.04 and decided to follow this method: http://docs.ckan.org/en/latest/maintaining/installing/install-from-package.html. Everything has installed correctly, except I get a 500 Error on the CKAN page when I open up my http://localhost.
I'm pretty sure it's related to the command:
sudo ckan db init
When I do that command, it says [Errno 111] Connection refused... Problems were found while connecting to the SOLR server.
Additionally, if I take a look at my ckan_default.error.log file, this is what I get:
What could I possibly be doing wrong? What file do I need to edit to fix this connection to the SOLR server?
It looks like you can't connect to the Solr server. I'd double check all steps in this section:
http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html#setup-solr
Specially restarting Jetty once finished:
sudo service jetty restart

Cannot Connect MongoDB from Meteor

I need to connect MongoDB from Meteor. I have installed MongoDB using the command prompt. After that, I have tried to connect to the MongoDB. This time I got an error.I didn't have any idea about this. Does anybody have suggestions as to what to do?
Error :
E:***\MongoDB\bin>mongo.exe
MongoDB shell version: 2.4.9
connecting to: test
Mon Jan 20 12:56:37.648 Error: couldn't connect to server *.*.*.*:27017 at src
/mongo/shell/mongo.js:145
exception: connect failed
There are different ways depending on how whether or not you've deployed it or not.
If you've run meteor deploy some.url.com, you can access your site from a new terminal window by inputting meteor mongo some.url.com.
If you're simply run meteor to get your app running (not deployed), open a new terminal, cd to the directory of your project, and enter meteor mongo.