MongoDB 6.0.x - No longer runs on macOS Ventura 13.1 or 13.2

911 Views Asked by At

Just upgraded (14.12.2022) to macOS Ventura 13.1 (22C65).

Using Mongo on /usr/local/Cellar/mongodb-community/6.0.1/bin:

brew services restart [email protected]
Stopping `mongodb-community`... (might take a while)
==> Successfully stopped `mongodb-community` (label: homebrew.mxcl.mongodb-community)
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)

Then I run "mongosh":

mongosh

Now gives:

Current Mongosh Log ID: 6399ebcbf7b524ab8380978a
Connecting to:      mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.1
MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017

Also unable to use: MongoDB Compass or Studio 3T.

Was working fine before I upgraded macOS Ventura 13.0.1 -> 13.1. TIA.

/usr/local/var/log/mongodb/mongo.log

{"t":{"$date":"2022-12-14T17:26:52.465+00:00"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"thread1","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true}}}
{"t":{"$date":"2022-12-14T17:26:52.466+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"thread1","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2022-12-14T17:26:52.467+00:00"},"s":"I",  "c":"NETWORK",  "id":4648602, "ctx":"thread1","msg":"Implicit TCP FastOpen in use."}
{"t":{"$date":"2022-12-14T17:26:52.480+00:00"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","namespace":"config.tenantMigrationDonors"}}
{"t":{"$date":"2022-12-14T17:26:52.480+00:00"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","namespace":"config.tenantMigrationRecipients"}}
{"t":{"$date":"2022-12-14T17:26:52.480+00:00"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"ShardSplitDonorService","namespace":"config.tenantSplitDonors"}}
{"t":{"$date":"2022-12-14T17:26:52.480+00:00"},"s":"I",  "c":"CONTROL",  "id":5945603, "ctx":"thread1","msg":"Multi threading initialized"}
{"t":{"$date":"2022-12-14T17:26:52.480+00:00"},"s":"I",  "c":"CONTROL",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":4184,"port":27017,"dbPath":"/usr/local/var/mongodb","architecture":"64-bit","host":"MacBook-Pro-2.local"}}
{"t":{"$date":"2022-12-14T17:26:52.480+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"6.0.1","gitVersion":"32f0f9c88dc44a2c8073a5bd47cf779d4bfdee6b","modules":[],"allocator":"system","environment":{"distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2022-12-14T17:26:52.480+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Mac OS X","version":"22.2.0"}}}
{"t":{"$date":"2022-12-14T17:26:52.480+00: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":"/usr/local/var/mongodb"},"systemLog":{"destination":"file","logAppend":true,"path":"/usr/local/var/log/mongodb/mongo.log"}}}}
{"t":{"$date":"2022-12-14T17:26:52.482+00: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-12-14T17:26:52.502+00:00"},"s":"I",  "c":"STORAGE",  "id":22270,   "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/usr/local/var/mongodb","storageEngine":"wiredTiger"}}
{"t":{"$date":"2022-12-14T17:26:52.502+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=32256M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,remove=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=2000),statistics_log=(wait=0),json_output=(error,message),verbose=[recovery_progress:1,checkpoint_progress:1,compact_progress:1,backup:0,checkpoint:0,compact:0,evict:0,history_store:0,recovery:0,rts:0,salvage:0,tiered:0,timestamp:0,transaction:0,verify:0,log:0],"}}
{"t":{"$date":"2022-12-14T17:26:53.152+00:00"},"s":"E",  "c":"WT",       "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error message","attr":{"error":13,"message":"[1671038813:151111][4184:0x7ff845fae8c0], wiredtiger_open: [WT_VERB_DEFAULT][ERROR]: int __posix_open_file(WT_FILE_SYSTEM *, WT_SESSION *, const char *, WT_FS_OPEN_FILE_TYPE, uint32_t, WT_FILE_HANDLE **), 805: /usr/local/var/mongodb/WiredTiger.turtle: handle-open: open: Permission denied"}}
{"t":{"$date":"2022-12-14T17:26:53.154+00:00"},"s":"E",  "c":"WT",       "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error message","attr":{"error":13,"message":"[1671038813:154273][4184:0x7ff845fae8c0], wiredtiger_open: [WT_VERB_DEFAULT][ERROR]: int __posix_open_file(WT_FILE_SYSTEM *, WT_SESSION *, const char *, WT_FS_OPEN_FILE_TYPE, uint32_t, WT_FILE_HANDLE **), 805: /usr/local/var/mongodb/WiredTiger.turtle: handle-open: open: Permission denied"}}
{"t":{"$date":"2022-12-14T17:26:53.155+00:00"},"s":"E",  "c":"WT",       "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error message","attr":{"error":13,"message":"[1671038813:155027][4184:0x7ff845fae8c0], wiredtiger_open: [WT_VERB_DEFAULT][ERROR]: int __posix_open_file(WT_FILE_SYSTEM *, WT_SESSION *, const char *, WT_FS_OPEN_FILE_TYPE, uint32_t, WT_FILE_HANDLE **), 805: /usr/local/var/mongodb/WiredTiger.turtle: handle-open: open: Permission denied"}}
{"t":{"$date":"2022-12-14T17:26:53.155+00:00"},"s":"W",  "c":"STORAGE",  "id":22347,   "ctx":"initandlisten","msg":"Failed to start up WiredTiger under any compatibility version. This may be due to an unsupported upgrade or downgrade."}
{"t":{"$date":"2022-12-14T17:26:53.155+00:00"},"s":"F",  "c":"STORAGE",  "id":28595,   "ctx":"initandlisten","msg":"Terminating.","attr":{"reason":"13: Permission denied"}}
{"t":{"$date":"2022-12-14T17:26:53.155+00:00"},"s":"F",  "c":"ASSERT",   "id":23091,   "ctx":"initandlisten","msg":"Fatal assertion","attr":{"msgid":28595,"file":"src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp","line":702}}
{"t":{"$date":"2022-12-14T17:26:53.155+00:00"},"s":"F",  "c":"ASSERT",   "id":23092,   "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}

BTW - Had to move back to "mongodb-community/5.0.7":

cd /usr/local/Cellar/mongodb-community/5.0.7/bin
./mongod --repair --dbpath /usr/local/var/mongodb --storageEngine wiredTiger
...
./mongod --config /usr/local/etc/mongod.conf

Then works:

./mongo
MongoDB shell version v5.0.7
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("fb718853-38f5-4ac7-809a-b5e5b4c3d184") }
MongoDB server version: 5.0.7
================
Warning: the "mongo" shell has been superseded by "mongosh",
which delivers improved usability and compatibility.The "mongo" shell has been deprecated and will be removed in
an upcoming release.
For installation instructions, see
https://docs.mongodb.com/mongodb-shell/install/
================
---
The server generated these startup warnings when booting: 
        2022-12-14T21:38:33.980+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
        2022-12-14T21:38:33.998+00:00: Soft rlimits for open file descriptors too low
        2022-12-14T21:38:33.998+00:00:         currentValue: 256
        2022-12-14T21:38:33.998+00:00:         recommendedMinimum: 64000
---
---
        Enable MongoDB's free cloud-based monitoring service, which will then receive and display
        metrics about your deployment (disk utilization, CPU, operation statistics, etc).

        The monitoring data will be available on a MongoDB website with a unique URL accessible to you
        and anyone you share the URL with. MongoDB may use this information to make product
        improvements and to suggest MongoDB products and deployment options to you.

        To enable free monitoring, run the following command: db.enableFreeMonitoring()
        To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---

FIXED (20/12/22):

brew unpin mongodb-community

brew upgrade
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).

You have 2 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

Error: Not upgrading 1 pinned package:
wildfly-as 27.0.1
==> Upgrading 1 outdated package:
mongodb/brew/mongodb-community 6.0.3
==> Fetching mongodb/brew/mongodb-community
==> Downloading https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-6.0.3.tgz
######################################################################## 100.0%
==> Upgrading mongodb/brew/mongodb-community
  -> 6.0.3 

==> Caveats
To restart mongodb/brew/mongodb-community after an upgrade:
  brew services restart mongodb/brew/mongodb-community
Or, if you don't want/need a background service you can just run:
  mongod --config /usr/local/etc/mongod.conf
==> Summary
  /usr/local/Cellar/mongodb-community/6.0.3: 10 files, 208.8MB, built in 3 seconds
==> Running `brew cleanup mongodb-community`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /usr/local/Cellar/mongodb-community/5.0.7... (11 files, 182.5MB)

brew services restart mongodb/brew/mongodb-community
Stopping `mongodb-community`... (might take a while)
==> Successfully stopped `mongodb-community` (label: homebrew.mxcl.mongodb-community)
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)

23.01.23 Just upgrade macOS to 13.2 & 'mongodb-community' fails to run 6.0.3 & 6.0.4.

mongosh
Current Mongosh Log ID: 63ceeb88a1274eb5a6e6f8e0
Connecting to:      mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.2
MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017
3

There are 3 best solutions below

0
On

Just noticed on ‘brew’ that MongoDB 6.0.1 can be upgraded to → 6.0.3 (20.12.22).

brew unpin mongodb-community

brew upgrade
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).

You have 2 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

==> Upgrading 1 outdated package:
mongodb/brew/mongodb-community 6.0.3
==> Fetching mongodb/brew/mongodb-community
==> Downloading https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-6.0.3.tgz
######################################################################## 100.0%
==> Upgrading mongodb/brew/mongodb-community
  -> 6.0.3 

==> Caveats
To restart mongodb/brew/mongodb-community after an upgrade:
  brew services restart mongodb/brew/mongodb-community
Or, if you don't want/need a background service you can just run:
  mongod --config /usr/local/etc/mongod.conf
==> Summary
  /usr/local/Cellar/mongodb-community/6.0.3: 10 files, 208.8MB, built in 3 seconds
==> Running `brew cleanup mongodb-community`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /usr/local/Cellar/mongodb-community/5.0.7... (11 files, 182.5MB)

Obviously a bug with MongoDB on macOS. The two upgrads of 6.01 to 6.0.2/6.0.3 fixes:

brew services restart mongodb/brew/mongodb-community

Stopping `mongodb-community`... (might take a while)

==> **Successfully stopped `mongodb-community` (label: homebrew.mxcl.mongodb-community)**
==> **Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)**

(23/01/2023): Just upgrade Intel macOS to 13.2 & 'mongodb-community' fails to run 6.0.3.

brew services restart mongodb/brew/mongodb-community
Stopping `mongodb-community`... (might take a while)
==> Successfully stopped `mongodb-community` (label: homebrew.mxcl.mongodb-community)
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)

mongosh
Current Mongosh Log ID: 63ceeb88a1274eb5a6e6f8e0
Connecting to:      mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.2
MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017

(25/01/2023) Fixed MongoDB mongodb-community 6.0.4 on macOS 13.2 using 'brew':

Deleted files inside:

usr/local/var/mongodb/

Run:

brew services stop mongodb-community

mongod --config /usr/local/etc/mongod.conf
mongod --repair --dbpath /usr/local/var/mongodb --storageEngine wiredTiger

brew services restart mongodb/brew/mongodb-community

==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)

Then run 'mongosh':

Current Mongosh Log ID: 63d12734740a00eef4b7d5f3
Connecting to:      mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.2
Using MongoDB:      6.0.4
Using Mongosh:      1.6.2

For mongosh info see: https://docs.mongodb.com/mongodb-shell/

------
   The server generated these startup warnings when booting
   2023-01-25T12:57:12.608+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
------

------
   Enable MongoDB's free cloud-based monitoring service, which will then receive and display
   metrics about your deployment (disk utilization, CPU, operation statistics, etc).
   
   The monitoring data will be available on a MongoDB website with a unique URL accessible to you
   and anyone you share the URL with. MongoDB may use this information to make product
   improvements and to suggest MongoDB products and deployment options to you.
   
   To enable free monitoring, run the following command: db.enableFreeMonitoring()
   To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
------

Warning: Found ~/.mongorc.js, but not ~/.mongoshrc.js. ~/.mongorc.js will not be loaded.
  You may want to copy or rename ~/.mongorc.js to ~/.mongoshrc.js.
test> 
2
On

For anyone else finding this thread and still having issues with an M1 Mac, be sure Homebrew is properly (re)installed.

Homebrew uses different directories on M1 (/opt/homebrew) than Intel. And even though Brew won't complain, mongosh won't start if Brew was installed in the old intel directories and therefore mongo was installed in the wrong place as well.

  1. See this post for details on how to properly install Homebrew on M1
  2. then follow the official MongoDB install here and mongosh will properly connect.
0
On
brew uninstall --force mongodb-community

then

brew install mongodb-community