Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
None
-
None
Description
I started a push replication job that contained a document with image attachments and noticed that the replication job was taking far too long, so I dug into the logs and found the culprit:
[Tue, 08 Jan 2013 05:28:45 GMT] [error] [emulator] Error in process <0.22592.0> with exit value: badmatch,{[137,80,78,71],[],[
{couch_httpd,split_header,1},
{couch_httpd,'-parse_part_header/1-fun-1-',2},
{lists,foldl,3},
{couch_httpd,parse_part_header,1},
{couch_httpd,parse_multipart_request,3},{couch_doc,'doc_from_multi_part_stream/2-fun-1'...
I was able to deduce that the
{[137,80,78,71],[]}that split_header was encountering while trying to parse_part_header was actually the (partial) body of the attachment! After adding some logging to confirm my suspicions I discovered that CouchDB does not appear to be sending MIME multipart/related headers for attachments (only the application/json for the doc itself) when converting a document to a multipart stream, which is causing the problem.
Attachments
Attachments
Issue Links
- duplicates
-
COUCHDB-1368 multipart/related document body doesn't identify which part is which attachment
-
- Resolved
-