The CouchDB package from the official Ubuntu 17.10 package repositories currently fails to start through systemctl or directly using the CLI. I have tested this on my main machine using bare metal, as well as a fresh install with updated packages with only CouchDB installed in a VM.
The CouchDB systemctl process to start using the systemctl start * or systemctl restart * command, or using couchdb from the terminal.
CouchDB fails to start, and systemctl status reports this:
```โ couchdb.service - System-wide CouchDB instance
Loaded: loaded (/lib/systemd/system/couchdb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-10-23 06:51:10 CDT; 1s ago
Process: 1919 ExecStart=/usr/bin/couchdb (code=exited, status=1/FAILURE)
Main PID: 1919 (code=exited, status=1/FAILURE)
Oct 23 06:51:10 devin-VirtualBox systemd[1]: couchdb.service: Main process exited, code=exited, status=1/FAILURE
Oct 23 06:51:10 devin-VirtualBox systemd[1]: couchdb.service: Unit entered failed state.
Oct 23 06:51:10 devin-VirtualBox systemd[1]: couchdb.service: Failed with result 'exit-code'.
Oct 23 06:51:10 devin-VirtualBox systemd[1]: couchdb.service: Service hold-off time over, scheduling restart.
Oct 23 06:51:10 devin-VirtualBox systemd[1]: Stopped System-wide CouchDB instance.
Oct 23 06:51:10 devin-VirtualBox systemd[1]: couchdb.service: Start request repeated too quickly.
Oct 23 06:51:10 devin-VirtualBox systemd[1]: Failed to start System-wide CouchDB instance.
Oct 23 06:51:10 devin-VirtualBox systemd[1]: couchdb.service: Unit entered failed state.
Oct 23 06:51:10 devin-VirtualBox systemd[1]: couchdb.service: Failed with result 'exit-code'.
If I attempt to execute `sudo couchdb` from the terminal, the process fails to start with this output:
Apache CouchDB 1.6.0 (LogLevel=info) is starting.
[error] [<0.123.0>] {error_report,<0.59.0>,
{<0.123.0>,supervisor_report,
[{supervisor,{local,couch_secondary_services}},
{errorContext,start_error},
{reason,
{'EXIT',
{undef,
[{crypto,rand_bytes,[16],[]},
{couch_uuids,random,0,
[{file,"couch_uuids.erl"},{line,33}]},
{couch_server,get_uuid,0,
[{file,"couch_server.erl"},{line,54}]},
{couch_httpd,start_link,2,
[{file,"couch_httpd.erl"},{line,119}]},
{supervisor,do_start_child,2,
[{file,"supervisor.erl"},{line,365}]},
{supervisor,start_children,3,
[{file,"supervisor.erl"},{line,348}]},
{supervisor,init_children,2,
[{file,"supervisor.erl"},{line,314}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},{line,365}]}]}}},
{offender,
[{pid,undefined},
{id,httpd},
{mfargs,{couch_httpd,start_link,[]}},
{restart_type,permanent},
{shutdown,brutal_kill},
{child_type,worker}]}]}}
=SUPERVISOR REPORT==== 23-Oct-2017::06:50:06 ===
Supervisor: {local,couch_secondary_services}
Context: start_error
Reason: {'EXIT',
{undef,
[{crypto,rand_bytes,[16],[]},
{couch_uuids,random,0,
[{file,"couch_uuids.erl"},{line,33}]},
{couch_server,get_uuid,0,
[{file,"couch_server.erl"},{line,54}]},
{couch_httpd,start_link,2,
[{file,"couch_httpd.erl"},{line,119}]},
{supervisor,do_start_child,2,
[{file,"supervisor.erl"},{line,365}]},
{supervisor,start_children,3,
[{file,"supervisor.erl"},{line,348}]},
{supervisor,init_children,2,
[{file,"supervisor.erl"},{line,314}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},{line,365}]}]}}
Offender: [{pid,undefined},
{id,httpd},
{mfargs,{couch_httpd,start_link,[]}},
{restart_type,permanent},
{shutdown,brutal_kill},
{child_type,worker}]
[error] [<0.113.0>] {error_report,<0.59.0>,
{<0.113.0>,supervisor_report,
[{supervisor,{local,couch_server_sup}},
{errorContext,start_error},
{reason,
{shutdown,
{failed_to_start_child,httpd,
{'EXIT',
{undef,
[{crypto,rand_bytes,[16],[]},
{couch_uuids,random,0,
[{file,"couch_uuids.erl"},{line,33}]},
{couch_server,get_uuid,0,
[{file,"couch_server.erl"},{line,54}]},
{couch_httpd,start_link,2,
[{file,"couch_httpd.erl"},{line,119}]},
{supervisor,do_start_child,2,
[{file,"supervisor.erl"},{line,365}]},
{supervisor,start_children,3,
[{file,"supervisor.erl"},{line,348}]},
{supervisor,init_children,2,
[{file,"supervisor.erl"},{line,314}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},{line,365}]}]}}}}},
{offender,
[{pid,undefined},
{id,couch_secondary_services},
{mfargs,{couch_secondary_sup,start_link,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]}]}}
=SUPERVISOR REPORT==== 23-Oct-2017::06:50:06 ===
Supervisor: {local,couch_server_sup}
Context: start_error
Reason: {shutdown,
{failed_to_start_child,httpd,
{'EXIT',
{undef,
[{crypto,rand_bytes,[16],[]},
{couch_uuids,random,0,
[{file,"couch_uuids.erl"},{line,33}]},
{couch_server,get_uuid,0,
[{file,"couch_server.erl"},{line,54}]},
{couch_httpd,start_link,2,
[{file,"couch_httpd.erl"},{line,119}]},
{supervisor,do_start_child,2,
[{file,"supervisor.erl"},{line,365}]},
{supervisor,start_children,3,
[{file,"supervisor.erl"},{line,348}]},
{supervisor,init_children,2,
[{file,"supervisor.erl"},{line,314}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},
{line,365}]}]}}}}
Offender: [{pid,undefined},
{id,couch_secondary_services},
{mfargs,{couch_secondary_sup,start_link,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]
{"init terminating in do_boot",{{badmatch,{error,{bad_return,{{couch_app,start,[normal,["/etc/couchdb/default.ini","/etc/couchdb/local.ini"]]},{'EXIT',{{badmatch,{error,{shutdown,{failed_to_start_child,couch_secondary_services,{shutdown,{failed_to_start_child,httpd,{'EXIT',{undef,[{crypto,rand_bytes,[16],[]},{couch_uuids,random,0,[{file,"couch_uuids.erl"},{line,33}]},{couch_server,get_uuid,0,[{file,"couch_server.erl"},{line,54}]},{couch_httpd,start_link,2,[{file,"couch_httpd.erl"},{line,119}]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,365}]},{supervisor,start_children,3,[{file,"supervisor.erl"},{line,348}]},{supervisor,init_children,2,[{file,"supervisor.erl"},{line,314}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]}]}}}}}}}},[{couch_server_sup,start_server,1,[{file,"couch_server_sup.erl"},{line,98}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,273}]}]}}}}}},[{couch,start,0,[{file,"couch.erl"},{line,18}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({{badmatch,{error,{bad_return,{_}}}},[{couch,start,0,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})
Crash dump is being written to: erl_crash.dump...done
```
sudo systemctl status couchdb
I am a developer and I am working on an application that utilizes CouchDB as a no SQL database. Due to my dependency on this I will need to revert to using Ubuntu 17.04 or 16.04 to continue my development.
CouchDB 1.6.x does not support the version of Erlang that ships with 17.10. You will need to install an older version of Erlang, possibly from https://packages.erlang-solutions.com/ .
Which version of Erlang i have to install ?
thanks
Erlang 17 or older for 1.6.1.
I downgraded the version of erlang but it still does't work. can please help me ?
File a ticket with Ubuntu. We are not responsible for that package, sorry.
Follow this post to solve your problem
https://medium.com/@tomiwatech_45998/installing-couchdb-on-ubuntu-17-10-18148e2eb846
@tomiwatech Your article really helped. Thanks. Almost downgraded my Erlang and Ubuntu
@tomiwatech @jmziya I'm the one who filed the bug with Ubuntu that helped get that repo created. If you want to follow the bug and progress from Ubuntu as well as the System76 developer that created that repo, go here. https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/1729305
Most helpful comment
Follow this post to solve your problem
https://medium.com/@tomiwatech_45998/installing-couchdb-on-ubuntu-17-10-18148e2eb846