-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error message discoverability for docker image push
#3396
Comments
Similar situation - particularly with ECR, which returns 404s for non-existent repositories
It would be nice to have a clearer error message from the CLI what was happening to the request upstream. |
Thanks for opening this ticket; I agree that the information is a bit sparse here, and could use some details (what was the failure?). First things first; the progress output that's shown when doing a for {
progress.Updatef(progressOutput, descriptor.ID(), "Retrying in %d second%s", delay, (map[bool]string{true: "s"})[delay != 1])
....
}
Interesting; so I would have to try to reproduce the situation, but I think an error should be both returned to the CLI, as well as logged in the daemon logs if this happens https://github.com/moby/moby/blob/7b9275c0da707b030e62c96b679a976f31f929d3/distribution/xfer/upload.go#L142-L146 retries++
if _, isDNR := err.(DoNotRetry); isDNR || retries == maxUploadAttempts {
logrus.Errorf("Upload failed: %v", err)
u.err = err
return
} The logic in that part of the code is quite involved though, so I'd have to take a closer look (does it actually update the output stream in that case?) I wanted to look into the code before replying, and did some initial digging. This comment was also interesting;
I'm wondering if the continuous "retrying" could be caused by ECR returning a different format for the error response. Looking at the "distribution spec" (which is the API specification for OCI registries);
From the above, the For the ECR case, I would expect the response to return a The "retry loop" on the daemon side uses a In that function, I see there's cases for some of the error-codes that are defined by the distribution spec; https://github.com/moby/moby/blob/7b9275c0da707b030e62c96b679a976f31f929d3/distribution/errors.go#L158-L162 case errcode.Error:
switch v.Code {
case errcode.ErrorCodeUnauthorized, errcode.ErrorCodeUnsupported, errcode.ErrorCodeDenied, errcode.ErrorCodeTooManyRequests, v2.ErrorCodeNameUnknown:
return xfer.DoNotRetry{Err: err}
} That branch handles There's also some handling for authentication issues, "unexpected" (5xx) errors, and If none of the above applies, then "other" errors are returned as-is; https://github.com/moby/moby/blob/7b9275c0da707b030e62c96b679a976f31f929d3/distribution/errors.go#L179-L183 // let's be nice and fallback if the error is a completely
// unexpected one.
// If new errors have to be handled in some way, please
// add them to the switch above.
return err In the above case (return the error as-is), the default looks to be So... sorry for the lengthy reply / rambling. To summarize;
So what could be done?
|
I ran
docker image push ...
and the output showed repeated attempts retrying to push four layers:I wish it would show an error message while retrying so I would not need to guess what the problem is. There was nothing in the docker daemon logs. If I recall correctly, even when it stops retrying, no specific error is printed.
Version:
Client:
Cloud integration: 1.0.14
Version: 20.10.6
API version: 1.41
Go version: go1.16.3
Git commit: 370c289
Built: Fri Apr 9 22:49:36 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
The text was updated successfully, but these errors were encountered: