Repository navigation
fix(no-ticket): report a missing Docker credential in the protocol format - #530
Open
cloudsmith-iduffy wants to merge 4 commits into
Open
cloudsmith-iduffy wants to merge 4 commits into
cloudsmith-iduffy wants to merge 4 commits into
Conversation
…rmat When no credential resolves, the Docker credential helper now writes "credentials not found in native keychain" to stdout. Docker then pulls without credentials, so public images work again. The guidance message stays on stderr. An empty server URL now gives the protocol message "no credentials server URL" on stdout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes match Docker’s credential-helper protocol, preserve unexpected-error handling, and include corresponding test assertions.
No open issues 🎉
What changed in this PR
This PR fixes Docker credential-helper responses so missing credentials do not prevent anonymous pulls from public Cloudsmith registries.
Changes:
- Return Docker’s exact protocol messages for missing credentials and blank server URLs.
- Update protocol tests to assert the new stdout responses.
- Document the behavior change while retaining stderr guidance and exit codes.
| File | Description |
|---|---|
cloudsmith_cli/credential_helpers/docker/runtime.py |
Add protocol error strings and type hints for _execute_get. |
cloudsmith_cli/cli/tests/commands/test_credential_helper.py |
Update assertions for missing credentials and whitespace-only input. |
CHANGELOG.md |
Describe anonymous-pull support and private-repository failure behavior. |
Review effort: Balanced
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* origin/master: (25 commits) fix(ENG-15484): accept --color on click versions before 8.2 (#582) fix(no-ticket): stop retrying unknown hosts and show backoff retries (#542) fix(no-ticket): stop credential helpers from overwriting config files that do not parse (#540) fix(no-ticket): remove the pnpm launcher when .npmrc does not exist (#539) fix(no-ticket): keep the user's Cargo registry credential provider (#532) build(deps): bump pyasn1 (#580) build(deps): bump the actions-all group with 4 updates (#577) build(deps): bump the uv-all group with 7 updates (#578) build(deps): bump alpine from `294b683` to `be26560` (#576) fix(no-ticket): keep credentials.ini sections and save missing API keys (#533) fix(no-ticket): set a default timeout on each API request (#538) fix(no-ticket): print the result count when a list is empty (#545) fix(no-ticket): escape the args in the terraformrc block (#543) fix(no-ticket): show the dependencies help for list deps (#546) fix(no-ticket): show a correct summary for the pnpm credential helper (#547) fix(no-ticket): show a clean error when the SAML IdP response is not a JSON object (#559) fix(no-ticket): show the API error when mcp cannot load the API schema (#561) fix(no-ticket): treat an empty trailing OWNER/REPO part as not given (#550) fix(no-ticket): print a skipped API error one time in copy, move and resync (#552) fix(no-ticket): save credentials.ini with mode 0600 (#553) ... # Conflicts: # CHANGELOG.md
cloudsmith-iduffy
marked this pull request as ready for review
November 3, 2026 15:25
Copilot started work to resolve merge conflicts on behalf of
cloudsmith-iduffy
November 3, 2026 15:25
…elper-not-found # Conflicts: # CHANGELOG.md Co-authored-by: cloudsmith-iduffy <178375997+cloudsmith-iduffy@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
If you are logged out, or your SAML token has expired,
docker pullof a public image from a Cloudsmith registry fails at the credential step:The cause is the stdout of
docker-credential-cloudsmith get. When no credential resolves, it exits 1 with nothing on stdout. Docker reads a helper's stdout and treats onlycredentials not found in native keychainas "no credential for this host". Any other output, including empty output, is a hard error. Docker then stops before it tries an anonymous pull. SeeerrCredentialsNotFoundMessageincredentials/error.goandGetinclient/client.goofdocker/docker-credential-helpers.With this change, the helper writes that exact string on stdout and exits 1. The guidance message stays on stderr. Docker continues without credentials:
(That run uses a temporary
HOMEandDOCKER_HOST=tcp://127.0.0.1:1, so the daemon error shows that Docker got past the credential step. Docker client 29.8.2.)An empty or whitespace-only server URL on stdin now gives the protocol's
no credentials server URLon stdout, not empty output. I also added type hints to_execute_get.I checked the other actions.
storeanderaseexit 0, andlistprints{}. Docker accepts all of these, so I left them as they are. An unexpected exception insidegetstill exits 1 with empty stdout, so Docker reports a hard error. A real failure must not look like "no credential".Type of Change
Additional Notes
What changes for users and scripts:
docker-credential-cloudsmith get(andcloudsmith credential-helper docker) now printscredentials not found in native keychainon stdout when it has no credential. A script that expects empty stdout on failure sees this line. The exit code stays 1.error getting credentials. This message tells the user less about the cause. To help, Docker connects the helper's stderr to its own stderr (ec.Stderr = os.Stderrinclient/command.go), so the "Unable to retrieve credentials" guidance still shows in the terminal.Tests: I updated the protocol tests in
cloudsmith_cli/cli/tests/commands/test_credential_helper.pyfor the not-found and blank-URL cases. The full unit suite passes.🤖 Generated with Claude Code