4 Replies Latest reply on Nov 2, 2016 4:52 AM by mathiasconradt

    [ModeShape 5.2.0] Multiple problems with binary content (broken pipe, WebDav download, etc.)

    mathiasconradt

      I just installed WildFly (10.1.0 Final) and deployed ModeShape 5.2.0 Final to it. I follow the instructions as per documentation.

       

      Added a user, then I start the server and application:

       

      cd /path/to/wildfly-10.1.0.Final

      bin/standalone.sh -c standalone-modeshape.xml

       

      I connect via WebDAV, create a folder /sample/default/mathias and upload a pdf file in it.

       

      I can see the pdf file and it's jcr:content in the modeshape-explorer

      http://localhost:8080/modeshape-explorer/tree/sample/ws-default/mathias/74W6BW.pdf/jcr:content

       

      Here is what fails though:

       

      (1)

      When I try to download the file via WebDAV, the file gets downloaded/created with 0 bytes. The file is 494kB of size though.

      (I use Transmit (https://panic.com/transmit/) as the WebDAV client, which works fine with other (JCR and CMIS compliant) servers that offer WebDAV support).

       

      fAQTPG.jpg

       

      (2)

      I open the node in the modeshape-explorer and am able to see the binary content / preview there.

       

      BA6mRn.jpg

       

      However, I can see this exception in the modeshape log:

       

      16:55:13,234 SEVERE [Binary] (default task-50) Binary content has been requested

      16:55:13,286 SEVERE [Binary] (default task-50) Sent binary content

      16:55:13,419 SEVERE [Binary] (default task-53) Binary content has been requested

      16:55:13,427 ERROR [io.undertow.request] (default task-53) UT005023: Exception handling request to /modeshape-explorer/binary/node: javax.servlet.ServletException: java.io.IOException: Broken pipe

        at org.modeshape.web.BinaryContentServlet.processRequest(BinaryContentServlet.java:95)

        at org.modeshape.web.BinaryContentServlet.doGet(BinaryContentServlet.java:112)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53)

        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

        at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59)

        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

        at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

        at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)

        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

      Caused by: java.io.IOException: Broken pipe

        at sun.nio.ch.FileDispatcherImpl.writev0(Native Method)

        at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51)

        at sun.nio.ch.IOUtil.write(IOUtil.java:148)

        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:503)

        at org.xnio.nio.NioSocketConduit.write(NioSocketConduit.java:162)

        at io.undertow.server.protocol.http.HttpResponseConduit.write(HttpResponseConduit.java:639)

        at io.undertow.conduits.ChunkedStreamSinkConduit.doWrite(ChunkedStreamSinkConduit.java:163)

        at io.undertow.conduits.ChunkedStreamSinkConduit.write(ChunkedStreamSinkConduit.java:127)

        at org.xnio.conduits.ConduitStreamSinkChannel.write(ConduitStreamSinkChannel.java:150)

        at io.undertow.channels.DetachableStreamSinkChannel.write(DetachableStreamSinkChannel.java:240)

        at io.undertow.server.HttpServerExchange$WriteDispatchChannel.write(HttpServerExchange.java:2028)

        at io.undertow.servlet.spec.ServletOutputStreamImpl.writeBufferBlocking(ServletOutputStreamImpl.java:563)

        at io.undertow.servlet.spec.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:216)

        at io.undertow.servlet.spec.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:117)

        at org.modeshape.web.BinaryContentServlet.processRequest(BinaryContentServlet.java:88)

        ... 42 more

       

       

      (3)

      When I now stop the server and restart again, then reload the page in modeshape-explorer, the binary content does not show anymore and I get an error like this:

       

      (The same problem happens when I don't restart the server, but instead try to update the jcr:content/jcr:data of an existing node with binary content via the modeshape-explorer.)

      cg0M6z.jpg

       

      17:05:34,284 SEVERE [Binary] (default task-34) Binary content has been requested

      17:05:34,288 ERROR [io.undertow.request] (default task-34) UT005023: Exception handling request to /modeshape-explorer/binary/node: javax.servlet.ServletException: org.modeshape.jcr.value.binary.BinaryStoreException: Unable to find binary value with key "04e8f27c96930b7e36ccad8c56cf8cff9d781c5d" within binary store at "/Users/mln/Projects/modeshape/wildfly-10.1.0.Final/standalone/tmp/modeshape-binary-store"

        at org.modeshape.web.BinaryContentServlet.processRequest(BinaryContentServlet.java:95)

        at org.modeshape.web.BinaryContentServlet.doGet(BinaryContentServlet.java:112)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53)

        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

        at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59)

        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

        at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

        at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)

        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

      Caused by: org.modeshape.jcr.value.binary.BinaryStoreException: Unable to find binary value with key "04e8f27c96930b7e36ccad8c56cf8cff9d781c5d" within binary store at "/Users/mln/Projects/modeshape/wildfly-10.1.0.Final/standalone/tmp/modeshape-binary-store"

        at org.modeshape.jcr.value.binary.FileSystemBinaryStore.getInputStream(FileSystemBinaryStore.java:319)

        at org.modeshape.jcr.value.binary.StoredBinaryValue.internalStream(StoredBinaryValue.java:70)

        at org.modeshape.jcr.value.binary.AbstractBinary.getStream(AbstractBinary.java:166)

        at org.modeshape.web.BinaryContentServlet.processRequest(BinaryContentServlet.java:81)

        ... 42 more

        • 1. Re: [ModeShape 5.2.0] Multiple problems with binary content (broken pipe, WebDav download, etc.)
          hchiorean

          Are you using OS-X by any chance ? If yes, you may be running into [MODE-1946] Creating/copying files via WebDAV with OS X generates 0-byte files - JBoss Issue Tracker  which is a known issue on this platform. Actually, IIRC there may be several known WebDAV issues on OS-X, but we can't fix them without help from the community since we don't have OS-X development machines (these issues don't occur on Linux or Windows platforms).

           

          Also, what does your repository configuration looks like ?  The sample and artifacts repositories from the default kit use <file-persistence/> to store binaries under ${jboss.server.data.dir}/modeshape/<repo_name>/binaries. However, from your logs it seems binaries are stored under /tmp/modehshape-binary-store which is indicative of transient binary store, which is not something that should be used when you're dealing with binaries (i.e. when you expect the server to store binaries).

          • 2. Re: [ModeShape 5.2.0] Multiple problems with binary content (broken pipe, WebDav download, etc.)
            mathiasconradt

            Yes, I'm using Mac OS X. Thanks for the link to the Jira ticket.

             

            I did not do any custom configuration at all. I just downloaded the distribution (5.2.0-Final.zip), deployed it to WildFly and started it. No configuration done at all from my side, so I guess it's the default configuration as it comes with the download. I do see the mentioned folders in my WildFly data folder:

            Screen Shot 2016-10-31 at 09.19.21.png

            • 3. Re: [ModeShape 5.2.0] Multiple problems with binary content (broken pipe, WebDav download, etc.)
              hchiorean

              Yes, the above folders are correct with respect to the repository data storage (JCR nodes, properties etc). Binaries on the other hand are stored separately based on binary-specific configuration. The default sample repository from the kit does not store binaries anywhere explicitly, meaning it's using a transient binary store. This explains why the binaries appear under the tmp folder (I missed this in the first post)

               

              So you could try a couple of things just to check that transient binary storage isn't the culprit and this is some OS-X related issue: you can either edit standalone-modeshape.xml and add a <file-binary-storage/> element to the sample repository (just like the artifacts repository) or you can repeat your test case using the artifacts repository which already has this configured.

              • 4. Re: [ModeShape 5.2.0] Multiple problems with binary content (broken pipe, WebDav download, etc.)
                mathiasconradt

                I added <file-binary-storage/> to the config of the sample repo.

                 

                My above mentioned issue (1) still exists. Downloading the file via WebDAV still saves it with 0 bytes.

                Issues (2) and (3) are resolved though.

                 

                By the way: when I open the binary preview in the modeshape explorer, I do see this in the log. Not sure why it has log level SEVERE. There are other error lines in the log other than those lines:

                 

                09:46:54,237 SEVERE [Binary] (default task-76) Binary content has been requested

                09:46:54,275 SEVERE [Binary] (default task-76) Sent binary content

                09:46:54,480 SEVERE [Binary] (default task-79) Binary content has been requested

                09:46:54,511 SEVERE [Binary] (default task-79) Sent binary content

                09:47:05,025 SEVERE [Binary] (default task-112) Binary content has been requested

                09:47:05,036 SEVERE [Binary] (default task-112) Sent binary content

                09:47:05,204 SEVERE [Binary] (default task-114) Binary content has been requested

                09:47:05,215 SEVERE [Binary] (default task-114) Sent binary content

                09:47:27,643 SEVERE [Binary] (default task-21) Binary content has been requested

                09:47:27,656 SEVERE [Binary] (default task-21) Sent binary content

                 

                4JNFp1.jpg