Forensic Agent Issues
Symptom-based runbook for Forensics Agent problems, from missing data to collection timeouts.
This runbook covers troubleshooting for the Forensics Agent — the component that collects on-demand diagnostic data (CPU, memory, database KPIs, custom scripts) when an anomaly or action is triggered. Use the router below to jump to the matching symptom.
| Symptom | Go to |
|---|---|
Action logs show "Forensic is disabled or unavailable"; forensic details return null in the Control Center |
Forensics data not showing in UI |
| Collection aborts with a timeout on a database KPI (e.g. CURRENT_OPEN_CURSORS) | Forensic data collection failed due to timeout |
| "Bad substitution" error in ResultSender.log for a custom forensic script | Inadequate forensic visibility (bad substitution) |
| Registering or structuring a custom forensic action | Custom forensics |
| Forensics never triggered (no anomalies) or values return as "NA" | Forensics data unavailability |
| No forensics collected for ORA_ERROR | Unable to retrieve forensics data for ORA_ERROR |
| Forensics only visible in a 4-hour window, not 30-minute / 1-hour | Visibility of forensic details |
| Forensic data cannot be retrieved (agent paths) | Forensic data retrieval issue |
| No forensic or email alerts after a DR→DC transition | Forensic and email alert issue post DR→DC |
For reference: basic Linux commands are covered in Basic Commands.
Forensics data not showing in UI#
Symptom: Forensic data collection fails and the action logs report "Forensic is disabled or unavailable." In the Control Center, forensic details are returned as null.
Cause: An account was deleted in the backend by importing Delete_Account_details.sql and running CALL Delete_Account(2);. The stored procedure cascaded further than intended and removed rows from the command_details and command_arguments tables, so the forensic commands no longer exist.
Diagnosis: Inspect the forensic command tables in the Percona (MySQL) database. The category and its action mapping are intact, but the command rows are gone.
1. Confirm the category row exists:
mysql> select * from mst_category_details where id=1; -- returns 1 row (e.g. CPU)
2. Confirm the action-to-category mapping exists:
mysql> select * from action_category_mapping where category_id=1; -- returns 1 row
3. Check the command rows — this is the smoking gun:
mysql> select * from command_details where id=1;
Empty set (0.00 sec)
An empty result for command_details (and, correspondingly, command_arguments) confirms the rows were deleted by the account-deletion procedure.
Resolution: Manually re-insert the missing rows from command_argument.sql. The full script restores roughly 85 command_arguments rows plus the associated command_details rows — run the entire script, not just the two illustrative statements shown here.
-- command_details (representative row)
INSERT INTO command_details
(id,name,identifier,command_type_id,command_name,timeout_in_secs,output_type_id,
created_time,updated_time,user_details_id,action_id,producer_type_id)
VALUES
(1,'Fetch CPU Utilization','FetchCPUUtil',93,'fetch_cpu_util',300,233,
'2019-08-09 00:00:00','2019-08-09 00:00:00','<user_details_id>',230,1);
-- command_arguments (representative row)
INSERT INTO command_arguments
(id,command_id,is_placeholder,argument_key,argument_value,default_value,
argument_value_type_id,argument_type_id,created_time,updated_time,user_details_id)
VALUES
(1,1,0,'record_count','10','10',12,67,
'2019-08-09 00:00:00','2019-08-09 00:00:00','<user_details_id>');
Note: Placeholder arguments (credentials, host addresses, ports) use
is_placeholder = 1and store tokens such as{Username},{Password},{HostAddress}and{MonitorPort}— never literal values. Once the inserts complete, forensic collection resumes.
Forensic data collection failed due to timeout#
Symptom: Forensic data collection does not complete for a database KPI record (for example CURRENT_OPEN_CURSORS) and returns a timeout error, so no data is fetched. The affected forensic targets an Oracle database URL of the form:
jdbc:oracle:thin:@192.0.2.99:8541:<DB_SID>
Resolution:
1. Manually execute the corresponding forensic script and measure how long it takes to run:
forensic_config.sh
2. If the script legitimately needs longer than the default, increase the timeout values in forensic_config.sh:
ORA_DB_TIMEOUT=30
MSSQL_DB_TIMEOUT=30
Tune these values to match your database's response time.
Inadequate forensic visibility in the UI (bad substitution)#
Symptom: The Supervisor ResultSender.log reports a "bad substitution" error while executing a forensic script.
Cause: The custom forensic script resolves its own path with a Bash-only construct instead of readlink:
HomeDir=`dirname "${BASH_SOURCE[0]}"`
By default the Supervisor executes scripts with sh, which does not support ${BASH_SOURCE[0]} — hence the "bad substitution" error.
Resolution: Change the shell the Supervisor uses to bash (or another shell that supports the script). Edit the Supervisor config.json and update the platform block:
"platform": {
"shell": "bash",
"file_name_extension": ".sh"
},
Custom forensics#
1. Use the following endpoint to register a forensic action via API:
https://<keycloakIP>:<keycloakPort>/appsone-controlcenter/v2.0/api/accounts/<account_identifier>/actions
2. Sample JSON body:
{
"name": "test12",
"identifier": "test12",
"actionType": "Forensic Action",
"categories": ["Others","Category"],
"commandDetails": {
"name": "My test Script",
"commandName": "<Script_name>",
"commandArguments": [{
"argumentKey": "<key>",
"argumentValue": "<value>",
"defaultValue": "<default>",
"argumentType": "COMMANDLINE",
"argumentValueType": "TextBox"
}]
}
}
3. The Supervisor executes the forensic script like this:
sh <Forensic_Agent_Path>/Script.sh arg_key1=arg_value1 arg_key2=arg_value2
4. Ensure your custom script and JSON body match this execution method.
Output formatting: The script must echo AppsOne delimiters so the forensic output is parsed into sections. Separate each field with
#@#@#APPSONE_NEWLINE#@#@#, for example:echo "Name: Test#@#@#APPSONE_NEWLINE#@#@#\ Description: Result of my Custom Forensics#@#@#APPSONE_NEWLINE#@#@#\ Start Time: `date '+%m-%d-%Y, %H:%M:%S'`#@#@#APPSONE_NEWLINE#@#@#\ Execute Status: Success#@#@#APPSONE_NEWLINE#@#@#\ ReturnCode: 0#@#@#APPSONE_NEWLINE#@#@#\ KeyValueOutput: #@#@#APPSONE_NEWLINE#@#@#Output:"Each additional section in the forensic output is separated with the same delimiter. If the Task Receiver log shows the custom forensic receiving arguments, set
is_placeholder = 1for that entry's rows incommand_arguments(change it from0to1).
Forensics data unavailability#
Case 1: Custom forensics not triggered (no anomalies)#
Symptom: Forensics for a custom forensic action were not triggered because no anomalies were being generated. Flink logs showed a SIGALRM error.
Cause: The persistence/suppression settings and instance thresholds for the service had been lost from the backend database, so no anomalies (and therefore no forensics) were produced.
Resolution: Re-insert the instance thresholds and the persistence/suppression settings, then let anomalies regenerate.
1. Re-insert the instance-level thresholds in comp_instance_kpi_threshold_details.
2. Redefine the persistence and suppression settings in service_configurations:
-- persistence / suppression settings
INSERT INTO service_configurations
VALUES (id, 22, 3, '<user_details_id>', utc_timestamp(), 1, 60, 1, 2, 1, 2);
-- additional threshold window for custom forensics
INSERT INTO service_configurations
VALUES (id, 22, 3, '<user_details_id>', utc_timestamp(), 61, 1440, 1, 2, 1, 2);
3. Insert the required threshold for the custom forensic KPI:
INSERT INTO component_kpi_threshold_details
VALUES (id, 11, 493, 150, 9.0, 10.0, utc_timestamp(), '<user_details_id>', 0, NULL, 0, utc_timestamp(), 11);
Once these settings are reinstated, anomalies regenerate and forensic data collection resumes for the custom forensic.
Case 2: Certificate issue#
Symptom: Forensic data was not collected and showed as "NA".
Root cause: The signed certificate was not working as designed because the service was configured by IP address rather than DNS name.
Resolution:
1. Update the Consul key to switch the Supervisor Controller from an IP to a DNS name:
service/supervisorcontroller/198.51.100.8_SUPERVISOR_CTRL_1/ip
2. Restart the Supervisor Controller service.
Unable to retrieve forensics data for ORA_ERROR#
Symptom: Forensic data was not collected for ORA_ERROR.
Cause: The forensic script needs the log-file path passed as a parameter, but the path was null in the comp_instance_attribute_values table, so no data could be gathered.
Resolution: Update the log-file path in comp_instance_attribute_values. For example:
update comp_instance_attribute_values
set attribute_value='/u01/app/oracle/diag/rdbms/orcl/ORCL/trace/alert_ORCL.log'
where id=<id>;
With the correct path in place, forensic data for ORA_ERROR is collected.
Visibility of forensic details#
Symptom: Forensic details are not visible in the 30-minute or 1-hour window and appear only when a 4-hour window is selected. This behaviour is environment-specific.
Resolution: Set the forensic look-back and look-ahead intervals so data is visible in the shorter windows:
consul kv put service/forensic/lookbackintervalminute 5
consul kv put service/forensic/lookaheadintervalminute 5
Forensic data retrieval issue#
Symptom: Forensic data cannot be retrieved.
Resolution: The issue was resolved by correcting the agent paths in the Supervisor config.json file.
Forensic and email alert issue after DR→DC transition#
Symptom: After failing over from DR to DC, no forensic or email alerts were generated for any application. Forensic data flowed up to the A1EH queue, but the A1EM queue stopped processing normally, so queue sizes grew.
Resolution: The connection timeout was caused by the notification service still pointing at the DR setup. Disconnect it from DR and reconfigure it to communicate with the DC IP; forensic data and alerts then resume.
Next — Forensic actions run through the Supervisor, so continue with Supervisor Agent Issues and Component Agent Issues, or return to the Troubleshooting Overview.