couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <...@jsonified.com>
Subject Re: Solving COUCHDB-527 .
Date Sun, 29 Sep 2013 10:25:11 GMT
>Hi Everyone,
>
>I'm a COUCHDB user for a while now and i was really interesting to
>contribute to it as much as possible.. I had been in touch with Dave during
>the month of June/July and after that i was relocated some time back so i
>was busy with that..
>
>I'm taking up COUCHDB-527 (https://issues.apache.org/jira/browse/COUCHDB-527)
>and i already added this code to do the check in couch_drv.erl file in
>src/couchdb dir .
>
>D = filelib:is_dir(filename:join(couch_util:priv_dir(), "lib")).
>case filelib:is_dir(D) of
>true ->
>'?LOG_ERROR("Driver loaded successfully")';
>false ->
>' ?LOG_ERROR("Driver directory missing: ~s", [DirectoryName])'
>end,
>
>
>I executed 'make && sudo make install'
>When i run the server it terminates with this message:
>
>Apache CouchDB 1.5.0+build.f714311 (LogLevel=info) is starting.
>{"init terminating in
>do_boot",{{badmatch,{error,{bad_return,{{couch_app,start,[normal,["/usr/local/etc/couchdb/default.ini","/usr/local/etc/couchdb/local.ini"]]},{'EXIT',{{badmatch,{error,shutdown}},[{couch_server_sup,start_server,1},{application_master,start_it_old,4}]}}}}}},[{couch,start,0},{init,start_it,1},{init,start_em,1}]}}
>
>Crash dump was written to: erl_crash.dump
>init terminating in do_boot ()
>
>How can i move forward with this? Thank you for your help :)
>--
>Regards-
>Pavan

Hey Pavan,

Welcome back!

The init stuff is painful to debug & could be lots of things. In fact having more sanity
checking here would be a good 2nd thing (check we can access/read the ini files, and the {var,etc,lib}/couchdb/
dirs too.
You might get something useful by starting 'erl -init_debug' & then to start up
erlang solo (not as couch) and then progressively start up dependent apps, e.g.:

    erl -init_debug  -env ERL_LIBS \
/usr/local/Cellar/couchdb/1.5.0/lib/couchdb/erlang/lib -couch_ini

and then:

    application:load(crypto), application:start(crypto).
    application:load(couch), application:start(couch).

When stuff in there fails, refer to the source & walk through step by step.
Also, you don't need to do sudo make install, just use `make dev` like http://wiki.apache.org/couchdb/Running%20CouchDB%20in%20Dev%20Mode
Re your code, some suggestions:
Consider whether your error message is unique - can you make it explicit exactly what the
issue is?
Does the error message reflect correctly what has happened?
Is the variable name clear & matches what its being used for?
Why call filelib:is_dir/1 twice?
No need to answer all of that on list, but when you have something you're happy with, send
a github pull request for http://github.com/apache/couchdb and we can look further there.

Finally, @everybody Alex, Dirkjan how might we implement a super-easy way to find more info
on a given error message in the docs?
A+
Dave



Mime
View raw message