MongoDB 5.0 Fails to run in Mac OS with Homebrew Error 25600 (Asio Socket failing)

Hi! I am trying to install Mongodb Community 5.0 in an Intel Mac through homebrew.

I am encountirng an error, 25600.

/ brew services start mongodb-community
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)
➜  / brew services list
Name              Status       User File
arangodb          started      laly ~/Library/LaunchAgents/homebrew.mxcl.arangodb.plist
cassandra         none
emacs             none
hbase             none
mongodb-community error  25600 root ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
nginx             none
redis             started      laly ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
unbound           none

Looking through the logs, It appears that something related to Asio socket is failing:

{"t":{"$date":"2022-05-19T13:22:55.125+03:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Mac OS X","version":"19.6.0"}}}
{"t":{"$date":"2022-05-19T13:22:55.126+03:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"config":"/usr/local/etc/mongod.conf","net":{"bindIp":"127.0.0.1"},"storage":{"dbPath":"/tmp/mongodb"},"systemLog":{"destination":"file","logAppend":true,"path":"/usr/local/var/log/mongodb/mongo.log"}}}}
{"t":{"$date":"2022-05-19T13:22:55.129+03:00"},"s":"I",  "c":"NETWORK",  "id":5693100, "ctx":"initandlisten","msg":"Asio socket.set_option failed with std::system_error","attr":{"note":"acceptor TCP fast open","option":{"level":6,"name":261,"data":"00 04 00 00"},"error":{"what":"set_option: Invalid argument","message":"Invalid argument","category":"asio.system","value":22}}}
{"t":{"$date":"2022-05-19T13:22:55.130+03:00"},"s":"E",  "c":"CONTROL",  "id":20557,   "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"IllegalOperation: Attempted to create a lock file on a read-only directory: /tmp/mongodb"}}
{"t":{"$date":"2022-05-19T13:22:55.130+03:00"},"s":"I",  "c":"REPL",     "id":4784900, "ctx":"initandlisten","msg":"Stepping down the ReplicationCoordinator for shutdown","attr":{"waitTimeMillis":15000}}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"COMMAND",  "id":4784901, "ctx":"initandlisten","msg":"Shutting down the MirrorMaestro"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"SHARDING", "id":4784902, "ctx":"initandlisten","msg":"Shutting down the WaitForMajorityService"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"NETWORK",  "id":20562,   "ctx":"initandlisten","msg":"Shutdown: going to close listening sockets"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"NETWORK",  "id":4784905, "ctx":"initandlisten","msg":"Shutting down the global connection pool"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"CONTROL",  "id":4784906, "ctx":"initandlisten","msg":"Shutting down the FlowControlTicketholder"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"-",        "id":20520,   "ctx":"initandlisten","msg":"Stopping further Flow Control ticket acquisitions."}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"NETWORK",  "id":4784918, "ctx":"initandlisten","msg":"Shutting down the ReplicaSetMonitor"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"SHARDING", "id":4784921, "ctx":"initandlisten","msg":"Shutting down the MigrationUtilExecutor"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"ASIO",     "id":22582,   "ctx":"MigrationUtil-TaskExecutor","msg":"Killing all outstanding egress activity."}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"COMMAND",  "id":4784923, "ctx":"initandlisten","msg":"Shutting down the ServiceEntryPoint"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"CONTROL",  "id":4784925, "ctx":"initandlisten","msg":"Shutting down free monitoring"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"CONTROL",  "id":4784927, "ctx":"initandlisten","msg":"Shutting down the HealthLog"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"CONTROL",  "id":4784928, "ctx":"initandlisten","msg":"Shutting down the TTL monitor"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"CONTROL",  "id":4784929, "ctx":"initandlisten","msg":"Acquiring the global lock for shutdown"}
{"t":{"$date":"2022-05-19T13:22:55.132+03:00"},"s":"I",  "c":"-",        "id":4784931, "ctx":"initandlisten","msg":"Dropping the scope cache for shutdown"}
{"t":{"$date":"2022-05-19T13:22:55.133+03:00"},"s":"I",  "c":"FTDC",     "id":4784926, "ctx":"initandlisten","msg":"Shutting down full-time data capture"}
{"t":{"$date":"2022-05-19T13:22:55.133+03:00"},"s":"I",  "c":"CONTROL",  "id":20565,   "ctx":"initandlisten","msg":"Now exiting"}
{"t":{"$date":"2022-05-19T13:22:55.133+03:00"},"s":"I",  "c":"CONTROL",  "id":23138,   "ctx":"initandlisten","msg":"Shutting down","attr":{"exitCode":100}}

Any idea how to fix it?

Thanks.

Your dbpath is /tmp/mongodb
Can mongod write to this?
Does it have permissions
Try to use another dirpath /tmp is not recommended

4 Likes

Thank you very much! I was so focused on the first error that didn’t see that the /tmp/mongodb was read only.

Changed to another path (where writing is allowed) and got fixed.

For anyone encountering this problem:

brew services stop mongodb-community
cd ~
cd Desktop
mkdir mongodb

in /usr/local/etc/mongod.conf change the dbpath to (where laly = my user):

/Users/laly/Desktop/mongodb

Run again:

brew services start mongodb-community
3 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.