Re: problem getting couchpy working on debian - {os_process_error, {exit_status,2}}

123 views
Skip to first unread message

Steve Ross

unread,
Nov 12, 2012, 9:38:10 AM11/12/12
to CouchDB-Python
Probably not the best place to get support on building couch but, I've found that this is the most useful way of building it:


The only problem with using the link above is if you want couch to run as the current user and not require sudo you need to edit the build-couchdb/build/etc/init.d/couchdb shell script

and comment out (this removes the su )
#if test -n "$COUCHDB_USER"; then
#    if su $COUCHDB_USER -c "$command"; then
#        return $SCRIPT_OK
#    else
#        return $SCRIPT_ERROR
#    fi
#else
...
...
#fi



On Mon, Nov 12, 2012 at 2:45 AM, Brenda Moon <bre...@moon.net.au> wrote:
Hello,

I've just installed couchdb 1.2 on debian squeeze 6.0.5 and copied a small test database across from my OS X computer. The javascript view queries run correctly in futon. I've installed couchdb python and can import it in python:

>>> import couchdb
>>> print couchdb.__version__
0.8

Versions of python and erlang:  Python 2.6.6 and Erlang R15B02 (erts-5.9.2) .

I added python=/usr/bin/couchpy in the query_servers section of the configuration using futon.

In futon, I go to temporary view and see the python option, but when I try to run the default python view I get no response, and errors in the log file - {os_process_error, {exit_status,2}}

I tried saving the view, and it didn't change the problem.
[Mon, 12 Nov 2012 06:33:16 GMT] [info] [<0.126.0>] 127.0.0.1 - - GET /_utils/database.html?tweets-test/_design/testPython/_view/test 200
[Mon, 12 Nov 2012 06:33:17 GMT] [info] [<0.126.0>] 127.0.0.1 - - GET /tweets-test/_all_docs?startkey=%22_design%2F%22&endkey=%22_design0%22
&include_docs=true 304
[Mon, 12 Nov 2012 06:33:17 GMT] [info] [<0.125.0>] 127.0.0.1 - - GET /tweets-test/_design/testPython 304
[Mon, 12 Nov 2012 06:33:17 GMT] [error] [<0.188.0>] OS Process Error <0.200.0> :: {os_process_error,
                                                   {exit_status,2}}
[Mon, 12 Nov 2012 06:33:17 GMT] [error] [<0.188.0>] OS Process Error <0.206.0> :: {os_process_error,
                                                   {exit_status,2}}
 
There are a lot of the OS Process Errors and then this:
 
[Mon, 12 Nov 2012 06:33:17 GMT] [info] [<0.126.0>] 127.0.0.1 - - GET /_config/query_servers/ 401
[Mon, 12 Nov 2012 06:33:17 GMT] [info] [<0.140.0>] 127.0.0.1 - - GET /_session 200
[Mon, 12 Nov 2012 06:33:17 GMT] [error] [<0.242.0>] ** Generic server <0.242.0> terminating 
** Last message in was {prompt,[<<"reset">>,
                                {[{<<"reduce_limit">>,true},
                                  {<<"timeout">>,5000}]}]}
** When Server state == {os_proc,"/usr/bin/couchpy",#Port<0.2611>,
                                 #Fun<couch_os_process.2.55582190>,
                                 #Fun<couch_os_process.3.55582190>,5000}
** Reason for termination == 
** {badarg,[{erlang,port_command,
                    [#Port<0.2611>,
                     [<<"[\"reset\",{\"reduce_limit\":true,\"timeout\":5000}]">>,
                      10]],
                    []},
            {couch_os_process,writeline,2,
                              [{file,"couch_os_process.erl"},{line,63}]},
            {couch_os_process,writejson,2,
                              [{file,"couch_os_process.erl"},{line,93}]},
            {couch_os_process,handle_call,3,
                              [{file,"couch_os_process.erl"},{line,183}]},
            {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,588}]},
            {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
[Mon, 12 Nov 2012 06:33:17 GMT] [error] [<0.242.0>] {error_report,<0.31.0>,
                     {<0.242.0>,crash_report,
                      [[{initial_call,{couch_os_process,init,['Argument__1']}},
                        {pid,<0.242.0>},
                        {registered_name,[]},
                        {error_info,
                         {exit,
                          {badarg,
                           [{erlang,port_command,
                             [#Port<0.2611>,
                              [<<"[\"reset\",{\"reduce_limit\":true,\"timeout\":5000}]">>,
                               10]],
                             []},
                            {couch_os_process,writeline,2,
                             [{file,"couch_os_process.erl"},{line,63}]},
                            {couch_os_process,writejson,2,
                             [{file,"couch_os_process.erl"},{line,93}]},
                            {couch_os_process,handle_call,3,
                             [{file,"couch_os_process.erl"},{line,183}]},
                            {gen_server,handle_msg,5,
                             [{file,"gen_server.erl"},{line,588}]},
                            {proc_lib,init_p_do_apply,3,
                             [{file,"proc_lib.erl"},{line,227}]}]},
                          [{gen_server,terminate,6,
                            [{file,"gen_server.erl"},{line,747}]},
                           {proc_lib,init_p_do_apply,3,
                            [{file,"proc_lib.erl"},{line,227}]}]}},
                        {ancestors,
                         [couch_query_servers,couch_secondary_services,
                          couch_server_sup,<0.32.0>]},
                        {messages,[{#Port<0.2611>,{exit_status,2}}]},
                        {links,[<0.118.0>]},
                        {dictionary,[]},
                        {trap_exit,false},
                        {status,running},
                        {heap_size,610},
                        {stack_size,24},
                        {reductions,320}],
                       []]}}
[Mon, 12 Nov 2012 06:33:17 GMT] [error] [<0.248.0>] OS Process died with status: 2
[Mon, 12 Nov 2012 06:33:17 GMT] [error] [<0.248.0>] ** Generic server <0.248.0> terminating 
** Last message in was {#Port<0.2620>,{exit_status,2}}
** When Server state == {os_proc,"/usr/bin/couchpy",#Port<0.2620>,
                                 #Fun<couch_os_process.2.55582190>,
                                 #Fun<couch_os_process.3.55582190>,5000}
** Reason for termination == 
** {exit_status,2}
Can anyone suggest what I can try or look at to work out why it isn't working?

thanks,

Brenda
 

--
You received this message because you are subscribed to the Google Groups "CouchDB-Python" group.
To view this discussion on the web visit https://groups.google.com/d/msg/couchdb-python/-/6uMYxpeXkvsJ.
To post to this group, send email to couchdb...@googlegroups.com.
To unsubscribe from this group, send email to couchdb-pytho...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/couchdb-python?hl=en.



--
Steve Ross
web application & interface developer
http://blog.stevensross.com
[mobile] (912) 344-8113
[ AIM / Yahoo! : zeriumsteven ] [googleTalk : nowhiding ]

Alexander Shorin

unread,
Nov 12, 2012, 10:32:37 AM11/12/12
to couchdb...@googlegroups.com
Hi Brenda!

Thanks for detailed info and sorry for late response!

But I'm wondering about problem. Looks like query server fails on message:

["reset",{"reduce_limit":true,"timeout":5000}]

Have you tried to pass it manually to couchpy? There should be next scene:

$ /usr/bin/couchpy
["reset",{"reduce_limit":true,"timeout":5000}]↵
true

or Python traceback instead. But I wonder why couchpy process dies
with exit status 2 - it should exit only with 0 or 1 status. Normally.

May you also enable debug logs? Just modify query server config value
to next one:

python=/usr/bin/couchpy --debug --log-file=/var/log/couchdb/couchpy.log

Will be there something interesting in logs?

Also, does JavaScript one works fine? But I'm not sure that this is
global problem...

Currently that's all what I have - I'd repeat all your steps, but
failed to reproduce such problem. Hoping that you could get more info
to help figure out where is the problem.


--
,,,^..^,,,
Reply all
Reply to author
Forward
0 new messages