epics-containers / epics-containers.github.io

Kubernetes for EPICS IOCs. Documentation for the epics-containers organization
https://epics-containers.github.io/
Apache License 2.0
15 stars 6 forks source link

Troubleshooting helm or docker authorization #123

Closed gilesknap closed 2 weeks ago

gilesknap commented 4 months ago

This is worth writing up as it is a nasty gotcha.

If you see an error like that at the bottom if this issue then it could be because helm has cached a personal access token that has expired.

When you do authenticate to the GHCR using docker login or helm registry login you would usually supply a Personal Access Token. At least in the case of helm this will then fail even for public packages when that PAT expires.

In the case of helm you can see the entry in `$HOME/.config/helm/registry.json' - deleting it will fix the issue (for public registries - if you do want to access a private then you will need to make a new PAT and login with it again)

anecdotally docker suffers from the same issue - need to look into where docker caches credentails.

hgv27681@pc0116 work/bl47p (main) » ec deploy bl47p-ea-dcam-02 2024.4.1

Command Failed:
helm dependency update /tmp/tmp8xcw7ge0/services/bl47p-ea-dcam-02/../../helm/shared
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "gitlab" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading ioc-instance from repo oci://ghcr.io/epics-containers
Save error occurred:  could not download oci://ghcr.io/epics-containers/ioc-instance: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://ghcr.io/token?scope=repository%3Aepics-containers%2Fioc-instance%3Apull&service=ghcr.io: 403 Forbidden

Error: could not download oci://ghcr.io/epics-containers/ioc-instance: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://ghcr.io/token?scope=repository%3Aepics-containers%2Fioc-instance%3Apull&service=ghcr.io: 403 Forbidden
gilesknap commented 2 weeks ago

Not seeing this issue any more - particularly with Argo CD that only uses helm for templating but also with raw helm deployments.