CouchDB 2.1.1:内部服务器错误
Posted
技术标签:
【中文标题】CouchDB 2.1.1:内部服务器错误【英文标题】:CouchDB 2.1.1: Internal Server Error 【发布时间】:2018-02-09 17:19:27 【问题描述】:在安装 CouchApp 实用程序之前,the Sofa blog app and the sample DB myblogdb 和 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
第三,在创建/删除任何数据库时,我还在 Fauxton UI 中收到Internal Server Error
,但请求仍会被执行:
【问题讨论】:
您的 CouchDB 安装的是单节点还是多节点集群配置? 单节点。 拜托,你能检查一下会员资格并用结果更新你的帖子吗? http://"all_nodes":["couchdb@localhost"],"cluster_nodes":["couchdb@127.0.0.1","couchdb@localhost"]
那么我的答案是正确的。您应该尝试从那里删除错误的节点
【参考方案1】:
由于缺少集群仲裁,您似乎在创建/删除数据库时遇到了问题:Issue 603 和 Issue 1136。
您从 2.0 到 2.1.1 的迁移可能会对您的节点成员资格产生一些影响,现在您必须为节点注册一个为 couchdb@localhost,另一个为 couchdb@127.0.0.1
Couchdb 正在考虑将您的安装作为一个双节点集群,而您正面临缺乏仲裁的问题。
您可以使用这个网址http://<your-couchdb-host>:5984/_membership查看它
可以按照these 的说明删除配置中的错误节点。
【讨论】:
好了,问题解决了,还得把分片移到新节点http://docs.couchdb.org/en/2.1.1/cluster/sharding.html#cluster-sharding-move
以上是关于CouchDB 2.1.1:内部服务器错误的主要内容,如果未能解决你的问题,请参考以下文章