Skip to content

improve error message when registry credential config is not valid #1236

Closed

Description

@qweeah

E.g. pulling an artifact and the target credential cannot be found in the config, current output will be like:

$ oras pull localhost:7000/repo:tag --registry-config auth.config
Error: failed to resolve tag: GET "http://localhost:7000/v2/repo/manifests/tag": credential required for basic auth

The error message is not helpful since

  1. It's purely a local error but contains details like HTTP method and URI
  2. Doesn't mention how to fix the issue

Suggest to change the error to sth like:

$ oras pull localhost:7000/repo:tag --registry-config auth.config
Error: failed to authenticate when attempting to pull: no valid credential found in auth.config
Please check whether the registry credential stored in the authentication file is correct

Activity

  1. added
    ux
    on Jan 9, 2024
  2. added this to the v1.2.0 milestone on Jan 9, 2024
  3. self-assigned this
    on Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ux

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions