Thanks a lot. The typo was the actual error.

The external application is now running. But I am getting an error, bad return value. I have attached the output alongwith my python source.

I would also like to know some library through which it is easy to handle JSON requests and responses in C. Basically I have to check the JSON request for a ready flag in my external application (which will be in C), do some processing, and send a JSON response with a successful flag.


On Mon, May 31, 2010 at 3:33 PM, Dave Cottlehuber <> wrote:
On 31 May 2010 21:31, Mahendra Kariya <> wrote:
> I am running couchdb from root user. The command that I specified in
> my_process is working in root.
> CouchDB log says
> [info] [<0.95.0>] - - 'GET' /microatm/my_process 404

Try this instead:

$ curl

Your httpd_db_handler URL is the first parameter in the ini file, not
the <<"my_process">> bit, which is a pointer for couchdb to find the
actual script in the [external] section.

If you have the following diff against local.ini:

> [external]
> mango = /opt/local/bin/
> [httpd_db_handlers]
> _test = {couch_httpd_external, handle_external_req, <<"mango">>}

your URL is /microatm/_test
and not /microatm/mango or /microatm/_mango

when I try an incorrect URL I get your error:
dave@continuity:/Users/dave $ curl http://localhost:5984/sofa/mango

dave@continuity:/Users/dave $ curl http://localhost:5984/sofa/_mango

but the correct URL is fine:
dave@continuity:/Users/dave $ curl http://localhost:5984/sofa/_test

you also seem to have a typo in your local.ini file from above -
you've got a double _underscore_ in httpd_db_handler.

_my__process should really be