Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-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 9C3DCF2BB for ; Mon, 22 Apr 2013 05:33:33 +0000 (UTC) Received: (qmail 62181 invoked by uid 500); 22 Apr 2013 05:33:32 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 61928 invoked by uid 500); 22 Apr 2013 05:33:29 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 61888 invoked by uid 99); 22 Apr 2013 05:33:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Apr 2013 05:33:27 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jevon@jevon.org designates 50.116.3.249 as permitted sender) Received: from [50.116.3.249] (HELO jevon.org) (50.116.3.249) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Apr 2013 05:33:20 +0000 To: dev@chemistry.apache.org Date: Sun, 21 Apr 2013 22:32:09 -0700 Subject: Re: Invalid chunk header when replacing Document contents Envelope-To: dev@chemistry.apache.org References: Message-ID: From: "jevon" Received: from mail-oa0-f46.google.com (mail-oa0-f46.google.com [209.85.219.46]) by jevon.org; Sun, 21 Apr 2013 22:32:11 -0700 Received: by mail-oa0-f46.google.com with SMTP id k3so2894314oag.33 for ; Sun, 21 Apr 2013 22:32:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=BvWuuuWv8Xku9C6hYomb0vo8bRxiBRUawkF2yC2ZwNg=; b=jbh0Ua0pvLrMVKrpbuapnq0lOF2Ibtd7WNaHYxbOJBdqKcvq/wOXIW7g6OjF7f1i9+ B+sDet6VSRO1kpDJMU8hyPq73qCaYAgOL4j+9n4ZetHvYtYADku93USQ8SeYFHqqyBfv QDJyTmNAo4sYK+fCrTaKBYKa/1m43Ufyu2vpMZA6Yx4QsM7IycdxZE8yU8r7xifiewea E+3K47lWpVQb7b335/4I0owkjTBlSxrB1S3KLT15Z4tM5ZCt3obhBpvgvjggZJzHdTEW TvcRVaNerwpBb9VwwR/c+HP1oXU8rA7TuDkxL4tlpYr1AOud6c5o1LXKp/dV+M8JvptX KLbg== MIME-Version: 1.0 X-Received: by 10.60.57.35 with SMTP id f3mr10591941oeq.33.1366608729798; Sun, 21 Apr 2013 22:32:09 -0700 (PDT) Received: by 10.60.10.193 with HTTP; Sun, 21 Apr 2013 22:32:09 -0700 (PDT) Content-Type: multipart/alternative; boundary=089e0149cd2ce3013d04daec6340 X-Virus-Checked: Checked by ClamAV on apache.org --089e0149cd2ce3013d04daec6340 Content-Type: text/plain; charset=ISO-8859-1 Hi, We're using Alfresco Enterprise 4.1.3 (still waiting for Enterprise 4.2.x). We are using the exact same version both in our development environments (locally) and in our deployments (remotely). We're currently using the BindingType.ATOMPUB Binding Type. I've tried setting the AtomPub URL to both http://localhost:8080/alfresco/service/cmisand http://localhost:8080/alfresco/cmisatom, no change. I can share the connection code if necessary. Turning on org.alfresco.repo.transaction.RetryingTransactionHelper=debug displays the following log message before the exception, which makes me agree it is not related to Alfresco. 2013-04-22 17:13:50,632 DEBUG [repo.transaction.RetryingTransactionHelper] [http-8080-1] Transaction commit failed: Thread: http-8080-1 Txn: UserTransaction[object=org.alfresco.util.transaction.SpringAwareUserTransaction@3b7d7d2e, status=1] Iteration: 0 Exception follows: java.lang.RuntimeException: java.io.IOException: Invalid chunk header at ... The only differences I can identify between the working and broken containers are: * Operating system: Locally Windows 7 x64 SP1, remotely Ubuntu 10.04 LTS * Tomcat version: Locally 7.0.23, remotely 6.0.24 * Java version: Locally 1.7.0_17, remotely 1.6.0_27 I'll deploy Java 6 & Tomcat 6 locally to see if it is a Java/Tomcat issue. Alternatively I might need to update Tomcat 6 to 6.0.36. Right now our workaround is deleting the file before uploading. Thanks for the ideas and feedback! Jevon On Tue, Apr 16, 2013 at 9:17 PM, Andrew Hind wrote: > Hi > > Which version of Alfresco are you using? > (OpenCMIS 0.8 is used in Alfresco 4.2) > > When you say you cannot reproduce it locally, do you mean the same test > passes and chunking works? > Are you using exactly the same version of Alfresco locally? > > It looks like it is not related to Alfresco unless there is some retry > going on that does not work with chunking. > > You could try turning on debug for > org.alfresco.repo.transaction.RetryingTransactionHelper > to see if retrying the operation is causing the issue - then it is an > Alfresco issue. > > Are you using web services? > I have seen something similar before, related to the WS support in the > container. > Can you use AtomPub instead? > > What is different between the container where it is OK and where it > breaks? > > Andy > > > > -----Original Message----- > From: jevon [mailto:jevon@jevon.org] > Sent: 16 April 2013 07:08 > To: dev@chemistry.apache.org > Subject: Invalid chunk header when replacing Document contents > > Hi, > > We're having problems with a deployment of OpenCMIS 0.8 interacting with > Alfresco. When using setContentStream() on an existing Document, Alfresco > is reporting an "Invalid chunk header" and the document contents do not > change. > > This error doesn't occur when uploading a new document, or on replacing > documents less than 10 KB. Unfortunately I haven't been able to reproduce > it locally but I can reproduce it on a different deployment environment. > Tomcat 7's default Http11 connector does not support disabling chunking. > As far as I can tell, it isn't an issue with permissions, SSL, folder > paths, firewalls, proxies or file content. > > As a workaround we're considering having to delete the existing document > before uploading a new one, but this will lose the previous history > associated with the document. > > Short of inspecting the data flow with Wireshark/etc, how could we look at > fixing this issue? Could this be an Alfresco, Chemistry, Tomcat or other > issue? Is there any way to convince OpenCMIS to not use a chunked > connection when uploading content? > > Thanks for any help. > > Jevon > > [1] Stacktrace on CMIS client: > > org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: > Internal Server Error > at > org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubS > ervice.convertStatusCode(AbstractAtomPubService.java:452) > at > org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubS > ervice.put(AbstractAtomPubService.java:595) > at > org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImp > l.setContentStream(ObjectServiceImpl.java:624) > at > org.apache.chemistry.opencmis.client.runtime.DocumentImpl.setContentStream > (DocumentImpl.java:412) > at > org.apache.chemistry.opencmis.client.runtime.DocumentImpl.setContentStream > (DocumentImpl.java:392) > at ... > > > Stacktrace on Alfresco server: > > java.lang.RuntimeException: java.io.IOException: Invalid chunk header > at > org.alfresco.repo.web.scripts.RepositoryContainer$BufferedRequest$1.getInp > utStream(RepositoryContainer.java:1059) > at > org.alfresco.repo.web.scripts.content.ContentSet.execute(ContentSet.java:1 > 75) > at > org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryCont > ainer.java:417) > at > org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(Re > tryingTransactionHelper.java:388) > at > org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(Rep > ositoryContainer.java:479) > at > org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(R > epositoryContainer.java:517) > at > org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(Repository > Container.java:333) > at > org.springframework.extensions.webscripts.AbstractRuntime.executeScript(Ab > stractRuntime.java:377) > at > org.springframework.extensions.webscripts.AbstractRuntime.executeScript(Ab > stractRuntime.java:209) > at > org.springframework.extensions.webscripts.servlet.WebScriptServlet.service > (WebScriptServlet.java:118) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati > onFilterChain.java:290) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter > Chain.java:206) > at > org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocal > izationFilter.java:61) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati > onFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter > Chain.java:206) > at > net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206) > at > net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati > onFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter > Chain.java:206) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve. > java:233) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve. > java:191) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:1 > 27) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:1 > 02) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja > va:109) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298 > ) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ht > tp11Protocol.java:588) > at > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) > at java.lang.Thread.run(Thread.java:679) > Caused by: java.io.IOException: Invalid chunk header > at > org.apache.coyote.http11.filters.ChunkedInputFilter.doRead(ChunkedInputFil > ter.java:133) > at > org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.ja > va:710) > at org.apache.coyote.Request.doRead(Request.java:427) > at > org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:3 > 04) > at > org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:421) > at > org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327) > at > org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.jav > a:162) > at > org.springframework.util.FileCopyUtils.copy(FileCopyUtils.java:112) > at > org.alfresco.repo.web.scripts.RepositoryContainer$BufferedRequest.getReque > stBodyAsFile(RepositoryContainer.java:938) > at > org.alfresco.repo.web.scripts.RepositoryContainer$BufferedRequest.access$6 > 00(RepositoryContainer.java:918) > at > org.alfresco.repo.web.scripts.RepositoryContainer$BufferedRequest$1.getInp > utStream(RepositoryContainer.java:1055) > ... 29 more > > > Code that executes setContentStream(): > > public void replaceContents(InputStream stream, long length, > String contentType) { > > Document doc = (Document) getCmisObject(); > ContentStream contentStream = new ContentStreamImpl(getName(), > BigInteger.valueOf(length), contentType, stream); > doc.setContentStream(contentStream, true); > > } > --089e0149cd2ce3013d04daec6340--