Bug 1902456
Summary: | Improvement of log error messages in builds | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | David Hernández Fernández <dahernan> |
Component: | Image Registry | Assignee: | Oleg Bulatov <obulatov> |
Status: | CLOSED DEFERRED | QA Contact: | wewang <wewang> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4.8 | CC: | adam.kaplan, aos-bugs, dgoodwin, obulatov, wewang, wking |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Cause: error handling considers "access denied" error only as "authentication required".
Consequence: bug causes incorrect error log, that may lead to confusions.
Fix: through docker distribution error handling changed error output from "authentication required" to "access denied"
Result: "access denied" error gives more precise error logs
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2023-03-09 01:00:18 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
David Hernández Fernández
2020-11-29 09:27:52 UTC
This can be a bit challenging to improve for builds. The error message reported here comes from buildah, which has no special knowledge about the OpenShift image registry. For the internal registry it uses pull secret from the build controller, and pulls from the internal registry just like any other OCI/Docker image registry. CC-ing Oleg - is "unauthorized: authentication required" coming from the image registry HTTP response? Is this something we can improve? I was just checking some options, hence the lowest priority is set. If it can be improved it would help the user experience and checks of builds set up, but if it is relying on such external factors and it's too much complicated or time-consuming, just let us know. That's how Docker Distribution works: first the client gets a token with a desired scope, then it uses it. If your credentials are not enough to get such a token, then you get Unauthorized [1]. The Docker client has additional logic how to handle these errors [2], we need to further investigate ability to use it. [1]: https://github.com/distribution/distribution/blob/a01c71e2477eea211bbb83166061e103e0b2ec95/registry/handlers/app.go#L844-L851 [2]: https://github.com/distribution/distribution/blob/a01c71e2477eea211bbb83166061e103e0b2ec95/registry/client/errors.go#L110-L113 it can be reproduced: [wewang@localhost ~]$ oc logs -f build/django-ex-2 Cloning "https://github.com/sclorg/django-ex.git" ... Commit: 7cbc59619cb3ad23d32a06a398592da3eb34388c (Merge pull request #181 from sclorg/dependabot/pip/django-debug-toolbar-1.11.1) Author: Lumír 'Frenzy' Balhar <lbalhar> Date: Mon Apr 19 08:01:14 2021 +0200 time="2021-09-22T02:17:08Z" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled" I0922 02:17:08.905212 1 defaults.go:102] Defaulting to storage driver "overlay" with options [mountopt=metacopy=on]. Caching blobs under "/var/cache/blobs". Warning: Pull failed, retrying in 5s ... Warning: Pull failed, retrying in 5s ... Warning: Pull failed, retrying in 5s ... error: build error: After retrying 2 times, Pull image still failed due to error: unauthorized: authentication required PR is in wip status Verified in version: 4.9.0-0.ci.test-2021-09-28-013422-ci-ln-n8rjjs2-latest [wewang@localhost ~]$ oc logs -f build/django-ex-1 Cloning "https://github.com/sclorg/django-ex.git" ... Commit: 7cbc59619cb3ad23d32a06a398592da3eb34388c (Merge pull request #181 from sclorg/dependabot/pip/django-debug-toolbar-1.11.1) Author: Lumír 'Frenzy' Balhar <lbalhar> Date: Mon Apr 19 08:01:14 2021 +0200 time="2021-09-28T02:21:17Z" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled" I0928 02:21:17.046017 1 defaults.go:102] Defaulting to storage driver "overlay" with options [mountopt=metacopy=on]. Caching blobs under "/var/cache/blobs". Warning: Pull failed, retrying in 5s ... Warning: Pull failed, retrying in 5s ... Warning: Pull failed, retrying in 5s ... error: build error: After retrying 2 times, Pull image still failed due to error: errors: denied: requested access to the resource is denied [1] introduced a regression, and it was reverted in master/4.11 in bug 2060605 , with a revert in flight for 4.10 in bug 2060610. Moving this back to ASSIGNED so you can take another run at it. [1]: https://github.com/openshift/image-registry/pull/291 OpenShift has moved to Jira for its defect tracking! This bug can now be found in the OCPBUGS project in Jira. https://issues.redhat.com/browse/OCPBUGS-8821 |