Skip to content

Show all error messages instead of only the last one without enabling debug verbosity #1691

Open

Description

@mardonner

Problem description

I'm currently setting up workload identity federation with the cli in my pipelines. During testing, I got this error.

stackit auth activate-service-account --use-oidc
Error: could not setup authentication based on the provided service account credentials. 
Please double check if they are correctly configured.

For more details run:
  $ stackit auth activate-service-account -h

I was sure that I used the right configuration and after adding the debug verbosity, I understood what the actual issue was.

Oct 20 15:42:15.817 DBG arguments: [auth, activate-service-account, --use-oidc, --verbosity, debug]
Oct 20 15:42:15.818 DBG configuration is persisted and read from: /home/AzDevOps_azpcontainer/.config/stackit/cli-config.json
Oct 20 15:42:15.818 DBG read configuration profile "default" via 
Oct 20 15:42:15.818 DBG active configuration profile: default
Oct 20 15:42:15.818 DBG configuration keys: [allowed_url_domain: stackit.cloud, assume_yes: false, async: false, region: eu01, session_time_limit: 12h, verbosity: debug]
Oct 20 15:42:15.818 DBG parsed input values: [OnlyPrintAccessToken: false, UseOIDC: true]
Oct 20 15:42:16.299 DBG authenticating using workload identity federation
Oct 20 15:42:16.657 ERR get workload identity access token: get new access token: , status code 401, Body: {"error":"invalid_client","error_description":"assertion did not match federation requirements"}


Oct 20 15:42:16.657 ERR execute command: could not setup authentication based on the provided service account credentials. 
Please double check if they are correctly configured.

For more details run:
  $ stackit auth activate-service-account -h
Error: could not setup authentication based on the provided service account credentials. 
Please double check if they are correctly configured.

For more details run:
  $ stackit auth activate-service-account -h

The first error in the log (assertion did not match federation requirements) is what actually helps me here.

My issue here is that even though the default log level is "info", only the last error message is printed, even if there are multiple errors during cli invokation. In this case, the first error was the actual helpful one that exposed my skill issue but it was hidden from me.

Proposed solution

Print all messages according to the current log level without the need to set --verbosity debug.

Alternative solutions (optional)

Why not just set --verbosity debug always?
In many cases, invoking cli tools with debug logging is discouraged in pipelines because this log level might leak sensitive information. So I'm hesistant to just set it to debug permanently here.

Additional information

stackit --version
STACKIT CLI
Version: 0.75.0 (2026-10-16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions