Can't fetch helm charts from container registry

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

After update helm from 3.0.3 to 3.9.0, no helm pull (helm chart pull before) possible anymore. It fails already on helm repo add.

Steps to reproduce

On CI, helm 3.0.3:

  1. CHART_DIR=network-policy
  2. IMAGE_PATH=registry.dev/myorg/helm-charts:network-policy-1.1.1
  3. helm chart save $CHART_DIR $IMAGE_PATH
  4. helm chart push $IMAGE_PATH

image

Local, helm 3.9.0:

  1. helm registry login https://gitlab.dev (see [1])
  2. helm repo add myreg https://gitlab.dev/myorg/helm-charts: Error: looks like "https://gitlab.dev/myorg/helm-charts" is not a valid chart repository or cannot be reached: error converting YAML to JSON: yaml: line 3: mapping values are not allowed in this context
  3. helm repo add myreg https://gitlab.dev/api/v4/projects/65/packages/helm/stable: Error: looks like "https://gitlab.dev/api/v4/projects/65/packages/helm/stable" is not a valid chart repository or cannot be reached: failed to fetch https://gitlab.dev/api/v4/projects/65/packages/helm/stable/index.yaml : 401 Unauthorized
  4. helm repo add myreg https://registry.dev/myorg/helm-charts: Error: looks like "https://registry.dev/myorg/helm-charts" is not a valid chart repository or cannot be reached: failed to fetch https://registry.dev/myorg/helm-charts/index.yaml : 404 Not Found
  5. helm.sh repo add bundle https://gitlab.dev/api/v4/projects/65/packages/helm/stable: Error: looks like "https://gitlab.dev/api/v4/projects/65/packages/helm/stable" is not a valid chart repository or cannot be reached: failed to fetch https://gitlab.dev/api/v4/projects/65/packages/helm/stable/index.yaml : 401 Unauthorized
  6. helm repo add --username myuser --password $TOKEN myreg https://gitlab.dev/api/v4/projects/65/packages/helm/stable: Error: looks like "https://gitlab.dev/api/v4/projects/65/packages/helm/stable" is not a valid chart repository or cannot be reached: failed to fetch https://gitlab.dev/api/v4/projects/65/packages/helm/stable/index.yaml : 403 Forbidden (Note: "Last Used" field for the personal access token stays unchanged)
  7. curl --request POST --form 'chart=@network-policy-1.1.1.tgz' --user myuser:$TOKEN https://gitlab.dev/api/v4/projects/65/packages/helm/api/stable/charts: {"message":"403 Forbidden"} (Note: "Last Used" field for the personal access token stays unchanged)
  8. ... and many other combinations ...

[1] Tried also with:

  • gitlab.dev: routed to gitlab's ui/api
  • registry.dev: routed to gitlab's registry endpoint
cat ~/.config/helm/registry/config.json 
{
	"auths": {
		"https://gitlab.dev": {
			"auth": "YWJ..."
		},
		"https://registry.dev": {
			"auth": "YWJ..."
		},
		"https://registry.dev:443": {
			"auth": "YWJ..."
		},
		"registry.dev": {
			"auth": "YWJ..."
		}
	}
}

Token:

Token name	Scopes	Created	Last Used 	Expires	
charts	api, read_api, read_user, read_repository, write_repository, read_registry, write_registry	Jul 18, 2022	5 hours ago	Never

References:

Example Project

No example project provided.

What is the current bug behavior?

No way to pull and extract the image from gitlab.

What is the expected correct behavior?

Can pull and extract helm charts.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

# gitlab-rake gitlab:env:info

System information
System:		
Current User:	git
Using RVM:	no
Ruby Version:	2.7.5p203
Gem Version:	3.1.4
Bundler Version:2.2.33
Rake Version:	13.0.6
Redis Version:	6.2.6
Sidekiq Version:6.4.0
Go Version:	unknown

GitLab information
Version:	14.10.2
Revision:	07d12f3fd11
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	12.7
URL:		https://gitlab.dev
HTTP Clone URL:	https://gitlab.dev/some-group/some-project.git
SSH Clone URL:	ssh://git@gitlab.dev:12224/some-group/some-project.git
Using LDAP:	yes
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	13.25.1
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

Results of GitLab application Check

Expand for output related to the GitLab application check

gitlab-rake gitlab:check SANITIZE=true

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.25.1 ? ... OK (13.25.1) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) User output sanitized. Found 44 users of 100 limit.

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 2/1 ... yes 2/2 ... yes 2/3 ... yes 2/4 ... yes 2/5 ... yes 2/6 ... yes 2/7 ... yes 2/8 ... yes 2/9 ... yes 2/10 ... yes 2/11 ... yes 2/12 ... yes 2/13 ... yes 2/14 ... yes 2/15 ... yes 2/17 ... yes 2/18 ... yes 2/19 ... yes 2/20 ... yes 12/21 ... yes 12/22 ... yes 12/23 ... yes 24/24 ... yes 12/25 ... yes 12/26 ... yes 12/27 ... yes 12/29 ... yes 14/30 ... yes 16/31 ... yes 14/32 ... yes 16/33 ... yes 18/35 ... yes 19/37 ... yes 16/38 ... yes 24/39 ... yes 20/40 ... yes 20/41 ... yes 22/42 ... yes 22/43 ... yes 22/44 ... yes 24/45 ... yes 24/46 ... yes 29/51 ... yes 24/52 ... yes 24/54 ... yes 24/56 ... yes 19/57 ... yes 24/59 ... yes 24/60 ... yes 24/62 ... yes 21/63 ... yes 21/64 ... yes 24/65 ... yes 24/66 ... yes 24/67 ... yes 3/68 ... yes 19/69 ... yes 24/70 ... yes 24/71 ... yes 24/72 ... yes 24/73 ... yes 24/75 ... yes 15/76 ... yes 3/77 ... yes 24/78 ... yes 24/79 ... yes 24/80 ... yes 24/81 ... yes Redis version >= 5.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.5) Git user has default SSH configuration? ... yes Active users: ... 43 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

Edited by 🤖 GitLab Bot 🤖