CouchDB 2.1.1:内部服务器错误

CouchDB 2.1.1: Internal Server Error

在安装 CouchApp utility, the Sofa blog app and the sample DB myblogdb together with CouchDB 2.1.1 之前,我的 CouchDB 正在运行,但我从未看到任何 Internal Server Error

在过去的 2 小时内,一个特洛伊木马作为一个进程附加到 CouchDB。从那以后我删除了它,但它可能会干扰一些 CouchDB 的设置。

为什么我不能 运行 myblogdb?此错误是否与升级到 CouchDB 2.1.1 导致的重大更改有关?

首先,couchapp push myblogdb 仅在第二次尝试时有效(第一次尝试在 Internal Server Error 结束):

$ couchapp push . http://admin:password@www.example.com: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:password@www.example.com: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

其次,运行从网络浏览器打开 myblogdb couchapp:

couchdb.log:

[info] 2018-02-09T14:58:13.538108Z couchdb@127.0.0.1 <0.1196.0> -------- Opening index for db: shards/00000000-1fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538160Z couchdb@127.0.0.1 <0.1197.0> -------- Opening index for db: shards/20000000-3fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538194Z couchdb@127.0.0.1 <0.1198.0> -------- Opening index for db: shards/40000000-5fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538241Z couchdb@127.0.0.1 <0.1199.0> -------- Opening index for db: shards/60000000-7fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538294Z couchdb@127.0.0.1 <0.1200.0> -------- Opening index for db: shards/80000000-9fffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538347Z couchdb@127.0.0.1 <0.1201.0> -------- Opening index for db: shards/a0000000-bfffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538398Z couchdb@127.0.0.1 <0.1202.0> -------- Opening index for db: shards/c0000000-dfffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[info] 2018-02-09T14:58:13.538516Z couchdb@127.0.0.1 <0.1204.0> -------- Opening index for db: shards/e0000000-ffffffff/myblogdb.1518183029 idx: _design
/sofa sig: "0076c771c527a85eec3100fde6e69853"
[notice] 2018-02-09T14:58:13.553289Z couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <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 couchdb@127.0.0.1 <0.1147.0> 79cd8480f0 www.example.com:5984 24.134.87.25 undefined GET /myblogdb/_design/sofa/
script/md5.js 304 ok 2

第三,当 creating/deleting 任何数据库时,我也在 Fauxton UI 收到 Internal Server Error,但请求仍然得到执行:

由于缺少集群仲裁,您似乎在数据库 creation/deletion 中遇到了问题:Issue 603 and Issue 1136

可能您从 2.0 迁移到 2.1.1 对您的节点成员有一些影响,现在您必须为节点注册一个 couchdb@localhost,另一个注册 couchdb@127.0.0.1

Couchdb 正在考虑将您安装为双节点集群,而您正面临法定人数不足的问题。

你可以用这个URLhttp://<your-couchdb-host>:5984/_membership

检查一下

可以按照 these 说明删除配置中的错误节点。