Interview Prep/Helm/Dependencies, Repositories & OCI

`Error: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://ghcr.io/token?...: 401 Unauthorized` on `helm pull oci://ghcr.io/...`

BeginnerTroubleshootingDependencies, Repositories & OCI
Answer

Likely causes → Not logged in, expired token, token lacking read:packages, or the package is private and the token's user has no access.

Diagnose → cat "$(helm env HELM_REGISTRY_CONFIG)" | jq '.auths | keys'.

Fix → echo $TOKEN | helm registry login ghcr.io -u <user> --password-stdin, with a token that has package read rights; grant the repo access to the package.

Prevent → In GitHub Actions use GITHUB_TOKEN with packages: read and link the package to the repository.

All Helm questions Roadmap: Helm

More on Dependencies, Repositories & OCI