Skip to content

improve error message when namespace is not specified in the reference of Dockerhub artifacts #1216

@qweeah

Description

@qweeah

Users might forget to add the namespace (e.g. library #1151) when pulling or copying Dockerhub images and get unexpected 401. Need to improve the error message and suggest user to add namespace.

Current behavior

$ oras pull docker.io/nginx:latest
Error: failed to resolve latest: GET "https://registry-1.docker.io/v2/nginx/manifests/latest": response status code 401: unauthorized: authentication required: [map[Action:pull Class: Name:nginx Type:repository]]

Suggested error message:

$ oras pull docker.io/nginx:latest
Error response from registry: pull access denied for docker.io/nginx:latest : response status code 401: unauthorized: requested access to the resource is denied
Namespace is missing, do you mean `oras pull docker.io/library/nginx:latest`? 

Metadata

Metadata

Assignees

No one assigned

    Labels

    uxUser experience related

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions