Upgrade Fails due to java.lang.IllegalArgumentException: port out of range

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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 performing an upgrade for Confluence, the shutdown port cannot be set to a negative number. The Shutdown port provides an OS neutral way to close a Tomcat application (Confluence, Jira, etc.). This value must be set to a non-negative number.

Environment

7.6.0

Diagnosis

The upgrade process fails before completion. Reviewing the logs, we find the following:

1 2 3 4 5 6 7 8 9 10 11 12 ...... Your instance of Confluence is currently being upgraded. Checking if Confluence has been shutdown... In action "Check Confluence is shut [Run script]" (screen "Upgrade Actions [Form]"), property "Script": java.lang.IllegalArgumentException: port out of range:-1 at java.base/java.net.InetSocketAddress.checkPort(Unknown Source) at java.base/java.net.InetSocketAddress.<init>(Unknown Source) at com.atlassian.inception.TomcatChecker.isTomcatRunning(TomcatChecker.java:15) at com.install4j.script.I4jScript_Internal_72.eval(I4jScript_Internal_72.java:5) at com.install4j.script.I4jScript_Internal_72.evaluate(I4jScript_Internal_72.java:*40) at com.install4j.runtime.installer.helper.Script.evaluate(Script.java:33) at com.install4j.runtime.installer.ContextImpl.runScript(ContextImpl.java:202)

Cause

The shutdown port is using an invalid port number. 

Solution

Update the shutdown port value. The shutdown port can be found at the very top of the server.xml file:

1 2 3 <Server port="7999" shutdown="SHUTDOWN" debug="0"> <Service name="Tomcat-Standalone"> .........

In order to resolve the port out of range error during an upgrade, we'll have to update the port value of the server.xml file to a non-negative value.

Updated on March 17, 2025

Still need help?

The Atlassian Community is here for you.