Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CouchDB 2.1.0 fails to start under macOS High Sierra #840

Closed
dj-at-work opened this issue Sep 26, 2017 · 17 comments
Closed

CouchDB 2.1.0 fails to start under macOS High Sierra #840

dj-at-work opened this issue Sep 26, 2017 · 17 comments
Assignees
Labels

Comments

@dj-at-work
Copy link

After updating from macOS Sierra (10.12.6) to High Sierra (10.13) CouchDb 2.1.0 fails to start.

I had a running CouchDB 2.1.0 on Sierra (10.12.6) with multiple databases. During the install process the running couchdb was stoped by macOS. After the update to High Sierra CouchDB showed the behavior as described below.

I replaced the current installation by a fresh one: I removed the Apache CouchDB app from programs and deleted the CouchDB2 folder from the /Users/username/Library/Application Support. Downloaded the app again and installed it to programs.

Running a fresh installation makes unfortunately no difference.

Current Behavior

After starting the Apache CouchDB app couchdb keeps restarting and opening browser windows with the admin console URL.

The log (debug level) looks like this:

[info] 2017-09-26T09:42:12.253683Z couchdb@localhost <0.202.0> -------- Starting couch_sup
[debug] 2017-09-26T09:42:12.253820Z couchdb@localhost <0.202.0> -------- Supervisor couch_sup started config_listener_mon:start_link(couch_sup, nil) at pid <0.203.0>
[debug] 2017-09-26T09:42:12.630034Z couchdb@localhost <0.204.0> -------- Supervisor couch_primary_services started couch_drv:start_link() at pid <0.205.0>
[debug] 2017-09-26T09:42:12.638250Z couchdb@localhost <0.204.0> -------- Supervisor couch_primary_services started couch_task_status:start_link() at pid <0.206.0>
[debug] 2017-09-26T09:42:12.663819Z couchdb@localhost <0.204.0> -------- Supervisor couch_primary_services started couch_server:sup_start_link() at pid <0.207.0>
[debug] 2017-09-26T09:42:12.663903Z couchdb@localhost <0.202.0> -------- Supervisor couch_sup started couch_primary_sup:start_link() at pid <0.204.0>
[debug] 2017-09-26T09:42:12.676391Z couchdb@localhost <0.210.0> -------- Supervisor couch_secondary_services started gen_event:start_link({local,couch_plugin}) at pid <0.211.0>
[debug] 2017-09-26T09:42:12.685797Z couchdb@localhost <0.210.0> -------- Supervisor couch_secondary_services started couch_proc_manager:start_link() at pid <0.212.0>
[debug] 2017-09-26T09:42:12.706931Z couchdb@localhost <0.210.0> -------- Supervisor couch_secondary_services started couch_httpd_vhost:start_link() at pid <0.214.0>
[debug] 2017-09-26T09:42:33.254900Z couchdb@localhost <0.111.0> -------- Supervisor couch_log_sup started couch_log_monitor:start_link() at pid <0.114.0>
[debug] 2017-09-26T09:42:33.268683Z couchdb@localhost <0.111.0> -------- Supervisor couch_log_sup started config_listener_mon:start_link(couch_log_sup, nil) at pid <0.115.0>
[info] 2017-09-26T09:42:33.268713Z couchdb@localhost <0.7.0> -------- Application couch_log started on node couchdb@localhost
[debug] 2017-09-26T09:42:33.274106Z couchdb@localhost <0.119.0> -------- Supervisor folsom_sup started folsom_sample_slide_sup:start_link() at pid <0.120.0>
[debug] 2017-09-26T09:42:33.279882Z couchdb@localhost <0.119.0> -------- Supervisor folsom_sup started folsom_meter_timer_server:start_link() at pid <0.121.0>
[debug] 2017-09-26T09:42:33.285270Z couchdb@localhost <0.119.0> -------- Supervisor folsom_sup started folsom_metrics_histogram_ets:start_link() at pid <0.122.0>
[info] 2017-09-26T09:42:33.285389Z couchdb@localhost <0.7.0> -------- Application folsom started on node couchdb@localhost
[debug] 2017-09-26T09:42:33.426693Z couchdb@localhost <0.126.0> -------- Supervisor couch_stats_sup started couch_stats_aggregator:start_link() at pid <0.127.0>
[debug] 2017-09-26T09:42:33.432456Z couchdb@localhost <0.126.0> -------- Supervisor couch_stats_sup started couch_stats_process_tracker:start_link() at pid <0.176.0>
[info] 2017-09-26T09:42:33.432569Z couchdb@localhost <0.7.0> -------- Application couch_stats started on node couchdb@localhost
[info] 2017-09-26T09:42:33.432679Z couchdb@localhost <0.7.0> -------- Application khash started on node couchdb@localhost
[debug] 2017-09-26T09:42:33.464524Z couchdb@localhost <0.181.0> -------- Supervisor couch_event_sup2 started couch_event_server:start_link() at pid <0.182.0>
[debug] 2017-09-26T09:42:33.470571Z couchdb@localhost <0.184.0> -------- Supervisor couch_event_os_sup started config_listener_mon:start_link(couch_event_os_sup, nil) at pid <0.185.0>
[debug] 2017-09-26T09:42:33.470705Z couchdb@localhost <0.181.0> -------- Supervisor couch_event_sup2 started couch_event_os_sup:start_link() at pid <0.184.0>
[info] 2017-09-26T09:42:33.470820Z couchdb@localhost <0.7.0> -------- Application couch_event started on node couchdb@localhost
[debug] 2017-09-26T09:42:33.492272Z couchdb@localhost <0.189.0> -------- Supervisor ibrowse_sup started ibrowse:start_link() at pid <0.190.0>
[info] 2017-09-26T09:42:33.492386Z couchdb@localhost <0.7.0> -------- Application ibrowse started on node couchdb@localhost
[debug] 2017-09-26T09:42:33.510824Z couchdb@localhost <0.195.0> -------- Supervisor ioq_sup started ioq:start_link() at pid <0.196.0>
[info] 2017-09-26T09:42:33.510938Z couchdb@localhost <0.7.0> -------- Application ioq started on node couchdb@localhost
[info] 2017-09-26T09:42:33.511045Z couchdb@localhost <0.7.0> -------- Application mochiweb started on node couchdb@localhost
[info] 2017-09-26T09:42:33.538921Z couchdb@localhost <0.201.0> -------- Apache CouchDB 2.1.0 is starting.

Steps to Reproduce (for bugs)

  1. fresh download of Apache CouchDB app for mac
  2. Double click on Apache CouchDB app in Programs

Environment

  • Version used: 2.1.0
  • Operating System and version (desktop or mobile): macOS 10.13 (High Sierra)
@wohali
Copy link
Member

wohali commented Sep 26, 2017

That looks like CouchDB is running fine, but the contributed application that @janl wrote has some sort of error.

Are you able to curl localhost:5984 in a terminal window and get the proper response at least?

@hugazo
Copy link

hugazo commented Sep 26, 2017

I'm having the same ussue, curl returns the following:

➜ ~ curl http://127.0.0.1:5984
curl: (7) Failed to connect to 127.0.0.1 port 5984: Connection refused

In addition, i have the same environment that OP:
OS: Mac OS High Sierra 10.13 (17A365) (App Store Release)
CouchDB: 2.1.0

@dj-at-work
Copy link
Author

dj-at-work commented Sep 27, 2017

@wohali The couch is definitely not running. Curl returned with
curl: (7) Failed to connect to localhost port 5984: Connection refused.

I've played a bit around. I've extracted couchdbx-corefolder from the CouchDB 2.1.0 app and run it in the terminal.
I get Segmentation fault: 11 as final result:

./bin/couchdb 
[info] 2017-09-27T09:44:14.776619Z couchdb@localhost <0.7.0> -------- Application couch_log started on node couchdb@localhost
[info] 2017-09-27T09:44:14.796307Z couchdb@localhost <0.7.0> -------- Application folsom started on node couchdb@localhost
[info] 2017-09-27T09:44:14.953660Z couchdb@localhost <0.7.0> -------- Application couch_stats started on node couchdb@localhost
[info] 2017-09-27T09:44:14.953816Z couchdb@localhost <0.7.0> -------- Application khash started on node couchdb@localhost
[info] 2017-09-27T09:44:15.016863Z couchdb@localhost <0.7.0> -------- Application couch_event started on node couchdb@localhost
[info] 2017-09-27T09:44:15.036828Z couchdb@localhost <0.7.0> -------- Application ibrowse started on node couchdb@localhost
[info] 2017-09-27T09:44:15.055847Z couchdb@localhost <0.7.0> -------- Application ioq started on node couchdb@localhost
[info] 2017-09-27T09:44:15.055999Z couchdb@localhost <0.7.0> -------- Application mochiweb started on node couchdb@localhost
[info] 2017-09-27T09:44:15.086719Z couchdb@localhost <0.201.0> -------- Apache CouchDB 2.1.0 is starting.

[info] 2017-09-27T09:44:15.086864Z couchdb@localhost <0.202.0> -------- Starting couch_sup
Segmentation fault: 11

The same (?) result, when I start CouchDB 1.6.1. The application reports an error and offer to quit or retry. The couchdb.log contains:

Launching '/Applications/Apache CouchDB.app/Contents/Resources/couchdbx-core/bin/couchdb'
Eshell V6.1  (abort with ^G)
Apache CouchDB 1.6.1 (LogLevel=info) is starting.
Terminated with status 11

@janl janl self-assigned this Sep 27, 2017
@janl
Copy link
Member

janl commented Sep 27, 2017

I’ll look at this over the weekend.

@wohali
Copy link
Member

wohali commented Sep 28, 2017

This is an Erlang bug:

https://bugs.erlang.org/browse/ERL-439

This commit fixed the problem:

erlang/otp@882c90f

If you can build Erlang from source, try applying this change and you should be good to go. CouchDB isn't ready yet for Erlang 20, so you'll need a build of Erlang 19.x or older that includes this one-line change for High Sierra builds to work correctly.

@wohali wohali added the macos label Sep 29, 2017
@janl
Copy link
Member

janl commented Sep 30, 2017

@dj-at-work
Copy link
Author

dj-at-work commented Sep 30, 2017

Hi @janl, thank you!
I did a quick test and it looks fine so far. I will do more tests in the next days.

@Chris-Andrews
Copy link

I just tested as well. The new binary fixes the issue for me. Thanks @janl

asfgit pushed a commit to apache/couchdb-www that referenced this issue Sep 30, 2017
@janl
Copy link
Member

janl commented Sep 30, 2017

@TheNightbear @Chris-Andrews Thanks! New zip up on the site: apache/couchdb-www@b7a7235

@hugazo
Copy link

hugazo commented Oct 1, 2017

Just a quick follow-up, everything working OK.

Thanks!

@contrerasmarc
Copy link

It works, thanks

@kinesias
Copy link

kinesias commented Oct 22, 2017

I installed CouchDB 2.1 on High Sierra three days ago. At first, It seemed to work, but from time to time I'm getting the following error, which never happened before on Mac OS 10.12 Sierra. CouchDB keeps restarting and restarting.
UPDATE: also, it's telling my "type error" when I try to log in.

`CRASH REPORT Process couch_compaction_daemon (<0.6896.0>) with 0 neighbors exited with reason: {compaction_loop_died,{{badmatch,{error,enoent}},[{couch_compaction_daemon,abs_path,1,[{file,"src/couch_compaction_daemon.erl"},{line,526}]},{couch_compaction_daemon,free_space_rec,2,[{file,"src/couch_compaction_daemon.erl"},{line,517}]},{couch_compaction_daemon,can_db_compact,2,[{file,"src/couch_compaction_daemon.erl"},{line,327}]},{couch_compaction_daemon,maybe_compact_db,3,[{file,"src/couch_compaction_daemon.erl"},{line,164}]},{couch_compaction_daemon,'-compact_loop/1-fun-0-',3,[{file,"s..."},...]},...]}} at gen_server:terminate/7(line:812) <= proc_lib:init_p_do_apply/3(line:247); initial_call: {couch_compaction_daemon,init,['Argument__1']}, ancestors: [couch_secondary_services,couch_sup,<0.207.0>], messages: [], links: [<0.6511.0>], dictionary: [], trap_exit: true, status: running, heap_size: 987, stack_size: 27, reductions: 2788
[error] 2017-10-22T10:36:20.844313Z couchdb@localhost <0.6511.0> -------- Supervisor couch_secondary_services had child compaction_daemon started with couch_compaction_daemon:start_link() at <0.6896.0> exit with reason {compaction_loop_died,{{badmatch,{error,enoent}},[{couch_compaction_daemon,abs_path,1,[{file,"src/couch_compaction_daemon.erl"},{line,526}]},{couch_compaction_daemon,free_space_rec,2,[{file,"src/couch_compaction_daemon.erl"},{line,517}]},{couch_compaction_daemon,can_db_compact,2,[{file,"src/couch_compaction_daemon.erl"},{line,327}]},{couch_compaction_daemon,maybe_compact_db,3,[{file,"src/couch_compaction_daemon.erl"},{line,164}]},{couch_compaction_daemon,'-compact_loop/1-fun-0-',3,[{file,"s..."},...]},...]}} in context child_terminated

update: has nothing to do with the "autocompaction whitespace bug"

@wohali
Copy link
Member

wohali commented Oct 24, 2017

@kinesias Actually, yes, it is related. That's the exact error we'd expect in that situation. Any mounted volume that has a space in it will cause this crash.

You can disable the compaction daemon to fix this for now:

#802 (comment)

@kinesias
Copy link

oh, interesting, because I renamed all my mounted volumes -- first it seemed to work, but then it crashed again... I appreciate your help very much, you guys are awesome!

@navneet21sharma
Copy link

I am having CouchDB 2.1.1 for mac and having same issue. When I start couchDB then it start opening new tab with address http://127.0.0.1:5984/_utils/ and refused to connect. It continue to open until I force quit it. I tried to do according to your reply but Didn't find local.ini file. Please let me know the path of this file for mac
Please find crash log file
CouchDB2.log

@diachedelic
Copy link

diachedelic commented Sep 10, 2018

Upon upgrading to MacOS High Sierra, CouchDB fails to start. For legacy reasons I need to to run v1.6.0 (we use a deprecated river to sync with ElasticSearch). Following @wohali 's suggestion, I patched and rebuilt Erlang, then modified couchdbx-core/bin/erl to point to the new binaries. However, I still get the exact same error as before:

Segmentation fault: 11

Could it be I also need to rebuild CouchDB's Erlang libs using that patch?

Edit:

I think my issue was that in bin/erl I was modifying BINDIR but not ROOTDIR. I installed R16B01 using kerl, and now Couch is running happily.

@EmreKorpe
Copy link

EmreKorpe commented Sep 29, 2023

I am having CouchDB 2.1.1 for mac and having same issue. When I start couchDB then it start opening new tab with address http://127.0.0.1:5984/_utils/ and refused to connect. It continue to open until I force quit it. I tried to do according to your reply but Didn't find local.ini file. Please let me know the path of this file for mac
Please find crash log file
CouchDB2.log

Hello, did you find any solution? @navneet21sharma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants