argo-cd: Wildcard support in OCI Helm repositories does not work

Checklist:

  • I’ve searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I’ve included steps to reproduce the bug.
  • I’ve pasted the output of argocd version.

Describe the bug

I try to create an application from an OCI Helm repository with wildcard (*) as version instead of explicitly specifying the version of the chart which fails with the following error:

Unable to create application: application spec for x is invalid: InvalidSpecError: Unable to generate manifests in : rpc error: code = Unknown desc = unable to get tags: failed to get tags: unable to decode json: invalid character '<' looking for beginning of value

As seen here: 2

When I instead pin the version it does work as expected: 3

To Reproduce

The repository is Harbor: 1

Expected behavior

It should work as described in #10641

Screenshots

Version

argocd-server: v2.6.1+3f143c9
  BuildDate: 2023-02-08T18:51:05Z
  GitCommit: 3f143c9307f99a61bf7049a2b1c7194699a7c21b
  GitTreeState: clean
  GoVersion: go1.18.10
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v4.5.7 2022-08-02T16:35:54Z
  Helm Version: v3.10.3+g835b733
  Kubectl Version: v0.24.2
  Jsonnet Version: v0.19.1

Logs

Paste any relevant application logs here.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 34 (12 by maintainers)

Most upvoted comments

@wardenlym just to clarify, even with latest master, you still get a 404? what is the registry/repoURL combination do you use?

The combination I used before was:

  sources:
    - chart: chart-name
      repoURL: myreg.azurecr.io/helm-chart/charts

After seeing your suggestion, I updated to latest master and changed form to:

  sources:
    - chart: helm-chart/charts/chart-name
      repoURL: myreg.azurecr.io

and now it works fine.

Maybe related issue, GHCR and ArgoCD 2.6.1.

I get a 404 trying using this snippet:

chart: metacontroller-helm
repoURL: ghcr.io/metacontroller
targetRevision: v4.7.*

and a rpc error: code = Unknown desc = unable to get tags: failed to get tags: failed tags part: invalid response: 401 Unauthorized {"errors":[{"code":"UNAUTHORIZED","message":"authentication required"}]} trying to use this:

chart: metacontroller/metacontroller-helm
repoURL: ghcr.io
targetRevision: v4.7.*

Instead, pinning the targetRevision: v4.7.8 works fine

Maybe related issue, GHCR and ArgoCD 2.6.1, got a 404 error while specifying a wildcard

Unable to create application: application spec for test is invalid: InvalidSpecError: Unable to generate manifests in : rpc error: code = Unknown desc = unable to get tags: failed to get tags: failed tags part: invalid response: 404 Not Found {"error":"Not Found"}

But when specifying the correct version its working.

Yes, we could do -

helm pull oci://registry.gitlab.com/<path> --version "2.1.*"

and even

helm pull oci://registry.gitlab.com/<path> --version "*"

Looking at the code a bit it fails probably here and if we are not wrong, it is implemented considering AWS ECR API specification.

Nope that’s implemented considering the OCI spec.

Ah, forgot that. Closing again. 😆

@mchudinov, it’s not yet released - it’s due for 2.8. Try the latest master and see if the problem persists.

Maybe related issue, GHCR and ArgoCD 2.6.1, got a 404 error while specifying a wildcard

Unable to create application: application spec for test is invalid: InvalidSpecError: Unable to generate manifests in : rpc error: code = Unknown desc = unable to get tags: failed to get tags: failed tags part: invalid response: 404 Not Found {"error":"Not Found"}

But when specifying the correct version its working.

I’m seeing the same error message as @OpsMaya reported above, but with Azure CR and ArgoCD 2.6.7.

To clarify, is it likely to be the same root cause as the other reports here (with the mention of json in the error message), or is it a separate issue?

Same issue, when upgrading from 2.5.5 to 2.6.1

We are facing somewhat similar issue with Gitlab OCI registry for helm charts.

When we try to use "*" in targetRevision to pick the latest helm chart from the OCI registry, we receive the following error -

Unable to save changes: application spec for <app_name> is invalid: InvalidSpecError: Unable to generate manifests in : rpc error: code = Unknown desc = unable to get tags: failed to get tags: failed tags part: invalid response: 401 Unauthorized {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"reposito...

Looking at the code a bit it fails probably here and if we are not wrong, it is implemented considering AWS ECR API specification.

Note that if we use a fixed version in targetRevision it does not fail because it skips the GetTags call.

Hey @alexef, We use https://artifacthub.io/packages/helm/bitnami/harbor/15.2.2 to deploy our Harbor instance on AKS. Should be quite easy to setup and reproduce with that helm chart. If there is anything else I can do to help with debugging this please tell me.