Address is invalid on local machine, or port is not valid on remote machine

book

Article ID: 225171

calendar_today

Updated On:

Products

CA Automic Applications Manager (AM)

Issue/Introduction

Attempting to log into the Java Client can result in the below error:

ErrorMsg: AwE-5009 RMI connection failure, check if RmiServer is running
Details: null
java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine

While this error can be caused by multiple reasons, one of the reasons this error is seen when a ClientRMIPortNumber is defined (in cases where a firewall exists), is when this connection is hung or still active.

Finding and closing the connection should resolve the issue.

Environment

Release : 9.3

Component : APPLICATIONS MANAGER

Resolution

Check if there is a stuck/active connection on the User PC or the master and kill the connection.

From the User's PC, open a cmd prompt and check to see if there is a stuck/active connection to the master by running the below command:

netstat -ano | findstr <master IP address>

Below is an example:
C:\Users\pm685263>netstat -ano|findstr 10.74.33.127
  TCP    10.230.181.78:53728    10.74.33.127:1099      ESTABLISHED     16976

The result format is in:
TCP <local PC IP address>:<ClientRMIPortNumber>     <master IP address>:<RmiRegistryPort>    ESTABLISHED   <Process ID>

If a connection is found using the netstat command, the easiest way to kill the connection, is to end the process from Windows Task Manager:

 

To check if there is a stuck/active connection on the master, run the below command after logging into the master:

command is netstat -ano | grep <ip address of User PC>

example:
[[email protected] ~]$ netstat -ano | grep 10.230.181.78
tcp6       0      0 10.74.33.127:1099       10.230.181.78:53728     ESTABLISHED off (0.00/0/0)

The IP address of the User PC can be found in the client.log file, found in the log directory located in the same directory as the RunClient.jar. Below is a snippet of a client.log file where the Connection error occurs:

10:46:51.973 AWT-EventQueue-0: .ClientSocketManager: createSocket 172.16.11.150:1099 from A093789D/10.67.8.222:8097
10:46:51.973 AWT-EventQueue-0: .AxOptions: SSL=off
10:47:13.21 AWT-EventQueue-0: .ClientSocketManager: A093789D/10.67.8.222 java.net.ConnectException: Connection timed out: connect
10:47:13.21 AWT-EventQueue-0: .ClientSocketManager: createSocket 172.16.11.150:1099 from A093789D/192.168.1.35:8097
10:47:13.21 AWT-EventQueue-0: .AxOptions: SSL=off
10:47:34.73 AWT-EventQueue-0: .ClientSocketManager: A093789D/192.168.1.35 java.net.ConnectException: Connection timed out: connect
10:47:34.74 AWT-EventQueue-0: .ClientSocketManager: createSocket 172.16.11.150:1099 from A093789D/0:0:0:0:0:0:0:1:8097
10:47:34.74 AWT-EventQueue-0: .AxOptions: SSL=off
10:47:34.75 AWT-EventQueue-0: .ClientSocketManager: A093789D/0:0:0:0:0:0:0:1 java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine
10:47:34.78 AWT-EventQueue-0: .ErrorMsg: Error #: AwE-5009
10:47:34.80 AWT-EventQueue-0: .AxOptions: NoErrorMsgProperties=false
ErrorMsg: AwE-5009 RMI connection failure, check if RmiServer is running (9/14/21 10:47 AM) Details: null
java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine

In the above log snippet, the highlighted IP address is the IP address of the User PC. A user's PC may have multiple IP addresses. Run the above netstat command replacing "<ip address of User PC>" with the actual IP address of the User PC. The command needs to be for each different IP address.

If a connection is found, the connection can be killed by running the below command:

tcpkill host <ip address of User PC

 

Once connection(s) are killed, attempt to Lon in once more.

Attachments