Skip to content

Error Fetching Agent Config Data in OpenShift

Error Fetching Agent Config Data in OpenShift in CA Operational Issues.

6 min read Updated SS RS

Error Fetching Agent Config Data in OpenShift#

An error occurred while starting the Component Agent, preventing it from fetching configuration data:

E2022: Data service not responding, for uid "ComponentAgent_192_0_2_74"
and url "https://apm.example.com:9998/heal-controlcenter/v2.0/api/agent-config-data",
stopping component agent.
com.appnomic.appsone.componentagent.common.ComponentAgentException: E2022...
  at ...ComponentAgentDetails.populateStartUpWorkflow(ComponentAgentDetails.java:142)
  at ...ComponentAgentMain.main(ComponentAgentMain.java:45)

RCA: a mismatch in column names in the database — forensics_enabled in the agent table and forensic_agent_type_id in the comp_instance table.

Solution:

1. Database correction: correct the column names in Percona by dropping the existing view and creating a new view for the comp_instance table with the corrected column names:

DROP VIEW IF EXISTS view_component_instance;
CREATE VIEW view_component_instance AS
SELECT c.id, c.name, c.status, c.identifier, c.host_id,
  (SELECT name FROM comp_instance WHERE id=c.host_id) host_name,
  (SELECT identifier FROM comp_instance WHERE id=c.host_id) host_identifier,
  c.is_cluster, c.account_id, c.user_details_id, c.discovery, c.host_address,
  c.mst_component_id, vc.component_name, c.mst_component_type_id, vc.component_type_name,
  c.mst_component_version_id, vc.component_version_name, vc.common_version_id,
  vc.common_version_name, c.created_time, c.updated_time, c.parent_instance_id,
  c.supervisor_id, c.is_DR, c.forensic_agent_type_id
FROM comp_instance c, view_components vc
WHERE c.mst_component_id=vc.component_id
  AND c.mst_component_type_id=vc.component_type_id
  AND c.mst_component_version_id = vc.component_version_id;

2. Component Agent restart: after the database corrections, restart the Component Agent so it can fetch its configuration data.

Data Collection Issue Resolution#

Data collection was not occurring for certain KPIs within the Component Agent.

Error: the logs revealed the producer was terminated due to an execution time of less than 0 seconds:

error code: E1104: producer is terminated because execution time is less than 0 seconds

Solution:

1. Log analysis: examine the CA logs to identify the error code and its implication.

2. Configuration update: the timeoutmultiplier attribute was found set to 0 in the agent JSON; update it to 2 in the Percona database.

3. Service restart: after the update, restart the CA service to initiate data collection.

Configuring Encrypted Connection Between CA and JMX Server#

Solution:

1. Generate keystore and certificate:

keytool -genkeypair -keystore serverkeystore -alias serverkey
  -validity 365 -storepass serverpass -keypass serverpass

2. Export the certificate from the keystore:

keytool -exportcert -keystore serverkeystore -alias serverkey
  -storepass serverpass -file server.cer

3. Tomcat server configuration: include the keystore in the Tomcat environment settings (setenv.sh):

CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote=true
  -Dcom.sun.management.jmxremote.port=8001
  -Dcom.sun.management.jmxremote.ssl=true
  -Dcom.sun.management.jmxremote.authenticate=false
  -Djava.rmi.server.hostname=192.0.2.91
  -Djavax.net.ssl.keyStorePassword=serverpass
  -Djavax.net.ssl.keyStore=/opt/tomcat_cert/serverkeystore"

4. Restart and verification: restart the Tomcat server and verify the configuration by checking the process list for the expected SSL and keystore parameters.

High Memory Utilisation on Oracle Instance#

Issue: the HEAL agent was using too much memory; the DB server reached 95% utilization, and once the agent was stopped the server's memory dropped to 57%.

Solution: the Oracle database is set up in a cluster, and the monitoring query produced the same result on both instances. To reduce load, configure the monitoring query to run on only one instance while other monitoring processes continue on both servers. Because the query results are consistent across the cluster, the performance KPIs remain accurate.

Component Agent Stops After 10 Minutes#

After 10 minutes of the Supervisor agent starting, the Component Agent stopped.

RCA: default CPU and memory threshold values in selfhealconfig caused the Supervisor to stop the Component Agent.

Solution: increase the threshold values in selfhealconfig.

Data Collection Issue (After OS Upgrade 7.x to 8.x)#

After upgrading the OS from 7.x to 8.x, host data collection stopped, although component data collection was successful. Host details were missing from agent-details.json, and the following error appeared in the Control Center logs:

2024-07-22 16:49:13.242 ERROR c.a.a.c.d.m.ConfigurationDataService:410 -
Error occurred while populating component instance id, 76
java.lang.NullPointerException: null
...
Caused by: java.lang.NullPointerException: element cannot be mapped to a null key
  at java.base/java.util.stream.Collectors.lambda$groupingBy$53(Collectors.java:1134)
  at ...ConfigurationDataService.getCompInstanceKpiConfigPerCompInst(ConfigurationDataService.java:781)

This was traced to null entries in the comp_instance_kpi_threshold_details table, which prevented host data collection.

RCA: the database contained null values in comp_instance_kpi_threshold_details, likely arising from database changes not handled properly during the OS upgrade.

Solution:

1. Remove the null entries from the comp_instance_kpi_threshold_details table.

2. Restart the services.

CA logs Issue — 'cscript' is not recognized#

Error:

2024-09-05 16:39:56.712 [minute-worker-pool-thread 3] ERROR
c.a.a.c.shell.ShellProducer:143 - "'cscript' is not recognized as an
internal or external command, operable program or batch file."
::Error occurred for script "Fetch_Disk_Data.bat", producer name
"Window_Fetch_Disk_Space", instance name "Windows-App-203.0.113.240".

RCA:

1. Open cmd.

2. Check the PATH variable:

echo "%PATH%"

3. Validate that C:\Windows\system32 is present. If it is present but the cscript error persists, modify the installer file (see Solution). If it is absent, add it to the system variables, restart the CA, and validate.

Comparing a working (local) environment with the failing end-user environment showed the failing host's Path did not resolve cscript because C:\Windows\system32 was not reachable in the service's environment block.

Solution:

1. Stop the CA.

2. Delete the CA logs.

3. Uninstall the CA.

4. Navigate to the CA service folder and check the installer and uninstaller files, for example:

C:\Agents\ComponentAgent\ComponentAgent-Windows-1.3.6\<identifier>\service

5. Open installservice.bat and ensure the service PATH environment explicitly includes system32:

@echo off
setlocal enabledelayedexpansion
rem Script to install the ComponentAgent windows service
"C:/Agents/ComponentAgent/ComponentAgent-Windows-1.3.6/<identifier>/service/prunsrv.exe"
  //IS//A1ComponentAgent --DisplayName="A1 Component Agent"
  --Description="Component Agent service" --ServiceUser=LocalSystem
  --Install="C:/Agents/ComponentAgent/ComponentAgent-Windows-1.3.6/<identifier>/service/prunsrv.exe"
  --Jvm="C:/Program Files/Zulu/zulu-8-jre/bin/server/jvm.dll"
  --LogPath="C:/Agents/ComponentAgent/ComponentAgent-Windows-1.3.6/<identifier>/logs"
  --JvmOptions=-Duser.language=EN;-Duser.region=in;-XX:+UseConcMarkSweepGC;-Xms512M;-Xmx512M;
    -Djavax.net.ssl.trustStore="C:/Agents/ComponentAgent/ComponentAgent-Windows-1.3.6/<identifier>/config/keyfiles/cacerts";
    -Djavax.net.ssl.trustStorePassword=changeit
  --LogLevel=Debug --LogPrefix=A1ComponentAgent
  --Classpath="C:/Agents/ComponentAgent/ComponentAgent-Windows-1.3.6/<identifier>/ComponentAgent.jar"
  --StartClass=com.appnomic.appsone.componentagent.core.ComponentAgentWindowsStartStop
  --StartMethod=start --StartMode=jvm --Startup=manual
  ++Environment="PATH='C:\Windows\system32'"
  --StdError=auto --StdOutput=auto
  --StopClass=com.appnomic.appsone.componentagent.core.ComponentAgentWindowsStartStop
  --StopMethod=stop --StopMode=jvm

6. Confirm the CA is stopped and uninstalled.

7. Install the CA again.

8. After reinstalling, refer to the images below to confirm it was done correctly.

CA logs Issue
CA logs Issue
CA logs Issue

Component Agent Not Working on Amazon Linux#

Error: an error was encountered while starting the Component Agent on Amazon Linux.

Component Agent Not Working on Amazon Linux

Solution:

1. The environment was using Java 17.

2. Modify the Component Agent startup script to use the G1 garbage collector instead of CMS:

# Initial
JAVA -XX:+UseConcMarkSweepGC
# Updated
JAVA -XX:+UseG1GC

3. After the change, the CA starts functioning.

Data Collection Not Working Through CA (Amazon Linux)#

The CA was deployed on Amazon Linux and appeared to be running, but data collection was not functioning.

RCA:

1. Data-receiver log error:

java.lang.IllegalStateException: Request cannot be executed;
I/O reactor status: STOPPED

Additional details pointed to issues with the connection to OpenSearch and the bulk-indexing process.

2. CA logs error: an Invalid Producer error was also observed in the CA logs.

Data Collection Not Working Through CA (Amazon Linux)
Data Collection Not Working Through CA (Amazon Linux)

Solution:

1. Certificate issue: a certificate-related issue was identified and resolved.

2. Invalid Producer error: following the certificate resolution, update the AWS KPI components to Linux components in the Control Center configuration.

3. Result: after these changes, host-level data collection started working.

Data Collection Issue for Tomcat (Amazon Linux)#

Component data collection for Tomcat on Amazon Linux does not work; host data collection is successful, but the following error appears in the CA logs:

Caused by: java.lang.ClassNotFoundException: com.ibm.CORBA.iiop.ORB
  at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
  ...
  at com.appnomic.appsone.componentagent.jmx.JmxProducer.canConnect(JmxProducer.java:199)

RCA:

a. The application is missing the IBM CORBA library.

b. Java 17, which is in use, does not include these dependencies.

c. The required IBM CORBA library is only available in Java versions earlier than 11.

Solution:

1. Switch the Java version from OpenJDK 17 to OpenJDK 1.8 (Java 8).

2. Restart the Component Agent after the Java-version change.

Note: Java 17.x does not meet the dependency requirements for Tomcat component data collection. Confirm the compatibility of dependent libraries when upgrading Java versions.