fix: propagate registry auth error in swarm image pull - #52698
Merged
vvoland merged 1 commit intoJun 12, 2026
Conversation
Contributor
|
Hi, please sign-off the commit with your real name: https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work |
Author
|
Friendly ping — this PR is ready for review. All CI checks are passing. |
MD-Mushfiqur123
force-pushed
the
fix/issue-52570-swarm-auth-error
branch
from
May 27, 2026 07:12
3921dc9 to
5f42ea8
Compare
Contributor
|
Oh, could you please also remove the |
Contributor
|
@md-mushfiqur-rahim123-official can you please update? |
When a worker pull fails with unauthorized, the error was being swallowed and replaced with misleading 'No such image' message. Fix error propagation so the actual cause is reported. Signed-off-by: Md_Mushfiqur Rahim <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah
force-pushed
the
fix/issue-52570-swarm-auth-error
branch
from
June 12, 2026 13:38
5f42ea8 to
a7cf7ea
Compare
thaJeztah
approved these changes
Jun 12, 2026
thaJeztah
left a comment
Member
There was a problem hiding this comment.
LGTM
(rebased and adjusted the commit message)
Member
|
Flaky tests on Windows; |
smerkviladze
added a commit
to smerkviladze/moby
that referenced
this pull request
Jul 27, 2026
A task whose image cannot be pulled is rejected outright when the registry answers with an "unauthorized" error, even when the image is already present on the node. A service created without registry credentials carries no auth in its spec and cannot have its digest resolved, so its tasks always attempt an unauthenticated pull; on nodes that already hold the image those tasks are rejected instead of started. Tolerating a failed pull when the image is available locally is long-standing behaviour, described in the comment above the check, and what the executor did for every pull error before a7cf7ea ("fix: propagate registry auth error in swarm image pull", moby#52698). Keep reporting the pull failure, as it is far more useful than the "No such image" the container create would otherwise produce, but only when the image really is unavailable. Whether a task can run should not depend on how the registry error happened to be classified, and that classification is not consistent: the same registry 401 surfaces as ErrUnauthenticated from the graphdriver pull path, as ErrNotFound from the containerd image store (via docker.ErrInvalidAuthorization), and as ErrUnknown when the failure happens while fetching a token, since the error is then a *url.Error that translatePullError does not classify. The check therefore only fires for some combinations of image store and registry. The test needs DOCKER_SERVICE_PREFER_OFFLINE_IMAGE=0 on the daemon under test: internal/testutil/daemon sets it to 1, which makes the executor skip the pull altogether. Signed-off-by: Sopho Merkviladze <[email protected]>
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.
Fixes #52570
When a worker pull fails with 'unauthorized: authentication required',
the error was being swallowed and replaced with a misleading
'No such image' message. This fix ensures the actual registry error
is propagated so operators see the real cause.