I’m receiving error connect ECONNREFUSED 127.0.0.1:27017 randomly today after my DB connection worked for over two years.
I updated brew and ran brew install mongodb-community@6.0, which worked. However, brew services start mongodb-community@6.0 gives me the below error:
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501
/Users/chaseschlachter/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist` exited with 5.
brew services restart mongodb-community@6.0 appears to work but when I run brew services list I see below:
Name Status User File
mongodb-community error 15872 chaseschlachter ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
Hi @Chase_Schlachter, can you post the MongoDB log entries from the most recent time you tried to start the MongoDB sevice? Seeing this will help determine what is going on.
What version of MongoDB were you running prior to the upgrade? In-place upgrades are only supported for adjacent major release series, so if you were not running MongoDB 5.0 prior to installing 6.0 I would expect find an error message like:
Failed to start up WiredTiger under any compatibility version. This may be due to an unsupported upgrade or downgrade.
You could look for the last instance of this specific message with:
grep “Failed to start” $(brew --prefix)/var/log/mongodb/mongo.log | tail -n1
Hi @Stennie_X - thanks for the help with the logs. I installed the new Mac software update and now mongo shows as started when I run brew services list.
Name Status User File
mongodb-community started chaseschlachter ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
I still can’t get the mongo command to work, though. I get the below error:
zsh: command not found: mongo
Here are the 20 rows of error logs from trying to run mongo:
Hi @Chase_Schlachter, starting with MongoDB 6.0 the mongo command is no longer installed (it was deprecated a couple versions back). You will want to use the new mongosh command line. This tool has most of the same functionality (most people won’t notice any difference).
I lost the data in my database but since it was test data I don’t have any problem repopulating. I’m not totally sure what prompted this connection interruption but my concern would be more around this happening in my production environment with customer data but it looks like I can manage with frequent db backups. Thank you!
It’s interesting that you lost data. Whenever I’ve used brew to update my version of MongoDB it’s never touched the data directory and the new version comes up just find pointed at the old data storage.
I even just now ran a brew uninstall mongodb-community and my data folder was not deleted. Once I ran brew install mongodb-community and connected via mongosh I was able to see the data.
Upgrade/downgrade should not remove any existing data files.
I suspect you may have had a different dbPath for your previous installation. Try using Spotlight search to look for WiredTiger.wt which should be present in a MongoDB dbPath or use the command line equivalent: mdfind -name WiredTiger.wt.
Regards,
Stennie
New & Unread Topics
Topic list, column headers with buttons are sortable.