【问题标题】:Cant run Python Views on Couchdb无法在 Couchdb 上运行 Python 视图
【发布时间】:2012-03-22 23:02:56
【问题描述】:

我最近开始使用 couchdb 和 python-couchdb。问题是当我使用蒲团运行我用 python 编写的视图时,我收到以下错误消息:

错误:os_process_error

{exit_status,1}

即使是默认视图也会崩溃。

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 上的视图工作正常。

【问题讨论】:

    标签: python django couchdb


    【解决方案1】:

    对于 couchdb-python 查询服务器退出状态 1 意味着一些错误。

    1. 您使用的是什么版本的 couchdb/couchdb-python?

    2. 如果您直接从命令行运行 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 查询服务器,但是双重检查从来没有用过(;

    【讨论】:

    • 嗨,我遇到了字符编码问题,正在解决它。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-07-23
    • 2015-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-12
    • 1970-01-01
    相关资源
    最近更新 更多