Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-10876

Range Requests Can Fail For Files Over 2GB in Some Cases

    Details

      Description

      When dealing with files over 2GB some clients can issue requests with a byte range specification that causes a NegativeArraySizeException.

      OS X's built-in WebDAV is one such client that can cause the following in the log:

      15:46:36,750  DEBUG [alfresco.webdav.protocol] WebDAV request GET on path /alfresco/webdav/Sites/family/documentLibrary/Test/Concerts/Bob%20Marley.m4v
      15:46:36,751  DEBUG [alfresco.webdav.protocol] Range header supplied: bytes=8184-
      15:46:36,752  DEBUG [alfresco.webdav.protocol] Fetched node for path: 
         root: workspace://SpacesStore/87e71b2e-bf84-4434-a9bb-04a7ac852dcb
         path: /Sites/family/documentLibrary/Test/Concerts/Bob Marley.m4v
         result: FileInfo[name=Bob Marley.m4v, isFolder=false, nodeRef=workspace://SpacesStore/4a87a9ec-9814-4e60-89d3-ac425fa9b8d0]
      15:46:36,754  DEBUG [web.util.HttpRangeProcessor] Processing: Content-Range: bytes 8184-2330108829/2330108830
      15:46:36,754  ERROR [alfresco.webdav.protocol] Error while reading content
      java.lang.NegativeArraySizeException
      	at org.alfresco.repo.web.util.HttpRangeProcessor.streamRangeBytes(HttpRangeProcessor.java:469)
      	at org.alfresco.repo.web.util.HttpRangeProcessor.processSingleRange(HttpRangeProcessor.java:228)
      	at org.alfresco.repo.web.util.HttpRangeProcessor.processRange(HttpRangeProcessor.java:88)
      	at org.alfresco.repo.webdav.GetMethod.attemptReadContent(GetMethod.java:318)
      	at org.alfresco.repo.webdav.GetMethod.readContent(GetMethod.java:269)
      	at org.alfresco.repo.webdav.GetMethod.executeImpl(GetMethod.java:259)
      	at org.alfresco.repo.webdav.WebDAVMethod$2.execute(WebDAVMethod.java:398)
      	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
      	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:342)
      	at org.alfresco.repo.webdav.WebDAVMethod.execute(WebDAVMethod.java:406)
      	at org.alfresco.repo.webdav.WebDAVServlet.service(WebDAVServlet.java:138)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.alfresco.repo.webdav.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:254)
      	at sun.reflect.GeneratedMethodAccessor449.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:125)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at com.sun.proxy.$Proxy319.doFilter(Unknown Source)
      	at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      	at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
      	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:724)
      15:46:36,755  INFO  [alfresco.webdav.protocol] GET took 5ms to execute [/alfresco/webdav/Sites/family/documentLibrary/Test/Concerts/Bob%20Marley.m4v]
      

      The issue is similar to MNT-9770 in that a long value greater than Integer.MAX_VALUE is being cast to int which results in a negative int value.

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  ragauss Ray Gauss [X] (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel