Skip to content

Unable to start Agent With HAProxy Server IP and port

Unable to start Agent With HAProxy Server IP and port in Jump to a symptom.

3 min read Updated SS RS

Unable to start Agent With HAProxy Server IP and port#

Data cannot be sent from the target to HEAL, with a certificate-related error. On earlier releases (HEAL 5.x) data was sent using the DNS name; the agent must now be pointed at the HAProxy IP and port.

Follow the steps below to rectify the issue:

1. Retrieve the SSL/TLS certificate from the remote server and save it to a file named haproxy.crt:

echo -n | openssl s_client -connect '<HAProxy IP>:<HAProxy Port>' |
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > haproxy.crt

For example:

echo -n | openssl s_client -connect '192.0.2.209:9918' |
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > haproxy.crt

2. Import the certificate into the Java keystore:

/home/user/JAVA_LINUX/jre/bin/keytool -import -trustcacerts
-keystore /home/user/JAVA_LINUX/jre/lib/security/cacerts
-storepass changeit -noprompt -alias weblogic -file haproxy.crt

3. Copy the cacerts file from the directory below into the agent config folder:

/home/user/JAVA_LINUX/jre/lib/security/

4. The data-source values in agent-details.json were found to be using DNS values instead of the HAProxy IP and port. Rectify this as follows:

a. Create a new entry in data-communication details containing the HAProxy IP and port, by executing the SQL below:

INSERT INTO data_communication_details (id, name, protocol_id, host,
port, status, created_time, updated_time, user_details_id,
description, endpoint)
VALUES (id, 'GRPC', 20, '192.0.2.209', 9918, 1, utc_timestamp(),
utc_timestamp(), '7640123a-fbde-4fe5-9812-581cd1e3a9c1',
'With Host Address', 'NULL');

b. Map the agent to the new data-communication entry. This ensures the agent uses the correct HAProxy IP and port for communication.

5. Retrieve the agent row to obtain its ID:

select * from agent where unique_token='ComponentAgent-Custom-192-0-2-160';

Expected output (key columns):

id            : 491
unique_token  : ComponentAgent-Custom-192-0-2-160
name          : ComponentAgent_192-0-2-160
host_address  : 192.0.2.160
status        : 1 (MONITOR)
1 row in set

6. Look up the current data_communication_id for that agent:

select * from component_agent where agent_id=491;

Expected output (key columns):

id                     : 505
agent_id               : 491
data_communication_id  : 2
1 row in set

7. Inspect the old data-communication entry (id 2), which still points at the DNS host:

select * from data_communication_details where id=2;

Expected output (key columns):

id: 2 | name: GRPC | protocol_id: 20 | host: heal.example.com
port: 9998 | status: 0
1 row in set

8. Point the agent at the new data-communication entry (id 30, created in step 4):

update component_agent set data_communication_id=30 where id=505;

Expected output:

Query OK, 1 row affected (0.30 sec)
Rows matched: 1  Changed: 1  Warnings: 0

9. Verify the update:

select * from component_agent where agent_id=491;
-- data_communication_id should now read 30

10. Restart the CA:

a. Navigate to the target server:

ssh <CA target IP>

b. List the running process:

ps -ef | grep -i component

Expected output:

root  9861  1  Aug06  05:06:57  /opt/Agents/Java_install_dir/jre1.8.0_301/bin/java
  -XX:+UseConcMarkSweepGC -XX:-HeapDumpOnOutOfMemoryError -Xms300M -Xmx500M
  -XX:OnOutOfMemoryError='kill -9 %p'
  -Djavax.net.ssl.trustStore=/opt/Agents/ComponentAgent/config/keyfiles/cacerts
  -Djavax.net.ssl.trustStorePassword=changeit
  -Dio.netty.native.workdir=/opt/Agents/ComponentAgent/tmp
  -jar /opt/Agents/ComponentAgent/ComponentAgent-1.3.0.jar

c. Navigate to the CA self-heal folder:

cd /opt/Agents/ComponentAgent/selfheal

d. Check the status of the CA:

./status.sh

Expected output:

State=Running:1691261783132
Message=Component Agent is running

e. Stop the CA:

./stop.sh

Expected output:

State=Stopped:1695797324693
Message=Component Agent is Stopped

f. Start the CA:

./start.sh

Expected output:

State=Running:1695797329326
Message=Component Agent is running

Issues with Uninstalling CA on Windows System#

An error was encountered when the CA uninstallation was performed on a Windows system.

Issues with Uninstalling CA on Windows System
Issues with Uninstalling CA on Windows System

Follow the steps below to uninstall the CA on Windows:

1. Click the Windows search button, type cmd, and open the Command Prompt.

2. In the Command Prompt, run:

wmic

This changes the prompt to wmic:root\cli>.

3. Retrieve the list of installed products:

product get name

This displays a list of installed software products on the system.

4. Uninstall the Component Agent:

product where name="Component Agent" call uninstall

5. Confirm yes to proceed with the uninstallation.

Incorrect Creation of File During Agent Installation#

The .env file is not created with the Java path while installing the agent.

Solution:

1. Check that the Java path passed to the install.sh script has execute permission for the installing user.

2. If execute permission is missing, the .env file is created but the Java path is not written into it.