I had my CouchDB development environment up and running along just fine until I tried to start adding external httpd handlers written Python. I was starting my CouchDB instance with
and stopping it with
I would get a cryptic Erlang message with ‘OS Process timeout’. So I figured it was a permissions problem and I was right. I tried chmod on the handler scripts, the directory the handler scripts were in and all kinds of other shots in the dark, until it dawned on me that it was only a problem when the server was started with
so after way to much time was spent trying useless things I dug into the .plist file and found
the problem is that user couchdb doesn’t have permission to do anything and the scripts were owned by
root:wheel. I figured I was starting the server through launchctl as sudo it should have root permissions. That isn’t the case. I changed the entry in the .plist to
and all my external handlers started working when couchdb was started using launchctl. I am sure that is a “bad” thing to do, but for my development environment it is ok. What I will do in the actual server environment is make those handlers executable by user couchdb and that should work.