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

couchjs fails to run on High Sierra from binary package #979

Closed
thgautier92 opened this issue Nov 10, 2017 · 29 comments
Closed

couchjs fails to run on High Sierra from binary package #979

thgautier92 opened this issue Nov 10, 2017 · 29 comments

Comments

@thgautier92
Copy link

thgautier92 commented Nov 10, 2017

When I execute the installation verify test, the view is never created and a error message is displayed.

Expected Behavior

The view must be created

Current Behavior

The view is never created and a error message is displayed :

Error: undefined

Steps to Reproduce (for bugs)

  1. Install Apache Couchdb.app from the web site
  2. Run the application
  3. Setup a single node, with user and password, and 127.0.0.1 as host
  4. Verify the installation

Context

I want to migrate the 1.6.x installation to the newest version 2.1.1.
The installation is most operational, but only views on my existing databases doesn't work.
So i tried to verify if the installation was correct.

Your Environment

  • Version used: 2.1.1
  • Browser Name and version: Chrome 62
  • Operating System and version (desktop or mobile): MAC OS SIERRA 10.13
  • Log file:
    CouchDB2.log
@wohali wohali added the macos label Nov 10, 2017
@wohali
Copy link
Member

wohali commented Nov 10, 2017

{exit_status,134} in the logfile for the couchjs process says that something isn't quite right with your installation and setup. I don't have a Mac with 10.13 available for testing so I can't help any further, sorry.

@lyudmil
Copy link

lyudmil commented Nov 15, 2017

@wohali, I think this issue is not as specific to @thgautier92's setup as we might hope. I can confirm I have the same problem after applying the latest update of MacOS (10.13.1). I'm able to reproduce the problem without step 3 – just installing the binary application and verifying the install fails. The verification process claims to succeed in creating a view, but (1) it gets an error during the process, (2) the view is not present in the verification database, and (3) replication then fails, due to the number of docs being 1 fewer than expected (I think because the design doc never saves). Here's a screenshot right before the replication test failure:

screen shot 2017-11-15 at 3 55 43 pm

There many crash reports in my system log related to CouchDB, all pretty much one of two types. One is:

Process:               couchjs [11507]
Path:                  /Applications/Apache CouchDB.app/Contents/Resources/couchdbx-core/bin/couchjs
Identifier:            couchjs
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        erl_child_setup [752]
Responsible:           couchjs [11507]
User ID:               501

Date/Time:             2017-11-15 15:58:26.219 +0200
OS Version:            Mac OS X 10.13.1 (17B48)
Report Version:        12
Anonymous UUID:        D39DCAE6-734C-498E-F796-1FECDA8DD5CF


Time Awake Since Boot: 950 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries
...

And here's the other:

Process:               beam.smp [690]
Path:                  /Applications/Apache CouchDB.app/Contents/Resources/couchdbx-core/lib/erlang/erts-6.1/bin/beam.smp
Identifier:            beam.smp
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        Apache CouchDB [682]
Responsible:           beam.smp [690]
User ID:               501

Date/Time:             2017-11-14 17:06:00.744 +0200
OS Version:            Mac OS X 10.13.1 (17B48)
Report Version:        12
Anonymous UUID:        D39DCAE6-734C-498E-F796-1FECDA8DD5CF


Time Awake Since Boot: 1400 seconds

System Integrity Protection: enabled

Crashed Thread:        10

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000100000074
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]
...

I'm available and willing to try things out on my Mac to help resolve this. Let me know how I might be useful.

@lyudmil
Copy link

lyudmil commented Nov 15, 2017

I updated a number of other components on my system (including Erlang), and I no longer get the crash reports I described previously. I do see this when I try to run the install verification, though:

default	18:04:59.473126 +0200	kernel	Process[11374] crashed: couchjs. Too many corpses being created.
default	18:04:59.484397 +0200	taskgated	MacOS error: -67062
default	18:04:59.490932 +0200	kernel	Process[11375] crashed: couchjs. Too many corpses being created.
default	18:04:59.503040 +0200	taskgated	MacOS error: -67062
default	18:04:59.509553 +0200	kernel	Process[11376] crashed: couchjs. Too many corpses being created.
default	18:04:59.521725 +0200	taskgated	MacOS error: -67062
default	18:04:59.528253 +0200	kernel	Process[11377] crashed: couchjs. Too many corpses being created.
default	18:04:59.542521 +0200	taskgated	MacOS error: -67062
default	18:04:59.553778 +0200	kernel	Process[11378] crashed: couchjs. Too many corpses being created.
default	18:04:59.570313 +0200	taskgated	MacOS error: -67062

The error coming from taskgated is a security exception. It looks like macOS is blocking couchjs from running on security grounds.

@wohali
Copy link
Member

wohali commented Nov 15, 2017

Again I can't help diagnose as I don't have a Mac handy. @janl will need to follow up with you as he is responsible for the macOS package.

@sinitean
Copy link

I'm seeing a similar issue on OSX 10.13.1. It happens with any view or if you decide to replicate anything that has a design doc attached.
The couchdb.log entry is:
[info] 2017-11-15T23:05:22.685021Z couchdb@localhost <0.218.0> -------- couch_proc_manager <0.24207.0> died normal
[error] 2017-11-15T23:05:22.685029Z couchdb@localhost <0.9320.0> c5d0527261 OS Process Error <0.24207.0> :: {os_process_error,{exit_status,134}}

The moment I try to create a view the message above floods the log and memory consumption on my mac maxes out (I have 40gig of memory). I end up killing couch before it kills my machine.

I see the upgrade nodes for 2.1.1 and wonder if it is related to #914 and #916.
#916
#914

The problems are not limited to my Mac install.
I see also similar errors on ubuntu 16.04 on 2 separate servers.
Using curl, trying a replication of a db ("mydb") that contains views get me:
{"error":"error","reason":"{http_request_failed,"GET",\n "https://admin:*****@127.0.0.1:5984/mydb/\",\n {error,{error,{conn_failed,{error,{tls_alert,"record overflow"}}}}}}"}

If I 'm trying to create or delete a db via curl:
curl -X PUT http://admin:****@127.0.0.1:5984/testdb
or
curl -X DELETE http://admin:****@127.0.0.1:5984/testdb
I get the following error:
{"error":"error","reason":"internal_server_error"}
Interestingly, the db is created / deleted as it can be seen on Fauxton or by doing a curl get _all_dbs.
This works also with the verifydb test. If you run the verification step you get an error and then in Fauxton you see it greyed out with "database could not be loaded". But you can remove (and re-add) it via curl despite getting the error.

@TomArbuckle
Copy link

@wohali

Concerning the missing library problem, continuing on from the previous report by @lyudmil (quoting previous text)

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

I see the error in the macOS console User reports (macOS 10.12.6) continues as

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /usr/local/Cellar/nspr/4.17/lib/libnspr4.dylib
  Referenced from: /Applications/Apache CouchDB.app/Contents/Resources/couchdbx-core/*/libplds4.dylib
  Reason: image not found

In other words, the Macintosh application binary has a dependency on an external library which is not distributed as part of the download and may not be present on users' machines.

It's a packaging issue.

HTH.

@martinleopold
Copy link

I can confirm this, @TomArbuckle. Since /usr/local/Cellar is the default location for homebrew packages, I tried doing a brew install nspr. Now I can sucessfully verify my CouchDB 2.1.1 installation on macOS 10.13.1.

Before:
screen shot 2017-11-18 at 00 05 55

After:
screen shot 2017-11-18 at 00 28 32

@sinitean
Copy link

sinitean commented Nov 18, 2017 via email

@dantelepoole
Copy link

Installing nspr with brew fixed the same problem for me as well.

@thgautier92
Copy link
Author

I confirm ! Installating nspr via brew is working and all CouchDb functions, including verification, views creation, and replications works. Thant you @TomArbuckle for your help.

@mirohs
Copy link

mirohs commented Nov 27, 2017

I am using MacPorts, which has another installation directory for nspr: /opt/local/lib/nspr

To get CouchDB to work I manually copied the library files to: /usr/local/Cellar/nspr/4.17/lib

This works, but the approach is less than perfect. :-)

@lyudmil
Copy link

lyudmil commented Nov 28, 2017

@thgautier92, why has this issue been closed? Wouldn't people installing the CouchDB app for macOS still have problems if they just download it from the site? Has the app been patched, or are users expected to install nspr to have CouchDB work?

@martinleopold
Copy link

@lyudmil: Exactly. The packaging issue still persists. Manually installing a dependency is a temporary workaround at best. I think the issue should be reopened, no?

@daveismith
Copy link

I'm still getting this issue using just the downloaded couchdb app

@snollygolly
Copy link

The fix to install packages is great, but this issue surely shouldn't be closed. CouchDB doesn't work right out of the box without it, that can't be by design.

@koleto
Copy link

koleto commented Dec 10, 2017

It still doesn't work! Please reopen this issue!

@silverbackvasco
Copy link

silverbackvasco commented Dec 11, 2017

Could this issue be added to the documentation?

@martinleopold
Copy link

There is an open issue adressing this problem here: #1004

@bedney
Copy link

bedney commented Dec 18, 2017

Just got bit by this today (again...) on High Sierra.

I'm using the double-clickable Mac installer and especially for the user base that uses this, there is certainly an expectation that CouchDB is just going to work "out of the box".

@janl - is there a complexity here that is preventing this from being fixed? I'm willing to help test a fix for this. Please let me know if I can help! Thanks!

@koleto
Copy link

koleto commented Dec 18, 2017

Actually there is no working package on macOS Sierra anymore for both CouchDB 1.x and CouchDB 2.x ...

@cuddle-sujeet
Copy link

facing exactly the same issue with CouchDB 2.1.1. I can't create a new view.
[info] 2017-12-21T07:00:42.159819Z couchdb@localhost <0.218.0> -------- couch_proc_manager <0.27465.2> died normal

@ThibaultJanBeyer
Copy link

ThibaultJanBeyer commented Dec 24, 2017

This should be added to the documentation.
Please reopen this issue

@wohali
Copy link
Member

wohali commented Jan 16, 2018

Reopening issue because this is a packaging problem.

Workaround: brew install nspr

@wohali wohali reopened this Jan 16, 2018
@wohali wohali changed the title Error while create a view couchjs fails to run on High Sierra from binary package Jan 16, 2018
@janl
Copy link
Member

janl commented Jan 18, 2018

Thank you for your patience everybody. Could you all please give this a spin. And make sure to brew uninstall nspr (or brew unlink nspr) first:

http://jan.prima.de/u/Apache-CouchDB-2.1.1.zip

EDIT: Apologies, made a silly mistake here, new binary coming up in a few minutes.

@janl
Copy link
Member

janl commented Jan 18, 2018

New binary: http://jan.prima.de/u/Apache-CouchDB-2.1.1-fix2.zip

@lornajane
Copy link

This package fixes the problem for me. With nspr uninstalled, the build from the main website doesn't verify and can't create views. This build can do both of those and seems to be working well. Thanks!

@alleycat58uk
Copy link

Works for me too. Thanks

@bedney
Copy link

bedney commented Jan 25, 2018

LGTM Jan 👍 - thanks!

@janl
Copy link
Member

janl commented Jan 29, 2018

Thanks all for testing, deployed here: apache/couchdb-www@c7fc8fc

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

No branches or pull requests