Skip to content

v1.158.0 cannot parse config files it writes — "yaml: line 2228: did not find expected key" #1842

@dfinley

Description

@dfinley

Summary

doctl v1.158.0 (released 2026-05-07 16:21 UTC) cannot read its own config files. Every doctl invocation fails at startup with:

doctl: 2026/05/07 21:08:20 Config initialization failed: While parsing config: yaml: line 2228: did not find expected key

v1.157.0 reads the same file successfully — verified.

Reproduction

  1. Install doctl v1.158.0
  2. Run any doctl command (auth init, auth list, registry login, etc.)
  3. The first invocation may write a default config (37,883 bytes / 2,227 lines on Linux x86_64); subsequent invocations fail to read it.

The error appears at line 2228 of a 2227-line file — i.e., doctl's parser expects more YAML content than the writer produced. The file ends mid-section with vpcs.update.name: "".

Evidence the file itself is valid YAML

yaml.safe_load (PyYAML) parses the file successfully:

  • 91 top-level keys
  • Well-formed structure (1-click, access-token, account, action, activations, agent, alert, api-url, apikeys, apps, ...)

So the failure is in doctl's parser, not the file.

Evidence v1.157.0 reads the same file

$ wget https://github.com/digitalocean/doctl/releases/download/v1.157.0/doctl-1.157.0-linux-amd64.tar.gz
$ tar xf doctl-1.157.0-linux-amd64.tar.gz
$ ./doctl --config=/home/USER/.config/doctl/config.yaml auth list
default (current)        # <-- success on the same file v1.158.0 fails on

Suspected commit

The v1.157.0 → v1.158.0 changelog has only 2 commits:

#1835 is the prime suspect — config schema additions can produce serialization output that the parser doesn't expect.

Impact

  • All CI runs using digitalocean/action-doctl@v2 (which defaults to version: 'latest') broke today within hours of the v1.158.0 release.
  • Workaround: pin to version: '1.157.0' in workflow input.
  • Long-term users with shared doctl config homes (e.g., self-hosted runners) are affected even after pinning, since the broken file persists until manually cleared. v1.157.0 reads the v1.158.0-written file fine, so the workaround does not require config cleanup.

Environment

  • doctl: v1.158.0
  • OS: Ubuntu (self-hosted GitHub Actions runner, Linux x86_64)
  • Action: digitalocean/action-doctl@v2 with version: 'latest' (default)

Workaround applied on our side

Pinning version: '1.157.0' in all digitalocean/action-doctl@v2 callsites until v1.159.0 (or v1.158.x) ships a fix.

Happy to provide the corrupted config file (with secrets redacted) on request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions