Skip to content

Service Account Key Creation: -o json produces invalid JSON #1527

Description

@codello

Description

When running stackit service-account key create -e <sa-email> -o json the output is not pure JSON. Before the JSON output there is an extra line Created key for service account <sa-email> with ID "<some-id>".

Steps to reproduce

  1. Run stackit service-account create -n mytest
  2. Run stackit service-account key create -e <sa-email> -o json > sa.json
  3. Run cat sa.json | jq. Observe an error
  4. Inspect sa.json and see that it is not valid JSON

Actual behavior

The JSON output looks like this:

Created key for service account <sa-email> with ID "<some-id>"
{
  "active": true,
  "createdAt": "2026-08-07T14:03:18Z",
  ...

Expected behavior

I expect the output to be valid JSON:

{
  "active": true,
  "createdAt": "2026-08-07T14:03:18Z",
  ...

Environment

  • OS: macOS 26.5.2
  • Version of STACKIT CLI (see stackit --version): v0.70.0

Additional information

This is new behavior in one of the latest releases. I can't pinpoint the exact CLI version that introduced this behavior. A week or so ago I didn't observe this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions