Running MongoDB as a MacOS Service: error 3854

I am having a problem updating mongodb. It was first version 4.2.8 (If I recall correctly). Mongodb @5.0.6 is my current version and it has been updated but I cannot start the services with Homebrew.

Similar Problem, but this user’s problem did not include an error 3854, still I followed the solution and it still isn’t resolved. Below is an image of my terminal:

Does mongod.log show more details?

I am reading /usr/local/var/log/mongodb/mongo.log and I find logs along the lines of

Failed to unlink socket file
Fatal assertion
aborting after fassert() failure

Below is an image of some of the logs today.

Check permissions on that file
ls -ls /tmp/mongodb-27017.sock

Do you have any other mongod running?
ps -ef|grep mongod
stop all mongod
Try to change permissions (it should be owned by mongod)

How do I do this? I removed /tmp/mongodb-27017.sock, but how do I end all mongod processes.

So after removing the file how did you start mongod?
ps -ef |grep mongod will show only those started manually from command line

Just issue mongo and see if you can connect to default mongod running from your service

I tried to run mongod, and this is what it returns.

When you run mongod without any parameters it will try to start on default port 27017 and default dirpath / data/db
Since dir is missing it failed to start
Follow the error message-create the missing dir or give alternate path where mongod can write
What was the result if you try to start from service after deleting .sock file?

Thank you, I will try to create the dir path.

After delete the .sock file (no errors), I restarted the services according to Install MongoDB Community Edition on macOS, and the error is still the same.