couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Newson (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (COUCHDB-1639) doc_to_multi_part_stream does not include headers for attachments
Date Tue, 08 Jan 2013 21:16:13 GMT

     [ https://issues.apache.org/jira/browse/COUCHDB-1639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Robert Newson resolved COUCHDB-1639.
------------------------------------

    Resolution: Duplicate

sample output from couchdb after the 1368 patch;

< HTTP/1.1 200 OK
< Server: CouchDB/1.4.0a-78147f5-git (Erlang OTP/R15B03)
< ETag: "1-187b37c95cbd8e4f10ed831ea921939b"
< Date: Tue, 08 Jan 2013 21:14:30 GMT
< Content-Type: multipart/related; boundary="8025b86d46e3275d023e5fced1984ee4"
< Content-Length: 483
< 
--8025b86d46e3275d023e5fced1984ee4
Content-Type: application/json

{"_id":"doc1","_rev":"1-187b37c95cbd8e4f10ed831ea921939b","_attachments":{"att1":{"content_type":"application/x-www-form-urlencoded","revpos":1,"digest":"md5-ixqZU8RhEpaoJ6v4xHgE1w==","length":5,"follows":true}}}
--8025b86d46e3275d023e5fced1984ee4
Content-Disposition: attachment; filename="att1"
Content-Type: application/x-www-form-urlencoded
Content-Length: 5

Hello

                
> doc_to_multi_part_stream does not include headers for attachments
> -----------------------------------------------------------------
>
>                 Key: COUCHDB-1639
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1639
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core, Replication
>            Reporter: Christopher Bonhage
>         Attachments: 0001-Fix-multipart-attachments-headers.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message