Skip to content

fix(auth): keep the cause of a failed service account activation - #1767

Open
paoValle wants to merge 1 commit into
stackitcloud:mainfrom
paoValle:fix/activate-service-account-cause
Open

paoValle wants to merge 1 commit into
stackitcloud:mainfrom
paoValle:fix/activate-service-account-cause

Conversation

@paoValle

Copy link
Copy Markdown

Description

relates to #1691

A failed service account activation only reported the generic guidance, while the underlying reason was logged at error level and reachable only with --verbosity debug. ActivateServiceAccountError now carries the cause, the same way RequestFailedError already does, and the four places that discarded it set it. The existing message is kept and the cause is appended, so the failure prints its reason at the default verbosity.

The logging core is untouched on purpose: of the 496 Debug(print.ErrorLevel, ...) call sites, 461 sit in best-effort lookups that continue on success (label resolution, for instance), so printing error records at the default verbosity would put an ERR line on successful commands.

Checklist

  • Issue was linked above
  • Code format was applied: make fmt (gofmt on the changed packages; make stops on this checkout with a "multiple target patterns" parse error)
  • Examples were added / adjusted (no new parameter, not applicable)
  • Docs are up-to-date: make generate-docs
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (go test ./...)
  • No linter issues: make lint (golangci-lint run on the changed packages: 0 issues)

Activating a service account with OIDC reported only the generic guidance, and the
underlying IdP response was logged at error level but only reachable with
--verbosity debug, so the cause was hidden in the default output (issue stackitcloud#1691).

ActivateServiceAccountError now carries the underlying error, like
RequestFailedError already does, and the four sites that discarded the cause set
it. The message keeps the existing text and appends the cause, so a failed
activation prints the reason without enabling debug output. Successful commands
are unchanged: the best-effort label lookups that log at error level are still
debug-only, which is why the logging core is untouched.
@paoValle
paoValle requested a review from a team as a code owner November 30, 2026 16:26
@SerseusWasTaken

Copy link
Copy Markdown
Contributor

Hello @paoValle, thank you for opening this PR.

I have created an internal tracking issue and we will look at your contribution in the near future.

Best regards,
Jonas from the STACKIT Developer Tools team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants