couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "Troubleshooting" by DaveCottlehuber
Date Thu, 21 Mar 2013 09:32:41 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Troubleshooting" page has been changed by DaveCottlehuber:

better init_debug tips

- = Troubleshooting =
+ = First Install =
+ If your couch doesn't start after you've just installed, check the following things:
+  * Usually this is a permissions issue. Ensure that you've followed the [[|chmod/chown
steps in INSTALL.Unix]] tweaked for your platform
+  * This means that the user that couchdb runs under has read/write for {{{.../var/{run,log,lib}/couchdb/}}}
and  {{{.../etc/couchdb}}} and their subdirectories, and read for Erlang, ICU, Spidermonkey
& related libraries
+  * For your distribution check that you *really* installed all the required Erlang modules.
This varies from platform to platform so you'll just have to work it out the hard way.
+  * Confirm that Erlang itself starts up, with crypto (SSL) support:
+ {{{
+ ## what version of erlang are you running? R14B01 or R14B04 are well-known stable releases
+ erl -noshell -eval 'io:put_chars(erlang:system_info(otp_release)).' -s erlang halt
+ ## are the erlang crypto (SSL) libraries working?
+ erl -noshell -eval 'case application:load(crypto) of ok -> io:put_chars("yay_crypto\n")
; _ -> exit(no_crypto) end.' -s init stop
+ }}}
+  * Next identify where your Erlang CouchDB libraries are installed. Usually that's as simple
as tweaking the output of {{{grep ERL_LIBS `which couchdb`}}} as follows:
+ {{{
+ ## from an OSX homebrew install:
+ -env ERL_LIBS $ERL_LIBS:/usr/local/Cellar/couchdb/1.3.x/lib/couchdb/erlang/lib ...
+ ## from a Centos6 install"
+ -env ERL_LIBS /usr/lib64/erlang/lib ...
+ }}}
+  * Use this to start up Erlang with the CouchDB libraries in its path:
+ {{{
+ erl -env ERL_LIBS $ERL_LIBS:/usr/local/Cellar/couchdb/1.3.x/lib/couchdb/erlang/lib -couch_ini
-s crypto
+ }}}
+  * In that erlang shell, let's check that the key libraries are running. The %% lines are
comments so you can skip them:
+ {{{
+ %% test SSL support. If this fails, ensure you have the OTP erlang-crypto library installed
+ crypto:md5_init().
+ %% test Snappy compression. If this fails, check your CouchDB configure script output or
+ %% if your distro comes with erlang-snappy make sure you're using only the CouchDB supplied
+ snappy:compress("gogogogogogogogogogogogogogo").
+ %% test the CouchDB JSON encoder. CouchDB uses different encoders in each release, this
one matches
+ %% what is used in 1.2.x and 1.3.x.
+ ejson:decode(ejson:encode(<<"[1,2,3,4,5]">>)).
+ %% this is how you quit the erlang shell.
+ q().
+ }}}
+  * The output should resemble this, or an error will be thrown:
+ {{{
+ Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
+ Eshell V5.10.1  (abort with ^G)
+ 1> crypto:md5_init().
+ <<1,35,69,103,137,171,205,239,254,220,186,152,118,84,50,
+   16,0,0,0,0,0,0,0,0,128,1,0,0,0,...>>
+ 2> snappy:compress("gogogogogogogogogogogogogogo").
+ {ok,<<28,4,103,111,102,2,0>>}
+ 3> ejson:decode(ejson:encode(<<"[1,2,3,4,5]">>)).
+ <<"[1,2,3,4,5]">>
+ 4>q().
+ }}}
+ At this point the only remaining dependency is your systems' unicode support library, ICU,
and the Spidermonkey Javascript VM from Mozilla. Make sure that your LD_LIBRARY_PATH or similar
for non-Linux systems makes these available to CouchDB.
+ If you are still not able to get CouchDB to start, please put the output of the following
on a paste service somewhere and contact the developers on IRC or the user email list. Replace
ERL_LIBS as required. The output should [[ErlInitDebug|resemble this]].
+ {{{
+ erl -env ERL_LIBS $ERL_LIBS:/usr/local/Cellar/couchdb/1.3.x/lib/couchdb/erlang/lib -couch_ini
-init_debug -emu_args -smp auto +W i +v -s couch
+ }}}
- == Upgrade ==
+ = Upgrade =
  Built CouchDB directly from the Git repository?
@@ -17, +82 @@

- == First Run ==
+ = First Run =
  Having problems getting CouchDB to run for the first time?
@@ -64, +129 @@

   8. Report back to the mailing list (or IRC) with the output from each step.
- == Miscellaneous errors ==
+ = Miscellaneous errors =
  CouchDB using a lot of memory (several hundred MB) on startup?  This one seems to especially
affect Dreamhost installs.  It's really an issue with the Erlang VM pre-allocating data structures
when ulimit is very large or unlimited.  A detailed dicussion can be found [[|on
the erlang-questions list]], but the short answer is that you should decrease ulimit -n or
define ERL_MAX_PORTS to something reasonable like 1024.
@@ -73, +138 @@

   system_limit, erlang, open_port:: Erlang has a default limit of 1024 ports, where each
FD, tcp connection, and linked-in driver uses one port. You seem to have exceeded this. You
can change it at runtime using the ERL_MAX_PORTS env variable.
   (by Adam Kocoloski, [[]])
- == Segmentation faults and bus errors ==
+ = Segmentation faults and bus errors =
  If CouchDB is crashing intermittently with a segmentation fault or a bus error, there's
a good chance that OpenSSL is to blame. Mac OS X Lion ships with a version of OpenSSL that
deprecates various functions used by OTP's crypto NIF. If this is the case, follow the steps
below to fix the problem.
@@ -110, +175 @@

  2> q().
- == Map/Reduce debugging ==
+ = Map/Reduce debugging =
  You can debug your Map and Reduce functions in the js command line. The fact that documents
and function definitions are real javascript code makes it trivial to copy and paste both
into SpiderMonkey.

View raw message