-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Open
Labels
:Data Management/ILM+SLMIndex and Snapshot lifecycle managementIndex and Snapshot lifecycle management>bugTeam:Data ManagementMeta label for data/management teamMeta label for data/management team
Description
Elasticsearch Version
8.19.1
Installed Plugins
No response
Java Version
bundled
OS Version
linux
Problem Description
When previous_step_info
is truncated, it seems it is missing a "}
at the end, which breaks JSON parsing.
e.g.
"previous_step_info":{"type":"exception","reason":"<REMOVED>... (28 chars truncated),"phase_execution":
Steps to Reproduce
Not clear, need to investigate further, but assuming you need to cause an exception in an ILM stage, and then when it get's carried over it'll return invalid JSON on subsequent explain
calls.
relevant code/links:
- Fix ILMHistoryItemTests.testTruncateLongError #125814
elasticsearch/server/src/main/java/org/elasticsearch/cluster/metadata/LifecycleExecutionState.java
Lines 290 to 299 in 85f7fa9
public static String truncateWithExplanation(String input) { if (input != null && input.length() > MAXIMUM_STEP_INFO_STRING_LENGTH) { return Strings.cleanTruncate(input, MAXIMUM_STEP_INFO_STRING_LENGTH) + "... (" + (input.length() - MAXIMUM_STEP_INFO_STRING_LENGTH) + " chars truncated)"; } else { return input; } } Lines 90 to 96 in cda2669
String truncatedErrorString = LifecycleExecutionState.truncateWithExplanation(fullErrorString); if (truncatedErrorString.equals(fullErrorString) == false) { // Append a closing quote and closing brace to attempt to make it valid JSON. // There is no requirement that it actually be valid JSON, so this is // best-effort, but does not cause problems if it is still invalid. truncatedErrorString += "\"}"; }
from a quick glance, my first avenue of investigation would be the other invocation of truncateWithExplanation
not having this hack of adding the "}
Logs (if relevant)
No response
dakronestefnestor
Metadata
Metadata
Assignees
Labels
:Data Management/ILM+SLMIndex and Snapshot lifecycle managementIndex and Snapshot lifecycle management>bugTeam:Data ManagementMeta label for data/management teamMeta label for data/management team