On Jun 22, 2009, at 4:11 AM, Brian Candler wrote:
On Thu, Jun 18, 2009 at 11:23:35PM -0500, Curt Arnold wrote:
The problem only appears to occur in POST requests with multiple
keys.
I've added fallback behavior to my app to request the same data key
by
key which will work around the 500 error that occurs on the POST
request.
Does the 500 error return any message in the body? You may be able to
capture this using tcpdump. It may give a clue as to what's going on.
If you are using CouchRest, the RestClient exception raised hides
this body
by default, but it is possible to capture it. Try something like this:
begin
...
rescue RestClient::ExceptionWithResponse => e
resp = e.response
STDERR.puts "#{resp.code} #{resp.message} #{resp.body}"
end
Also look in the couchdb log, usually under /usr/local/var/log/
couchdb/, to
see if there's any detail in there.
The original post contained the CouchDB a representative section of
couch.log, repeating part of it here:
[Thu, 18 Jun 2009 01:22:59 GMT] [info] [<0.1180.84>] 127.0.0.1 - -
'GET' /loaded/_design/query/_view/byURI?
include_docs=true;key=[omitted] 304
[Thu, 18 Jun 2009 01:23:09 GMT] [error] [<0.1178.84>] Uncaught error
in HTTP request: {exit,normal}
[Thu, 18 Jun 2009 01:23:09 GMT] [debug] [<0.1178.84>] Stacktrace:
[{mochiweb_request,recv,3},
{mochiweb_request,stream_unchunked_body,5},
{mochiweb_request,recv_body,2},
{couch_httpd,json_body,1},
{couch_httpd,json_body_obj,1},
{couch_httpd_view,handle_view_req,2},
{couch_httpd_db,do_db_req,2},
{couch_httpd,handle_request,5}]
[Thu, 18 Jun 2009 01:23:09 GMT] [debug] [<0.1178.84>] httpd 500 error
response:
{"error":"unknown_error","reason":"normal"}
[Thu, 18 Jun 2009 01:23:09 GMT] [info] [<0.1178.84>] 127.0.0.1 - -
'POST' /loaded/_design/query/_view/byURI?include_docs=true 500