Search code examples
couchdbinternal-server-errorcouchappcouchdb-2.0fauxton

CouchDB 2.1.1: Internal Server Error


Before installing the CouchApp utility, the Sofa blog app and the sample DB myblogdb together with CouchDB 2.1.1 my CouchDB was working find and I never seeing any Internal Server Error.

In the last 2 hours a trojan attached itself as a process to the CouchDB. Since then I removed it, but it might have jammed some of the CouchDB's settings.

Why can't I run myblogdb? Does this error have something to do with the breaking changes caused by upgrade to CouchDB 2.1.1?

Firstly, couchapp push myblogdb only works on second attempt (first attempt ends in Internal Server Error):

$ couchapp push . http://admin:[email protected]:5984/myblogdb 
2018-02-09 16:53:09 [CRITICAL] {"error":"error","reason":"internal_server_error"}
Traceback (most recent call last):
  File "/opt/bitnami/python/lib/python2.7/site-packages/Couchapp-1.0.2-py2.7.egg/couchapp/dispatch.py", line 45, in dispatch
    return _dispatch(args)
  File "/opt/bitnami/python/lib/python2.7/site-packages/Couchapp-1.0.2-py2.7.egg/couchapp/dispatch.py", line 92, in _dispatch
    return fun(conf, conf.app_dir, *args, **opts)
  File "/opt/bitnami/python/lib/python2.7/site-packages/Couchapp-1.0.2-py2.7.egg/couchapp/commands.py", line 72, in push
    dbs = conf.get_dbs(dest)
  File "/opt/bitnami/python/lib/python2.7/site-packages/Couchapp-1.0.2-py2.7.egg/couchapp/config.py", line 159, in get_dbs
    return [Database(dburl, use_proxy=use_proxy) for dburl in dburls]
  File "/opt/bitnami/python/lib/python2.7/site-packages/Couchapp-1.0.2-py2.7.egg/couchapp/client.py", line 229, in __init__
    self.res.put()
  File "/opt/bitnami/python/lib/python2.7/site-packages/restkit-4.2.2-py2.7.egg/restkit/resource.py", line 153, in put
    headers=headers, params_dict=params_dict, **params)
  File "/opt/bitnami/python/lib/python2.7/site-packages/Couchapp-1.0.2-py2.7.egg/couchapp/client.py", line 144, in request
    raise RequestFailed(str(e))
RequestFailed: {"error":"error","reason":"internal_server_error"}
$ couchapp push . http://admin:[email protected]:5984/myblogdb 
2018-02-09 16:53:29 [INFO] Visit your CouchApp here:
http://www.example.com:5984/myblogdb/_design/sofa/_list/index/recent-posts?descending=true&limit=10

Secondly, running the myblogdb couchapp from the web browser:

Internal Server Error in the browser

couchdb.log:

[info] 2018-02-09T14:58:13.538108Z [email protected] <0.1196.0> -------- Opening index for db: shards/00000000-1fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538160Z [email protected] <0.1197.0> -------- Opening index for db: shards/20000000-3fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538194Z [email protected] <0.1198.0> -------- Opening index for db: shards/40000000-5fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538241Z [email protected] <0.1199.0> -------- Opening index for db: shards/60000000-7fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538294Z [email protected] <0.1200.0> -------- Opening index for db: shards/80000000-9fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538347Z [email protected] <0.1201.0> -------- Opening index for db: shards/a0000000-bfffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538398Z [email protected] <0.1202.0> -------- Opening index for db: shards/c0000000-dfffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538516Z [email protected] <0.1204.0> -------- Opening index for db: shards/e0000000-ffffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[notice] 2018-02-09T14:58:13.553289Z [email protected] <0.1144.0> 4852bad0c5 www.example.com:5984 24.134.87.25 undefined GET /myblogdb/_design/sofa/
_list/index/recent-posts?descending=true&limit=10 200 ok 83
[notice] 2018-02-09T14:58:13.633626Z [email protected] <0.1144.0> c80a6bd94f www.example.com:5984 24.134.87.25 undefined GET /myblogdb/_design/sofa/
style/screen.css 304 ok 2
[notice] 2018-02-09T14:58:13.680109Z [email protected] <0.1145.0> 3c55f8327b www.example.com:5984 24.134.87.25 undefined GET /_utils/script/json2.js
 404 ok 4
[notice] 2018-02-09T14:58:13.680338Z [email protected] <0.1146.0> 40f287a33e www.example.com:5984 24.134.87.25 undefined GET /_utils/script/jquery.j
s 404 ok 3
[notice] 2018-02-09T14:58:13.688782Z [email protected] <0.1144.0> f5f10f59e3 www.example.com:5984 24.134.87.25 undefined GET /myblogdb/_design/sofa/
vendor/couchapp/jquery.couch.app.util.js 304 ok 2
[notice] 2018-02-09T14:58:13.693473Z [email protected] <0.1147.0> 75b14f5d9c www.example.com:5984 24.134.87.25 undefined GET /_utils/script/jquery.c
ouch.js 404 ok 0
[notice] 2018-02-09T14:58:13.708853Z [email protected] <0.1148.0> 38ec74b4cc www.example.com:5984 24.134.87.25 undefined GET /_utils/script/sha1.js
404 ok 0
[notice] 2018-02-09T14:58:13.721734Z [email protected] <0.1149.0> 2171a940fb www.example.com:5984 24.134.87.25 undefined GET /myblogdb/_design/sofa/
vendor/couchapp/jquery.couch.app.js 304 ok 2
[notice] 2018-02-09T14:58:13.727197Z [email protected] <0.1144.0> 43ab936b5a www.example.com:5984 24.134.87.25 undefined GET /myblogdb/_design/sofa/
vendor/couchapp/jquery.mustache.js 304 ok 2
[notice] 2018-02-09T14:58:13.738777Z [email protected] <0.1145.0> 74a548f8bf www.example.com:5984 24.134.87.25 undefined GET /myblogdb/_design/sofa/
vendor/couchapp/jquery.evently.js 304 ok 2
[notice] 2018-02-09T14:58:13.745487Z [email protected] <0.1146.0> b9bc18f69a www.example.com:5984 24.134.87.25 undefined GET /myblogdb/_design/sofa/
script/app.js 304 ok 2
[notice] 2018-02-09T14:58:13.750103Z [email protected] <0.1147.0> 79cd8480f0 www.example.com:5984 24.134.87.25 undefined GET /myblogdb/_design/sofa/
script/md5.js 304 ok 2

Thirdly, I also receive Internal Server Error in Fauxton UI when creating/deleting any databases, but the request still gets executed:

Internal Server Error when creating/deleting databases


Solution

  • It seems you are facing an issue in database creation/deletion due to a lack of cluster quorum: Issue 603 and Issue 1136.

    Probably your migration from 2.0 to 2.1.1 has some effect in the membership of your node and now you have to nodes registered one for couchdb@localhost and another one for [email protected]

    Couchdb is considering your instalation as a two-node cluster and you are facing the lack of quorum issues.

    You can check it by using this URL http://<your-couchdb-host>:5984/_membership

    It is possible to remove the wrong node in your config by follwing these instructions.