From e99f3c3ee66669d5542dd19a5fd3cea9c4b2aac4 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 26 Oct 2023 10:34:24 -0600 Subject: [PATCH] Report full stack trace for non-state file settings transforms (#101346) In most cases file based settings apply transformations from configuration to cluster state. However, there exists "non state" transformations as well. When these are run, any errors are stored in cluster state. This commit fixes a bug in handling of these exception cases where just the exception messages, instead of the full stack trace, was captured. --- docs/changelog/101346.yaml | 5 +++++ .../reservedstate/service/ReservedClusterStateService.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 docs/changelog/101346.yaml diff --git a/docs/changelog/101346.yaml b/docs/changelog/101346.yaml new file mode 100644 index 0000000000000..b32b123c506d1 --- /dev/null +++ b/docs/changelog/101346.yaml @@ -0,0 +1,5 @@ +pr: 101346 +summary: Report full stack trace for non-state file settings transforms +area: Infra/Settings +type: bug +issues: [] diff --git a/server/src/main/java/org/elasticsearch/reservedstate/service/ReservedClusterStateService.java b/server/src/main/java/org/elasticsearch/reservedstate/service/ReservedClusterStateService.java index 3adf32454cc20..f6d5ab3ead6af 100644 --- a/server/src/main/java/org/elasticsearch/reservedstate/service/ReservedClusterStateService.java +++ b/server/src/main/java/org/elasticsearch/reservedstate/service/ReservedClusterStateService.java @@ -239,7 +239,7 @@ public void onFailure(Exception e) { @Override public void onFailure(Exception e) { // If we encounter an error while runnin the non-state transforms, we avoid saving any cluster state. - errorListener.accept(checkAndReportError(namespace, List.of(e.getMessage()), reservedStateVersion)); + errorListener.accept(checkAndReportError(namespace, List.of(stackTrace(e)), reservedStateVersion)); } }); }