Unable to push helm chart to Quay registry prompts unexpected status: 401 UNAUTHORIZED
Environment
- Red Hat OpenShift Container Platform
- 4.x
- Red Hat Quay
- 3.6.z
- 3.7.z
Issue
- Helm
pushto QUAY registry givesError: unexpected status: 401 UNAUTHORIZED
$ helm push etherpad-0.0.4.tgz oci://quayregistry.example.com/user1/helm
Error: unexpected status: 401 UNAUTHORIZED
Resolution
- Helm interprets repo by assuming that the repo used to push is the name of the chart.
- Example: Creating a chart named
etherpadand then pushing to same repoetherpadworks fine withrobot account credentials. - However, pushing to different repo
samplewith robot account credentials does not work because helm would interpret it as pushing tosample/etherpadwhich does not work becauserobot accountsgenerallydo not have repo create permissions.
Diagnostic Steps
Steps to reproduce:
-
Created an organization called
helmand create a robot accounthelm+helmrobotwith repositoryetherpad -
Login to QUAY registry
quayregistry.example.com
bash-4.4$ helm registry login -u="helm+helmrobot" -p="Y5IWE3JPQH5UMWFJL78UJD4XEDTGP09UDV78PSZYM1E0WMHFI8SME1WS8F32D3YN" quayregistry.example.com
WARNING: Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
- Push to the QUAY registry
bash-4.4$ helm push ../helm-chart/etherpad-0.0.4.tgz oci://quayregistry.example.com/helm
Pushed: quayregistry.example.com/helm/etherpad:0.0.4
Digest: sha256:506ea8be1cf22c3329f4b8c6b0e8db2d33572544133d4a8c5bab542c232496e2 <---- was successful push
bash-4.4$
- pushing to different repo other than the chart-name . created another repository "sample" and gave write permission.
bash-4.4$ helm push ../helm-chart/etherpad-0.0.4.tgz oci://quayregistry.example.com/helm/sample
Error: unexpected status: 401 UNAUTHORIZED <---- Was unsuccessful because robot account does not have permission to create repo "sample/etherpad".
Product(s)
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.