[Alerting][TaskManager] Skip UIAM conversion retries for org-membership failures#271929
Merged
ersin-erdal merged 2 commits intoMay 29, 2026
Conversation
…ip failures
Adds the UIAM convert error code `0xBE2B58` ("API key creator is not a
member of organization") to the list of permanent UIAM conversion
failures, alongside the existing `0x357391` ("API key creator is not a
Cloud user"). Rules and tasks whose `uiam_api_keys_provisioning_status`
SO carries any of these codes are excluded from future provisioning
attempts.
Introduces a shared `PERMANENT_UIAM_CONVERSION_ERROR_CODES` list so
new codes can be added in a single place. The exclusion KQL filter now
ORs over the list inside the `FAILED` branch.
Source for error codes:
https://github.com/elastic/uiam/blob/main/modules/domain/src/main/java/co/elastic/cloud/uiam/domain/errors/ErrorCode.java
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Pinging @elastic/response-ops (Team:ResponseOps) |
darnautov
approved these changes
May 29, 2026
darnautov
reviewed
May 29, 2026
Comment on lines
+42
to
+46
| export const API_KEY_CREATOR_NOT_ORG_MEMBER_ERROR_CODE = '0xBE2B58'; | ||
| export const PERMANENT_UIAM_CONVERSION_ERROR_CODES: readonly string[] = [ | ||
| NON_CLOUD_USER_API_KEY_CREATOR_ERROR_CODE, | ||
| API_KEY_CREATOR_NOT_ORG_MEMBER_ERROR_CODE, | ||
| ]; |
Contributor
There was a problem hiding this comment.
we already have a package @kbn/uiam-api-keys-provisioning-status, shall we consolidate these codes there?
Contributor
Author
There was a problem hiding this comment.
Good call — done in ba5d286. The two codes plus PERMANENT_UIAM_CONVERSION_ERROR_CODES now live in @kbn/uiam-api-keys-provisioning-status alongside the status/entity enums; the alerting and task_manager plugins import them from there.
Moves NON_CLOUD_USER_API_KEY_CREATOR_ERROR_CODE, API_KEY_CREATOR_NOT_ORG_MEMBER_ERROR_CODE and the PERMANENT_UIAM_CONVERSION_ERROR_CODES list from per-plugin constants into the shared @kbn/uiam-api-keys-provisioning-status package, so alerting and task_manager consume them from a single source of truth. Addresses review feedback on elastic#271929. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the UIAM API key provisioning task (rules and tasks) so it stops
retrying rules/tasks that hit a permanent UIAM conversion failure with
error code
0xBE2B58:It joins the existing permanent failure code
0x357391("ES API key creator is not a Cloud user").What changed
PERMANENT_UIAM_CONVERSION_ERROR_CODESin bothalerting/server/provisioning/constants.tsandtask_manager/server/uiam_api_key_provisioning/constants.ts, groupingNON_CLOUD_USER_API_KEY_CREATOR_ERROR_CODE(0x357391) and the newAPI_KEY_CREATOR_NOT_ORG_MEMBER_ERROR_CODE(0xBE2B58).getExcludeRulesFilterandgetExcludeTasksFilternowORover that list inside theFAILEDbranch, so any rule/task whose persisteduiam_api_keys_provisioning_statusdoc carries one of these codes is excluded from future provisioning attempts.ORof every known permanent code (so a future code added to the list will fail the test until covered).The persistence side already writes the UIAM
codeonto the status doc viamap_convert_response_to_result.ts, so no additional plumbing was needed.To verify
config/kibana.dev.ymlsetfeature_flags.overrides.alerting.rules.provisionUiamApiKeys: trueand restart Kibana withyarn start --serverless oblt --run-examples.0xBE2B58; with a non-Cloud user for0x357391).attributes.status: "failed"andattributes.errorCodeset to0x357391or0xBE2B58.Made with Cursor