coolfactor

MongoDB on macOS Sierra, Installed via MacPorts

Oct 15, 2016

This week, I upgraded my MacBook Air to Sierra, and as part of this annual ritual, I also had to re-install all of my MacPorts-based software installations. Most things went smoothly, except MongoDB was particularly troublesome. It would install, and I could launch it manually, but it would not be launched automatically via `launchctl`. I had existing databases from my previous install, and I preferred not lose these. However, I decided to drop them and do a completely fresh installation.

What I noticed was the difference in permissions on the following directory:

/opt/local/var/db/mongodb/

Prior to doing a completely-fresh install, this directory was owned by `root`, with the group as `_mongo`. I thought this was normal at the time, so I wasn't suspicious of it. However, after doing a completely fresh install, the owner was now `_mongo`, as well. So this tells me what was likely happening — the `_mongo` user did not have permission to write to this directory. Some of the files inside this directory had `read-write` only for the owner, not the group.

So, try adjusting the ownership of this directory and possibly its contents so that the `_mongo` user can write.

comments powered by Disqus