If your CouchDB doesn’t start after you’ve just installed, check the following
things:

On UNIX-like systems, this is usually this is a permissions issue. Ensure
that you’ve followed the User Registration and Securitychown/chmod commands. This problem is indicated by the presence of
the keyword eacces somewhere in the error output from CouchDB itself.

Some Linux distributions split up Erlang into multiple packages. 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 for yourself. For example, on recent versions of Ubuntu/Debian,
the erlang package includes all Erlang modules.

Next, identify where your Erlang CouchDB libraries are installed. This will
typically be the lib/ subdirectory of the release that you have installed.

Use this to start up Erlang with the CouchDB libraries in its path:

erl -env ERL_LIBS $ERL_LIBS:/path/to/couchdb/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 alternatively
%% if your distro comes with erlang-snappy make sure you're using only the CouchDB supplied version
snappy:compress("gogogogogogogogogogogogogogo").
%% test the CouchDB JSON encoder. CouchDB uses different encoders in each release, this one matches
%% what is used in 2.0.x.
jiffy:decode(jiffy:encode(<<"[1,2,3,4,5]">>)).
%% this is how you quit the erlang shell.
q().

At this point the only remaining dependency is your system’s Unicode support
library, ICU, and the Spidermonkey Javascript VM from Mozilla. Make sure that
your LD_LIBRARY_PATH or equivalent for non-Linux systems
(DYLD_LIBRARY_PATH on macOS) makes these available to CouchDB.
Linux example running as normal user:

Having problems getting CouchDB to run for the first time? Follow this simple
procedure and report back to the user mailing list or IRC with the output
of each step. Please put the output of these steps into a paste service (such
as https://paste.ee/) rather than including the output of your entire
run in IRC or the mailing list directly.

Note down the name and version of your operating system and your processor
architecture.

Note down the installed versions of CouchDB’s dependencies.

Follow the checkout instructions to get a fresh copy of CouchDB’s trunk.

Configure from the couchdb directory:

./configure

Build the release:

make release

Run the couchdb command and log the output:

cd rel/couchdb
bin/couchdb

Use your system’s kernel trace tool and log the output of the above command.

For example, linux systems should use strace:

strace bin/couchdb 2> strace.out

Report back to the mailing list (or IRC) with the output of each step.

Is your 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 discussion 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.

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.

If you see this in the CouchDB error logs, the JavaScript code you are using
for either a map or reduce function is referencing an object member that is
not defined in at least one document in your database. Consider this
document:

{
"_id":"XYZ123",
"_rev":"1BB2BB",
"field":"value"
}

and this map function:

function(doc){emit(doc.name,doc.address);}

This will fail on the above document, as it does not contain a name or
address member. Instead, use guarding to make sure the function only
accesses members when they exist in a document:

function(doc){if(doc.name&&doc.address){emit(doc.name,doc.address);}}

While the above guard will work in most cases, it’s worth bearing JavaScript’s
understanding of ‘false’ values in mind. Testing against a property with a
value of 0 (zero), '' (empty String), false or null will return
false. If this is undesired, a guard of the form if(doc.foo!==undefined)
should do the trick.

This error can also be caused if a reduce function does not return a value. For
example, this reduce function will cause an error:

Operating systems can be configured to disallow the use of OpenSSL MD5 hash
functions in order to prevent use of MD5 for cryptographic purposes. CouchDB
makes use of MD5 hashes for verifying the integrity of data (and not for
cryptography) and will not run without the ability to use MD5 hashes.

The message below indicates that the operating system is running in “FIPS mode,”
which, among other restrictions, does not allow the use of OpenSSL’s
MD5 functions:

A workaround for this is provided with the --erlang-md5 compile flag. Use of
the flag results in CouchDB substituting the OpenSSL MD5 function calls with
equivalent calls to Erlang’s built-in library erlang:md5. NOTE: there may be
a performance penalty associated with this workaround.

Because CouchDB does not make use of MD5 hashes for cryptographic purposes, this
workaround does not defeat the purpose of “FIPS mode,” provided that the system
owner is aware of and consents to its use.