rnewson/couchdb-lucene — Issue #144: couchdb-external-hook.py problem
Author: cmadsen
Created: 2011-11-29 09:43:09+00:00
State: open

I have a problem with the couchdb-external-hook.py

curl 'http://localhost:5984'
{"couchdb":"Welcome","version":"1.0.2"}
curl 'http://localhost:5985'
{"couchdb-lucene":"Welcome","version":"0.8.0-SNAPSHOT"}
uname -a
Linux localhost 2.6.41.1-1.fc15.i686

When it is called by couchdb I get a HTTP 500 error. However if I past the input into couchdb-external-hook.py I get a correct answer back.

python couchdb-external-hook.py
{"info":{"db_name":"test","doc_count":1,"doc_del_count":0,"update_seq":2,"purge_seq":0,"compact_running":false,"disk_size":8281,"instance_start_time":"1322557480255446","disk_format_version":5,"committed_update_seq":2},"id":null,"uuid":"9f1acbe7d7da6fbc05aeba79fc002485","method":"GET","path":["test","_fti","_design","lucene","by_title"],"query":{"q":"First"},"headers":{"Accept":"*/*","Host":"localhost:5984","User-Agent":"curl/7.21.3 (i386-redhat-linux-gnu) libcurl/7.21.3 NSS/3.12.10.0 zlib/1.2.5 libidn/1.19 libssh2/1.2.7"},"body":"undefined","peer":"127.0.0.1","form":{},"cookie":{},"userCtx":{"db":"test","name":null,"roles":[]}}
{"body": "{\"limit\":25,\"etag\":\"7812bf25071\",\"fetch_duration\":0,\"q\":\"default:first\",\"search_duration\":6,\"total_rows\":0,\"skip\":0,\"rows\":[]}", "headers": {"ETag": "7812bf25071", "Content-Type": "text/plain; charset=utf-8"}, "code": 200}

Any hints?

[Tue, 29 Nov 2011 09:31:31 GMT] [debug] [<0.127.0>] OAuth Params: [{"q","First"}]

[Tue, 29 Nov 2011 09:31:31 GMT] [info] [<0.212.0>] EXTERNAL: Starting process for: fti

[Tue, 29 Nov 2011 09:31:31 GMT] [info] [<0.212.0>] COMMAND: python /opt/couchdb-lucene-0.8.0/tools/couchdb
-external-hook.py

[Tue, 29 Nov 2011 09:31:31 GMT] [debug] [<0.213.0>] OS Process Start :: #Port<0.2374>

[Tue, 29 Nov 2011 09:31:31 GMT] [debug] [<0.213.0>] OS Process #Port<0.2374> Input :: {"info":{"db_name":
"test","doc_count":1,"doc_del_count":0,"update_seq":2,"purge_seq":0,"compact_running":false,"disk_size":12
379,"instance_start_time":"1322559042049515","disk_format_version":5,"committed_update_seq":2},"id":null,"
uuid":"5f220e4b859913543f718c8f9100199f","method":"GET","path":["test","_fti","_design","lucene","by_title
"],"query":{"q":"First"},"headers":{"Accept":"*/*","Host":"localhost:5984","User-Agent":"curl/7.21.3 (i386
-redhat-linux-gnu) libcurl/7.21.3 NSS/3.12.10.0 zlib/1.2.5 libidn/1.19 libssh2/1.2.7"},"body":"undefined",
"peer":"127.0.0.1","form":{},"cookie":{},"userCtx":{"db":"test","name":null,"roles":[]}}

[Tue, 29 Nov 2011 09:31:31 GMT] [error] [<0.212.0>] OS Process Error <0.213.0> :: {os_process_error,{exit_
status,2}}

[Tue, 29 Nov 2011 09:31:31 GMT] [error] [<0.212.0>] ** Generic server <0.212.0> terminating
** Last message in was {execute,
{[{<<"info">>,
{[{db_name,<<"test">>},
{doc_count,1},
{doc_del_count,0},
{update_seq,2},
{purge_seq,0},
{compact_running,false},
{disk_size,12379},
{instance_start_time,<<"1322559042049515">>},
{disk_format_version,5},
{committed_update_seq,2}]}},
{<<"id">>,null},
{<<"uuid">>,
<<"5f220e4b859913543f718c8f9100199f">>},
{<<"method">>,'GET'},
{<<"path">>,
[<<"test">>,<<"_fti">>,<<"_design">>,
<<"lucene">>,<<"by_title">>]},
{<<"query">>,{[{<<"q">>,<<"First">>}]}},
{<<"headers">>,
{[{<<"Accept">>,<<"*/*">>},
{<<"Host">>,<<"localhost:5984">>},
{<<"User-Agent">>,
<<"curl/7.21.3 (i386-redhat-linux-gnu) libcurl/7.21.3 NSS/3.12.10.0 zlib/
1.2.5 libidn/1.19 libssh2/1.2.7">>}]}},
{<<"body">>,undefined},
{<<"peer">>,<<"127.0.0.1">>},
{<<"form">>,{[]}},
{<<"cookie">>,{[]}},
{<<"userCtx">>,
{[{<<"db">>,<<"test">>},
{<<"name">>,null},
{<<"roles">>,[]}]}}]}}
** When Server state == {"fti",
"python /opt/couchdb-lucene-0.8.0/tools/couchdb-external-hook.py",
<0.213.0>}
** Reason for termination ==
** {bad_return_value,{os_process_error,{exit_status,2}}}
[Tue, 29 Nov 2011 09:31:31 GMT] [error] [<0.212.0>] {error_report,<0.31.0>,
{<0.212.0>,crash_report,
[[{initial_call,{couch_external_server,init,['Argument__1']}},
{pid,<0.212.0>},
{registered_name,[]},
{error_info,
{exit,
{bad_return_value,{os_process_error,{exit_status,2}}},
[{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}},
{ancestors,
[couch_external_manager,couch_secondary_services,couch_server_sup,
<0.32.0>]},
{messages,[{'EXIT',<0.213.0>,normal}]},
{links,[<0.161.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,987},
{stack_size,24},
{reductions,226}],
[]]}}

[Tue, 29 Nov 2011 09:31:31 GMT] [error] [<0.127.0>] Uncaught error in HTTP request: {exit,
{{bad_return_value,
{os_process_error,{exit_status,2}}},
{gen_server,call,
[<0.212.0>,
{execute,
{[{<<"info">>,
{[{db_name,<<"test">>},
{doc_count,1},
{doc_del_count,0},
{update_seq,2},
{purge_seq,0},
{compact_running,false},
{disk_size,12379},
{instance_start_time,
<<"1322559042049515">>},
{disk_format_version,5},
{committed_update_seq,2}]}},
{<<"id">>,null},
{<<"uuid">>,
<<"5f220e4b859913543f718c8f9100199f">>},
{<<"method">>,'GET'},
{<<"path">>,
[<<"test">>,<<"_fti">>,<<"_design">>,
<<"lucene">>,<<"by_title">>]},
{<<"query">>,{[{<<"q">>,<<"First">>}]}},
{<<"headers">>,
{[{<<"Accept">>,<<"*/*">>},
{<<"Host">>,<<"localhost:5984">>},
{<<"User-Agent">>,
<<"curl/7.21.3 (i386-redhat-linux-gnu) libcurl/7.21.3 NSS/3.12.10.0 zlib/1.2.5 libidn/1.19 libssh2/1.2.7">>}]}},
{<<"body">>,undefined},
{<<"peer">>,<<"127.0.0.1">>},
{<<"form">>,{[]}},
{<<"cookie">>,{[]}},
{<<"userCtx">>,
{[{<<"db">>,<<"test">>},
{<<"name">>,null},
{<<"roles">>,[]}]}}]}},
infinity]}}}
[Tue, 29 Nov 2011 09:31:31 GMT] [info] [<0.161.0>] EXTERNAL: Server <0.212.0> died. (reason: {bad_return_value,
{os_process_error,{exit_status,2}}})

[Tue, 29 Nov 2011 09:31:31 GMT] [info] [<0.127.0>] Stacktrace: [{gen_server,call,3},
{couch_httpd_external,process_external_req,3},
{couch_httpd_db,do_db_req,2},
{couch_httpd,handle_request_int,5},
{mochiweb_http,headers,5},
{proc_lib,init_p_do_apply,3}]

[Tue, 29 Nov 2011 09:31:31 GMT] [error] [<0.86.0>] {error_report,<0.31.0>,
{<0.86.0>,supervisor_report,
[{supervisor,{local,couch_secondary_services}},
{errorContext,child_terminated},
{reason,normal},
{offender,[{pid,<0.161.0>},
{name,external_manager},
{mfargs,{couch_external_manager,start_link,[]}},
{restart_type,permanent},
{shutdown,1000},
{child_type,worker}]}]}}