Skip to content

Checks execution for ASCS/ERS clusters when SAP system is not registered - #4597

Draft
arbulu89 wants to merge 2 commits into
mainfrom
checks-execution-ascs-ers-sap-not-registered
Draft

Checks execution for ASCS/ERS clusters when SAP system is not registered#4597
arbulu89 wants to merge 2 commits into
mainfrom
checks-execution-ascs-ers-sap-not-registered

Conversation

@arbulu89

Copy link
Copy Markdown
Contributor

Description

Fix for ASCS/ERS clusters checks exectution when SAP system is not registered.
I know users should have fully database and SAP systems registered, but trento show this clusters, and the checks execution is available. I think it is good to give the chance to run the correct checks for these cases.

When a SAP system handled by the pacemaker cluster is not registered in Trento, the targets information we create is invalid, as it doesn't create any target.
This resolves not sending any valid check and wanda failing with the next error:

[error] Unable to handle message: #GenRMQ.Message<[attributes: %{priority: :undefined, timestamp: 1786372500208, type: :undefined, exchange: "trento.checks", persistent: false, user_id: :undefined, routing_key: "executions", headers: [], consumer_tag: "wanda_checks", content_type: "application/x-protobuf", delivery_tag: 9, redelivered: false, app_id: "gen_rmq", content_encoding: :undefined, correlation_id: :undefined, reply_to: :undefined, expiration: :undefined, message_id: :undefined, cluster_id: :undefined}, payload: <<10, 36, 102, 54, 50, 48, 54, 99, 54, 48, 45, 54, 52, 57, 99, 45, 52, 102, 49, 97, 45, 57, 55, 56, 99, 45, 101, 53, 57, 55, 50, 50, 101, 101, 102, 102, 53, 99, 18, 29, 103, 105, 116, 104, 117, 98, 46, 99, 111, 109, 47, 116, 114, 101, 110, 116, 111, 45, 112, 114, 111, 106, 101, 99, 116, 47, 119, 101, 98, 26, 3, 49, 46, 48, 34, 35, 84, 114, 101, ...>>]>. Reason: :no_checks_selected

This causes web staying with a spinner saying the checks are being executed forever.

As an additional improvement, the catalog won't show for this cluster checks which need ensa_version metadata information, so they cannot select the check itself.

How was this tested?

UT and some manual testing

Documentation changes

No

@arbulu89 arbulu89 added the bug Something isn't working label Aug 10, 2026
Comment thread lib/trento/clusters.ex
hosts_data =
Repo.all(
from h in HostReadModel,
join: a in ApplicationInstanceReadModel,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment:
this join is the issue.
If no ApplicationInstance is available (which can happen if the SAP system is not fully registered), it would return an empty list, so we wouldn't send any valid target.

@arbulu89 arbulu89 changed the title Checks execution ascs ers sap not registered Checks execution for ASCS/ERS clusters when SAP system is not registered Aug 10, 2026
@arbulu89
arbulu89 requested a lite review from Copilot August 12, 2026 06:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes on-demand checks execution for ASCS/ERS clusters when the related SAP system is not registered in Trento (previously resulting in invalid/empty targets and a stuck “checks running” UI state). It also introduces an explicit “unknown” ENSA version to allow checks execution and selection to behave predictably when ENSA metadata can’t be derived.

Changes:

  • Build ASCS/ERS checks execution targets from active cluster hosts (not from registered SAP system/application instance joins), preventing empty target sets when the SAP system is missing.
  • Derive cluster ENSA version with a fallback to unknown when no matching SAP system data is available.
  • Update frontend ENSA version selector to return unknown when no SAP systems are present, and extend unit coverage for this case.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/trento/clusters_test.exs Updates ASCS/ERS execution tests for broader host targeting and adds coverage for unregistered SAP system → unknown ENSA version.
lib/trento/clusters/enums/cluster_ensa_version.ex Extends cluster ENSA enum with a new :unknown value.
lib/trento/clusters.ex Fixes ASCS/ERS checks execution target selection and ENSA version derivation with an unknown fallback.
assets/js/state/selectors/cluster.test.js Adds test coverage for returning UNKNOWN_ENSA_VERSION when SAP systems are absent.
assets/js/state/selectors/cluster.js Updates ENSA selector logic and introduces UNKNOWN_ENSA_VERSION constant.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@arbulu89
arbulu89 requested a review from skrech August 13, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants