Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update Helm chart dependencies if there is any Helm OCI repository configured #5856

Closed
3 tasks done
lsolovey opened this issue Mar 24, 2021 · 3 comments · Fixed by #5887
Closed
3 tasks done
Labels
bug Something isn't working
Milestone

Comments

@lsolovey
Copy link

lsolovey commented Mar 24, 2021

If you are trying to resolve an environment-specific issue or have a one-off question about the edge case that does not require a feature then please consider asking a question in argocd slack channel.

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

Argo CD fails to update Helm chart dependencies if there is any Helm OCI repository configured in the system.
This OCI repository may not be even used, it just needs to be added to Argo CD to cause the issue.

It looks like Argo CD is trying to execute helm repo add ... command for every registered Helm repository before running helm dependency update. If there is Helm OCI repository registered in Argo CD, helm repo add ... fails for such OCI repo.

time="2021-03-24T15:19:21-04:00" level=fatal msg="rpc error: code = InvalidArgument desc = application spec is invalid: InvalidSpecError: Unable to generate manifests in application-chart: rpc error: code = Unknown desc = ``helm repo add --username ****** --password ****** test-helm-oci-repo myregistry.azurecr.io/helm`` failed exit status 1: Error: could not find protocol handler for:

As far as I understand helm repo add ... doesn't work with Helm OCI repos, so probably Helm OCI repos should be excluded from helm repo add ... step.

To Reproduce

Please refer to the sample project: https://github.com/lsolovey/argocd-helm-oci

  1. Add any Helm OCI repository. It’s not going to be used by our application, it just needs to be added to Argo CD:

argocd repo add myregistry.azurecr.io/helm --type helm --name test-helm-oci-repo --enable-oci --username <username> --password <password>

  1. Create new Application pointing to the Helm chart which has some dependencies declared in Chart.yaml

argocd app create sample-app --dest-namespace argocd --dest-server https://kubernetes.default.svc --repo https://github.com/lsolovey/argocd-helm-oci.git --path application-chart --sync-policy auto

Application creation fails with the error mentioned above.

Expected behavior

Application should be created successfully.

Version

argocd: v1.8.7+eb3d1fb
  BuildDate: 2021-03-03T07:16:29Z
  GitCommit: eb3d1fb84b9b77cdffd70b14c4f949f1c64a9416
  GitTreeState: clean
  GoVersion: go1.14.12
  Compiler: gc
  Platform: windows/amd64
argocd-server: v1.8.7+eb3d1fb
  BuildDate: 2021-03-03T07:13:34Z
  GitCommit: eb3d1fb84b9b77cdffd70b14c4f949f1c64a9416
  GitTreeState: clean
  GoVersion: go1.14.12
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: v0.13.1
  Kustomize Version: v3.8.1 2020-07-16T00:58:46Z
  Helm Version: v3.4.1+gc4e7485
  Kubectl Version: v1.17.8
  Jsonnet Version: v0.17.0
@lsolovey lsolovey added the bug Something isn't working label Mar 24, 2021
@AustinSmart
Copy link
Contributor

AustinSmart commented Mar 24, 2021

I've just run into the same issue. Indeed OCI Helm repositories do not support helm repo add

This may be the source of the issue:

_, err := h.cmd.RepoAdd(repo.Name, repo.Repo, repo.Creds)

err = h.DependencyBuild()

err = h.DependencyBuild()

@alexmt alexmt added this to the v2.0 milestone Mar 26, 2021
alexmt pushed a commit that referenced this issue Mar 29, 2021
fix: Use helm login for Oci helm repos. #5856 (#5887)

Signed-off-by: Austin Smart <austin@austinsmart.com>
alexmt pushed a commit that referenced this issue Mar 29, 2021
fix: Use helm login for Oci helm repos. #5856 (#5887)

Signed-off-by: Austin Smart <austin@austinsmart.com>
sbose78 pushed a commit to sbose78/argo-cd that referenced this issue Mar 30, 2021
fix: Use helm login for Oci helm repos. argoproj#5856 (argoproj#5887)

Signed-off-by: Austin Smart <austin@austinsmart.com>
@lsolovey
Copy link
Author

lsolovey commented Apr 6, 2021

Thanks @AustinSmart for fixing this. I installed v2.0.0-rc2 and verified the fix.

shubhamagarwal19 pushed a commit to shubhamagarwal19/argo-cd that referenced this issue Apr 15, 2021
fix: Use helm login for Oci helm repos. argoproj#5856 (argoproj#5887)

Signed-off-by: Austin Smart <austin@austinsmart.com>
@m-yosefpor
Copy link
Contributor

m-yosefpor commented Aug 14, 2021

I'm facing a similar issue with argocd v2.1-rc3 (however when using OCI charts as dependencies)

rpc error: code = Unknown desc = Manifest generation error (cached): `helm repo add registry.private.snappcloud.io oci://registry.private.snappcloud.io/emq` failed exit status 1: Error: looks like "oci://registry.private.snappcloud.io/emq" is not a valid chart repository or cannot be reached: tag explicitly required

argocd version:

argocd-server: v2.1.0-rc3+5700faf
  BuildDate: 2021-08-11T19:44:44Z
  GitCommit: 5700faf0d17dacad93c5fe96edd42fb6dd1ae7b1
  GitTreeState: clean
  GoVersion: go1.16.5
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: v0.13.1
  Kustomize Version: v4.2.0 2021-06-30T22:49:26Z
  Helm Version: v3.6.0+g7f2df64
  Kubectl Version: v0.21.0
  Jsonnet Version: v0.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants