Skip to content

doctl registry commands fail with 412 for multi-registry accounts without clear error or guidance #1813

@silvercondor

Description

@silvercondor

Description

All doctl registry subcommands (repository list-v2, repository list-manifests, repository delete-manifest, etc.) fail with an opaque 412 error when the account has multiple container registries, even though the --registry flag is documented as "optional."

This appears to be a server-side API change — these commands previously worked without --registry. There was no deprecation notice, changelog entry, or doctl release noting this breaking change.

Steps to Reproduce

  1. Have a DigitalOcean account with multiple container registries
  2. Run any registry command without --registry:
doctl registry repository list-v2 --output json

Expected Behavior

Either:

  • A clear CLI-level error message like: Error: multiple registries found. Please specify one with --registry <name>. Available: reg1, reg2
  • Or the command prompts the user to select a registry

Actual Behavior

Raw API error passed through:

{
  "errors": [
    {
      "detail": "failed to get registry: GET https://api.digitalocean.com/v2/registry: 412 (request \"...\") This API is not supported if you have created multiple registries. Please use '/v2/registries/{registry_name}' instead. Refer to https://docs.digitalocean.com/reference/api/digitalocean/#tag/Container-Registry for more info."
    }
  ]
}

Suggested Fix

  • Detect multi-registry accounts in doctl and surface a user-friendly error with available registry names
  • Update the --registry flag description — it's not truly "optional" for multi-registry accounts
  • Document this as a breaking change for users who previously had a single registry and later created a second one

Environment

  • doctl version: 1.151.0 (also reproduced with 1.141.0 via digitalocean/action-doctl@v2)
  • Affected commands: registry get, registry repository list-v2, registry repository list-manifests, registry repository delete-manifest, registry garbage-collection start

Impact

This silently broke CI/CD pipelines (GitHub Actions cron jobs) that were using doctl registry commands without --registry. The workaround is to add --registry <name> to every command (or positional arg for garbage-collection start).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions