Change Tomcat's default shutdown port to avoid conflict with Microsoft Configuration Manager

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: Tomcat
    • None
    • 0
    • 11

      Problem

      According to Microsoft's documentation Ports used in Configuration Manager, TCP port 8005 is used for "Express Updates" by their Configuration Manager systems management tool for Windows:

      Description UDP TCP
      HTTP 80 Note 2 Alternate port available
      HTTPS 443 Note 2 Alternate port available
      Express updates 8005 Note 2 Alternate port available

      This conflicts with the default shutdown port for Jira's bundled Tomcat application server, as described in our documentation page Changing Jira application TCP ports:

      <Server port="8005" shutdown="SHUTDOWN">
      

      However, in practice it appears that Microsoft Configuration Manager does not listen on TCP port 8005 all the time. This results in a scenario where Jira is installed on Windows and starts up normally for some time, then suddenly fails for no apparent reason when restarted after OS patching and Tomcat is unable to bind to its shutdown port:

      01-Jan-2023 01:00:00.000 SEVERE [main] org.apache.catalina.core.StandardServer.await StandardServer.await: create[localhost:8005]: 
              java.net.BindException: Address already in use: NET_Bind
                      at java.base/java.net.PlainSocketImpl.bind0(Native Method)
                      at java.base/java.net.PlainSocketImpl.socketBind(Unknown Source)
                      at java.base/java.net.AbstractPlainSocketImpl.bind(Unknown Source)
                      at java.base/java.net.ServerSocket.bind(Unknown Source)
                      at java.base/java.net.ServerSocket.<init>(Unknown Source)
                      at org.apache.catalina.core.StandardServer.await(StandardServer.java:421)
                      at org.apache.catalina.startup.Catalina.await(Catalina.java:776)
                      at org.apache.catalina.startup.Catalina.start(Catalina.java:722)
                      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)
                      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
                      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)

      No relevant errors are visible in the Jira application log, which simply shows that Jira shut down immediately after starting:

      2023-01-01 00:00:00,000+0000 JIRA-Bootstrap INFO      [c.a.jira.startup.LauncherContextListener] Startup is complete. Jira is ready to serve.
      2023-01-01 00:00:00,100+0000 JIRA-Bootstrap INFO      [c.a.jira.startup.LauncherContextListener] Memory Usage:
          ---------------------------------------------------------------------------------
            Heap memory     :  Used:  600 MiB.  Committed:  1000 MiB.  Max: 8192 MiB
            Non-heap memory :  Used:  300 MiB.  Committed:  400 MiB.  Max: 1536 MiB
          ---------------------------------------------------------------------------------
            TOTAL           :  Used:  900 MiB.  Committed: 1400 MiB.  Max: 9728 MiB
          ---------------------------------------------------------------------------------
      2023-01-01 00:00:00,100+0000 localhost-startStop-1 INFO      [c.a.jira.startup.DefaultJiraLauncher] Stopping launchers

      Suggested Solution

      Change the default shutdown port in Jira's bundled version of Tomcat, from TCP 8005 to another port which won't conflict with commonly used applications.

      Why This Is Important

      While not a bug in Jira as such, this issue when encountered invariably results in unplanned outages and considerable disruption for Jira users and administrators. The cause of the outages is not immediately obvious because the only recent change is typically OS patches having been installed, and rolling them back will not solve the problem. The lack of useful information in the Jira logs also contributes to confusion about the root cause. This can cause extended periods of downtime until the Tomcat logs are finally examined and the port binding conflict discovered.

      Workaround

      This issue can be worked around by changing the Jira shutdown port manually as per our documentation page Changing Jira application TCP ports - however, this is usually only done after a particular Jira environment has already been affected by the issue. Changing the default port would save potential trouble and disruption for users installing Jira on Windows in the future.

            Assignee:
            Unassigned
            Reporter:
            Marcus Fong
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: