2 Replies Latest reply on May 12, 2015 12:46 PM by hildebrandga

    ERROR UPLOADING ATTACHMENT WITH API

    hildebrandga

      I'm trying to use the API to upload a ticket attachment.  Using the workaround doc found in another discussion about a different error trying to do the same.  Using postman.  I've been able to successfully auth and get JSESSIONID and wosid... and trying the upload post exactly as it is in the API doc just to try to get a successful example.  Receiving the error response...

       

      {

          "type": "exception",

          "message": "Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly",

          "result": {

              "success": false

          }

      }

       

      Tried the image file upload from postman in the workaround doc and get the same message.  Tried to be diligent to investigate "Stream ended unexpectedly".  References server closing the connection, but hard to know why.  Hoping someone has seen this in context of this API before having to get too deep in the server logs.

       

      Here is the raw post body from the API doc for easy reference...

      POST /helpdesk/attachment/upload?type=jobTicket&entityId=40&returnFields=id,uploadDate HTTP/1.1

      Cookie: JSESSIONID=BA1B63AA2DD9EBBB62B7A20E37377DED; wosid=EoPFUriceH4t4jn5HiXiqg

      Content-Type: multipart/form-data; boundary====1400591996857===

      Cache-Control: no-cache

      Pragma: no-cache

      User-Agent: Java/1.7.0_55

      Host: 127.0.0.1:8081

      Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

      Connection: keep-alive

      Content-Length: 2143

      --===1400591996857===

      Content-Disposition: form-data; name="fileUpload"; filename="my.ini"

      Content-Type: null

      Content-Transfer-Encoding: binary # MySQL Server Instance Configuration File

      # ----------------------------------------------------------------------

      ... the rest of the file...

      --===1400591996857===--

       

      Any help is really appreciated!

      Thanks

        • Re: ERROR UPLOADING ATTACHMENT WITH API
          hildebrandga

          Hate to include too much of log files in discussion thread... but hoping it helps.  Thanks!

           

          2015-05-11 08:00:04.579 [http-bio-8081-exec-44] ERROR c.s.whd.web.ExceptionHandler - WEB request failed

          • org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is
          • org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly

                         at

          • org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:163)

          ~[spring-web.jar:3.2.7.RELEASE]

                         at

          • org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:139)

          ~[spring-web.jar:3.2.7.RELEASE]

                         at

          • org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1047)

          [spring-webmvc.jar:3.2.7.RELEASE]

                         at

          • org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:892)

          [spring-webmvc.jar:3.2.7.RELEASE]

                         at

          • org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)

          [spring-webmvc.jar:3.2.7.RELEASE]

                         at

          • org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)

          [spring-webmvc.jar:3.2.7.RELEASE]

                         at

          • org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855)

          [spring-webmvc.jar:3.2.7.RELEASE]

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

          [servlet-api.jar:na]

                         at

          • org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)

          [spring-webmvc.jar:3.2.7.RELEASE]

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

          [servlet-api.jar:na]

                         at

          1. com.solarwinds.common.spring.webappmanager.SpringWebApplication.service(SpringWebApplication.java:305)

          [whd-core.jar:na]

                         at

          1. com.solarwinds.common.spring.webappmanager.ManageableSpringWebAppServlet.service(ManageableSpringWebAppServlet.java:170)

          [whd-core.jar:na]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          [catalina.jar:7.0.50]

                         at

          1. com.solarwinds.whd.web.EntityContentFilter.doFilter(EntityContentFilter.java:40)

          [whd-web.jar:na]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          [catalina.jar:7.0.50]

                         at com.solarwinds.whd.web.MdcFilter.doFilter(MdcFilter.java:38)

          [whd-web.jar:na]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          [catalina.jar:7.0.50]

                         at

          • org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          1. com.solarwinds.whd.service.impl.auth.HelpdeskSsoAuthenticationFilter.doFilter(HelpdeskSsoAuthenticationFilter.java:51)

          [whd-core.jar:na]

                         at

          • org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

          [spring-web.jar:3.2.7.RELEASE]

                         at

          • org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

          [spring-security-web.jar:3.2.0.RELEASE]

                         at

          • org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)

          [spring-web.jar:3.2.7.RELEASE]

                         at

          • org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)

          [spring-web.jar:3.2.7.RELEASE]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          [catalina.jar:7.0.50]

                         at

          • org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

          [spring-web.jar:3.2.7.RELEASE]

                         at

          • org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

          [spring-web.jar:3.2.7.RELEASE]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

          [catalina.jar:7.0.50]

                         at

          • org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)

          [catalina.jar:7.0.50]

                         at

          • org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)

          [tomcat-coyote.jar:7.0.50]

                         at

          • org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)

          [tomcat-coyote.jar:7.0.50]

                         at

          • org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)

          [tomcat-coyote.jar:7.0.50]

                         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_45]

                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_45]

                         at java.lang.Thread.run(Unknown Source) [na:1.7.0_45] Caused by: org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly

                         at

          • org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:385)

          ~[commons-fileupload.jar:1.2.2]

                         at

          • org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)

          ~[commons-fileupload.jar:1.2.2]

                         at

          • org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:156)

          ~[spring-web.jar:3.2.7.RELEASE]

                         ... 60 common frames omitted

          Caused by:

          • org.apache.commons.fileupload.MultipartStream$MalformedStreamException:

          Stream ended unexpectedly

                         at

          • org.apache.commons.fileupload.MultipartStream.readHeaders(MultipartStream.java:538)

          ~[commons-fileupload.jar:1.2.2]

                         at

          • org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:999)

          ~[commons-fileupload.jar:1.2.2]

                         at

          • org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:965)

          ~[commons-fileupload.jar:1.2.2]

                         at

          • org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)

          ~[commons-fileupload.jar:1.2.2]

                         at

          • org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:351)

          ~[commons-fileupload.jar:1.2.2]

                         ... 62 common frames omitted

          2015-05-11 08:00:05.688 [http-bio-8081-exec-39] ERROR c.s.whd.web.ExceptionHandler - WEB request failed