Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-551

couch_log crashes when external process returns status code as string

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.11
    • 0.11
    • Infrastructure
    • None
    • CentOS 5.3, Erlang R12

    Description

      When an external process returns a value, the couch_log process crashes.

      A couchdb external process is created which returns well formed json as identified below. Whenever the process' url is accessed, couchdb correctly returns the result, however, the couch_log process crashes (log below).

      To replicate this, setup an external process and make a call to it using the mapped url.

      This has been observed on CentOS 5.3 with the most recent version of the 0.10 branch, using a java external process as described below. Similar behavior has also been observed on Ubuntu 9.10 using a php external process (log not included).

      External Program Input: { "path":[],"query":

      {"hello":"world","abc":123}

      ,"verb":"GET" }
      External Program Output: {"headers":

      {"content-type":"text/plain"}

      ,"json":

      {"hello":"world","abc":123}

      ,"code":"200"}
      Couchdb URL: .../_exj?hello=world&abc=123
      Couchdb Response:

      {"hello":"world","abc":"123"}
              • Log *****
                Apache CouchDB 0.10.0 (LogLevel=info) is starting.
                Apache CouchDB has started. Time to relax.
                [info] [<0.1.0>] Apache CouchDB has started on http://127.0.0.1:5984/
                [info] [<0.73.0>] EXTERNAL: Starting process for: exj
                [info] [<0.73.0>] COMMAND: /usr/bin/java -cp /root/geoc externalj

      =ERROR REPORT==== 1-Nov-2009::23:44:24 ===

        • gen_event handler couch_log crashed.
        • Was installed in error_logger
        • Last event was: {info_report,<0.22.0>,
          Unknown macro: {<0.60.0>,couch_info, {"~s - - ~p ~s ~B", ["72.211.148.58",'GET', "/airport_data/_exj?hello=world&abc=123", <<"200">>]}}

          }

        • When handler state == {<0.46.0>,2}
        • Reason ==
          Unknown macro: {badarg,[{io_lib,format, ["~s - - ~p ~s ~B", ["72.211.148.58",'GET', "/airport_data/_exj?hello=world&abc=123", <<"200">>]]}, {couch_log,log,5},
          {couch_log,handle_event,2},
          {gen_event,server_update,4},
          {gen_event,server_notify,4},
          {gen_event,handle_msg,5},
          {proc_lib,init_p_do_apply,3}]}

          =ERROR REPORT==== 1-Nov-2009::23:44:24 ===
          ** Generic server couch_log terminating
          ** Last message in was {gen_event_EXIT,couch_log,
          {'EXIT',
          {badarg,
          [{io_lib,format, ["~s - - ~p ~s ~B", ["72.211.148.58",'GET', "/airport_data/_exj?hello=world&abc=123", <<"200">>]]},
          {couch_log,log,5}, {couch_log,handle_event,2},
          {gen_event,server_update,4},
          {gen_event,server_notify,4},
          {gen_event,handle_msg,5},
          {proc_lib,init_p_do_apply,3}]}}}
          ** When Server state == {error_logger,couch_log}
          ** Reason for termination ==
          ** {'EXIT',{badarg,[{io_lib,format, ["~s - - ~p ~s ~B", ["72.211.148.58",'GET', "/airport_data/_exj?hello=world&abc=123", <<"200">>]]},
          {couch_log,log,5},
          {couch_log,handle_event,2}, {gen_event,server_update,4}, {gen_event,server_notify,4}, {gen_event,handle_msg,5}, {proc_lib,init_p_do_apply,3}]}

          }

      Attachments

        1. ExternalProcesses.txt
          4 kB
          Christopher O'Connell

        Activity

          People

            kocolosk Adam Kocoloski
            whiteside Christopher O'Connell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: