couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Edin (JIRA)" <>
Subject [jira] Created: (COUCHDB-822) body_too_large error for external processes, when body is 3MB
Date Thu, 08 Jul 2010 19:55:51 GMT
body_too_large error for external processes, when body is 3MB

                 Key: COUCHDB-822
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
    Affects Versions: 0.11
         Environment: CouchDB 0.11 on Ubuntu 10.04,
            Reporter: Erik Edin
            Priority: Minor

I have a photo which is around 3 MB that I'm trying to PUT to an external process on the CouchDB
database. The external process is called "_upload".
I get an uncaught error "{exit,{body_too_large,content_length}}" in the logs when trying this.
Smaller photos (around 60 kB) seem to work just fine.
This just happens with external processes. I can upload the photo as an attachment directly
to a document, with no problems.

The error is similar to an earlier bug in the mochiweb library that was fixed around Feb 2009,
where mochiweb never used the "max_document_size" setting that was provided when calling mochiweb_request:recv_body.

I believe, supported by the stack trace below, that the cause for this bug is that in couch_httpd_external:json_req_obj
the function mochiweb_request:recv_body/0 is called, which uses the mochiweb default value
on MaxBody, which is 1 MB.
I think that couch_httpd_external:json_req_obj should call mochiweb_request:recv_body/1 instead,
with the "max_document_size" setting as the argument.

Unfortunately I was unable to patch it myself directly, probably due to my rusty Erlang skills.

Here are the error logs from one of my attempts:

[Thu, 08 Jul 2010 18:49:53 GMT] [debug] [<0.3738.0>] 'PUT' /pillowfight/_upload/6b1908c352129ddda396fa69ac003d11
Headers: [{'Accept',"*/*"},
          {'User-Agent',"curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/

[Thu, 08 Jul 2010 18:49:53 GMT] [debug] [<0.3738.0>] OAuth Params: []

[Thu, 08 Jul 2010 18:49:53 GMT] [error] [<0.3738.0>] Uncaught error in HTTP request:

[Thu, 08 Jul 2010 18:49:53 GMT] [info] [<0.3738.0>] Stacktrace: [{mochiweb_request,stream_body,5},

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message