Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8B5F8E4BE for ; Tue, 8 Jan 2013 20:34:15 +0000 (UTC) Received: (qmail 94831 invoked by uid 500); 8 Jan 2013 20:34:14 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 94775 invoked by uid 500); 8 Jan 2013 20:34:14 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 94574 invoked by uid 99); 8 Jan 2013 20:34:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jan 2013 20:34:14 +0000 Date: Tue, 8 Jan 2013 20:34:14 +0000 (UTC) From: "Christopher Bonhage (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (COUCHDB-1639) doc_to_multi_part_stream does not include headers for attachments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Christopher Bonhage created COUCHDB-1639: -------------------------------------------- Summary: 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 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