Unable to push helm chart to Quay registry prompts unexpected status: 401 UNAUTHORIZED

Solution Verified - Updated

Environment

  • Red Hat OpenShift Container Platform
    • 4.x
  • Red Hat Quay
    • 3.6.z
    • 3.7.z

Issue

  • Helm push to QUAY registry gives Error: 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 etherpad and then pushing to same repo etherpad works fine with robot account credentials.
  • However, pushing to different repo sample with robot account credentials does not work because helm would interpret it as pushing to sample/etherpad which does not work because robot accounts generally do not have repo create permissions.

Diagnostic Steps

Steps to reproduce:

  1. Created an organization called helm and create a robot account helm+helmrobot with repository etherpad

  2. 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
  1. 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)
Components
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.