Importing Backup Results in 'Address Already in Use Connect' Error

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

Symptoms

When importing a backup on Windows the following error occurs:

Failed to import data: Error in action: com.atlassian.jira.action.admin.DataImport@15c0102, result: error Error importing data: org.apache.commons.lang.exception.NestableException: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: Exception while inserting the following entity: [GenericEntity:Action][id,90585][body,page created. pulls email template from exact target and uses SMTP to send.][author,ceaton][\][\][issue,33494][type,comment][updateauthor,ceaton] (Unable to establish a connection with the database. (Network error IOException: Address already in use: connect))

Cause

Windows limits the range of "client" ports to 1024-5000 and does not close connections fast enough which causes the Network I/O exception.

Resolution

Adjust a registry setting to increase the port range beyond 5000. If the server already has a lot of connections open and there aren't any ports available in the 1024-5000 range, use netstat to determine if this is true. If it looks like JIRA is making a lot of connections to the database on import and TIME_WAIT by TCP spec has a life of 4 minutes, then the system has reached its cap.

The default maximum number of ephemeral TCP ports is 5000 in the products that are included in the 'Applies to' section. A new parameter has been added in these products.

To increase the maximum number of ephemeral ports, follow these steps:

  1. Start Registry Editor (Start >> Run >> Regedit

  2. Make a Registry backup

  3. Locate the following subkey in the registry, and then click Parameters:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

  4. On the Edit menu, click New, and then add the following registry entry:

    Value Name: MaxUserPort Value Type: DWORD Value data: 65534 Valid Range: 5000-65534 (decimal) Default: 0x1388 (5000 decimal) Description: This parameter controls the maximum port number that is used when a program requests any available user port from the system. Typically , ephemeral (short-lived) ports are allocated between the values of 1024 and 5000 inclusive.
  5. Exit Registry Editor, and then restart the computer.

An additional TCPTimedWaitDelay registry parameter determines how long a closed port waits until the closed port can be reused as described in this Microsoft Article.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.