java.net.SocketTimeoutException error while trying to install add-ons in Jira using the "upload app" button

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

    

Summary

When trying to install an add-on *.jar file in Jira via the upload app button from the page ⚙ > Manage Apps > Manage Apps, the installation fails. Instead, a spinning wheel is shown in the UI, and a java.net.SocketTimeoutException error is thrown in the browser developer tool:


Environment

Any Jira version 7.x/8.x and above.

Diagnosis

  • When collecting a HAR file while replicating the issue, we can see that a 500 HTTP code is returned from the POST request sent to <JIRA_BASE_URL>/rest/plugins/1.0/?token=-XXXXXXXXXXXXXX:
  • When checking the Jira application logs, the following error is found:

    2022-01-05 23:26:14,451+1100 http-nio-8080-exec-17 ERROR admin 1405x1316x1 1nexwxg 10.228.85.71 /rest/plugins/1.0/ [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: org.apache.commons.fileupload.FileUploadException: java.net.SocketTimeoutException
    java.lang.RuntimeException: org.apache.commons.fileupload.FileUploadException: java.net.SocketTimeoutException
    	at com.atlassian.plugins.rest.common.multipart.fileupload.CommonsFileUploadMultipartHandler.getForm(CommonsFileUploadMultipartHandler.java:78)
    	at com.atlassian.plugins.rest.common.multipart.fileupload.CommonsFileUploadMultipartHandler.getForm(CommonsFileUploadMultipartHandler.java:66)
    	at com.atlassian.plugins.rest.common.multipart.fileupload.CommonsFileUploadMultipartHandler.getFilePart(CommonsFileUploadMultipartHandler.java:32)
    	at com.atlassian.upm.core.rest.resources.PluginCollectionResource.installFromFileSystem(PluginCollectionResource.java:248)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    	... 18 filtered
    	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:162)
    	... 1 filtered
    	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:72)
    	... 32 filtered
    	at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55)
    	... 8 filtered
    
    ...	
    
    com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89)
    	at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
    	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:211)
    	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:139)
    	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:128)
    	... 4 filtered
    	at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
    	... 8 filtered
    	at com.atlassian.ratelimiting.internal.filter.RateLimitPreAuthFilter.doFilter(RateLimitPreAuthFilter.java:71)
    	... 3 filtered
    	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
    	... 4 filtered
    	at com.atlassian.troubleshooting.thready.filter.AbstractThreadNamingFilter.doFilter(AbstractThreadNamingFilter.java:46)
    	... 3 filtered
    	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
    	... 26 filtered
    	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
    	... 25 filtered
    	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    	at java.base/java.lang.Thread.run(Unknown Source)
    Caused by: org.apache.commons.fileupload.FileUploadException: java.net.SocketTimeoutException
    	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362)
    	at com.atlassian.plugins.rest.common.multipart.fileupload.CommonsFileUploadMultipartHandler.getForm(CommonsFileUploadMultipartHandler.java:72)
    	... 296 more
    Caused by: org.apache.catalina.connector.ClientAbortException: java.net.SocketTimeoutException
    	at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:330)
    	... 2 filtered
    	at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:999)
    	at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:903)
    	at java.base/java.io.InputStream.read(Unknown Source)
    	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:100)
    	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:70)
    	at org.apache.commons.fileupload.MultipartStream.readBodyData(MultipartStream.java:593)
    	at org.apache.commons.fileupload.MultipartStream.discardBodyData(MultipartStream.java:617)
    	at org.apache.commons.fileupload.MultipartStream.skipPreamble(MultipartStream.java:634)
    	at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:1023)
    	at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:1003)
    	at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310)
    	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334)
    	... 297 more
    Caused by: java.net.SocketTimeoutException
    	at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:230)
    	at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:279)
    	at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:259)
    	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1311)
    	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1253)
    	... 6 filtered
    	... 312 more
  • The issue only occurs when Jira is accessed using a browser that's on a machine located outside the network used by the Jira application
  • If the browser is opened directly on the same machine where the Jira application is running, the issue is not replicated and the add-on is successfully uploaded to Jira via the browser

Cause

There is some network/firewall configuration that is blocking the traffic from the machine from where the add-on jar file was uploaded, and the server where the Jira application is running.

Solution

Since the network issue is outside the control of the Jira application, please reach out to your Network and Jira Server administrator to allow the traffic between the machine from where the add-on jar file was uploaded, and the server where the Jira application is running.



Last modified on Feb 8, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.