我最近开始将 couchdb 与 python-couchdb 一起使用。问题是当我使用 futon 运行用 python 编写的 View 时,我收到以下错误消息:
错误:os_process_error
{exit_status,1}
即使对于默认 View 也会崩溃。
def fun(doc):
yield None, doc
我还没有找到关于这个问题的太多信息,所以此时我真的迷失了。这是我从 couchdb 获得的日志:
{<0.3907.0>,crash_report,
[[{initial_call,{couch_file,init,['Argument__1']}},
{pid,<0.3907.0>},
{registered_name,[]},
{error_info,
{exit,
{os_process_error,{exit_status,1}},
[{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}},
{ancestors,
[<0.3906.0>,couch_view,couch_secondary_services,couch_server_sup,
<0.33.0>]},
{messages,[]},
{links,[#Port<0.1483>,<0.3910.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,377},
{stack_size,24},
{reductions,1423}],
[{neighbour,
[{pid,<0.3910.0>},
{registered_name,[]},
{initial_call,{couch_ref_counter,init,['Argument__1']}},
{current_function,{gen_server,loop,6}},
{ancestors,
[<0.3906.0>,couch_view,couch_secondary_services,
couch_server_sup,<0.33.0>]},
{messages,[]},
{links,[#Port<0.1483>,<0.3910.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,377},
{stack_size,24},
{reductions,1423}],
[{neighbour,
[{pid,<0.3910.0>},
{registered_name,[]},
{initial_call,{couch_ref_counter,init,['Argument__1']}},
{current_function,{gen_server,loop,6}},
{ancestors,
[<0.3906.0>,couch_view,couch_secondary_services,
couch_server_sup,<0.33.0>]},
{messages,
[{'DOWN',#Ref<0.0.0.16475>,process,<0.3906.0>,
{os_process_error,{exit_status,1}}}]},
{links,[<0.3907.0>]},
{dictionary,[]},
{trap_exit,false},
{status,runnable},
{heap_size,233},
{stack_size,9},
{reductions,47}]}]]}}
我在 Ubuntu 10.04 上运行这个程序,使用 Django、couchdb 和 python-couchdb。 javascript 上的 View 工作正常。
最佳答案
对于 couchdb-python 查询服务器退出状态 1 意味着出现一些错误。
您使用的 couchdb/couchdb-python 版本是什么?
如果直接从命令行运行 couchpy(或/usr/local/bin/couchpy 或在 query_servers 部分为 python 键设置的任何内容),输出将会是什么?示例应该是:
$
~ $ couchpy
["reset"]
true
["add_fun", "def fun(doc): yield None, None"]
true
["map_doc", {}]
[[[null, null]]]
如果 p.2 工作正常,请尝试启用 CouchDB 调试日志级别来跟踪查询服务器命令并注意它何时下降。如果你确定这是一个Python查询服务器错误,请写一些story关于它。谢谢(:
附注我希望你有setup python 正确查询服务器,但双重检查从来没有用(;
关于python - 无法在 Couchdb 上运行 Python View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9813862/