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

Multiple Sources Application doesn't work if source reference repository is not defined first #18264

Closed
3 tasks done
dalwar23 opened this issue May 17, 2024 · 6 comments
Closed
3 tasks done
Labels
bug Something isn't working multi-source-apps Bugs or enhancements related to multi-source Applications.

Comments

@dalwar23
Copy link

dalwar23 commented May 17, 2024

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

While creating a multiple sources application with helm chart being hosted in Azure OCI container registry and values files are in GitLab (https://gitlab.com) I followed the process mentioned here.

---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: acr-gitlab-argocd-test
  namespace: argocd
spec:
  project: default
  sources:
    - chart: helm3charts/myChart
      repoURL: 'myacrregistry.azurecr.io'
      targetRevision: '1.0.15'
      helm:
        releaseName: acr-gitlab-argocd-test
        valueFiles:
          - $helmValues/stacks/workload/helm/dev/values.yaml
    - repoURL: 'git@gitlab.com:myProject/infrastructure.git'
      targetRevision: HEAD
      ref: helmValues
  destination:
    namespace: acr-gitlab-argocd-test
    name: in-cluster
  syncPolicy:
    syncOptions:
      - CreateNamespace=true

Apply the manifest with kubectl

kubectl apply -f test.yaml --validate='strict'

When Sync button is clicked the following error appears.

image

But if we change the position of the repositories in the sources list like below this works 👇

---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: acr-gitlab-argocd-test
  namespace: argocd
spec:
  project: default
  sources:
    - repoURL: 'git@gitlab.com:myProject/infrastructure.git'   # <-------------- moved this resource at the beginning of the list
      targetRevision: HEAD
      ref: helmValues
    - chart: helm3charts/myChart
      repoURL: 'myacrregistry.azurecr.io'
      targetRevision: '1.0.15'
      helm:
        releaseName: acr-gitlab-argocd-test
        valueFiles:
          - $helmValues/stacks/workload/helm/dev/values.yaml
  destination:
    namespace: acr-gitlab-argocd-test
    name: in-cluster
  syncPolicy:
    syncOptions:
      - CreateNamespace=true

To Reproduce

Apply the first manifest mentioned above and click Sync.

Expected behavior

As the ref repository in the manifest doesn't have path specified, See here it should only be used for helm values and despite the position of the reference repository in the sources list, the application should sync without error.

Screenshots
image

image

Version

{
    "Version": "v2.11.0+d3f33c0",
    "BuildDate": "2024-05-07T16:01:41Z",
    "GitCommit": "d3f33c00197e7f1d16f2a73ce1aeced464b07175",
    "GitTreeState": "clean",
    "GoVersion": "go1.21.9",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.2.1 2023-10-19T20:13:51Z",
    "HelmVersion": "v3.14.3+gf03cc04",
    "KubectlVersion": "v0.26.11",
    "JsonnetVersion": "v0.20.0"
}

Logs

argocd-repo-server-84678745c5-sq7jt repo-server time="2024-05-17T08:58:13Z" level=error msg="finished unary call with code Unknown" error="repository not found" grpc.code=Unknown grpc.method=ResolveRevision grpc.service=repository.RepoServerService grpc.start_time="2024-05-17T08:58:13Z" grpc.time_ms=1.218 span.kind=server system=grpc
argocd-repo-server-84678745c5-sq7jt repo-server time="2024-05-17T09:04:44Z" level=error msg="finished unary call with code Unknown" error="repository not found" grpc.code=Unknown grpc.method=ResolveRevision grpc.service=repository.RepoServerService grpc.start_time="2024-05-17T09:04:44Z" grpc.time_ms=1.33 span.kind=server system=grpc
argocd-repo-server-84678745c5-sq7jt repo-server time="2024-05-17T09:04:47Z" level=error msg="finished unary call with code Unknown" error="repository not found" grpc.code=Unknown grpc.method=ResolveRevision grpc.service=repository.RepoServerService grpc.start_time="2024-05-17T09:04:47Z" grpc.time_ms=1.222 span.kind=server system=grpc
argocd-repo-server-84678745c5-sq7jt repo-server time="2024-05-17T09:04:47Z" level=error msg="finished unary call with code Unknown" error="repository not found" grpc.code=Unknown grpc.method=ResolveRevision grpc.service=repository.RepoServerService grpc.start_time="2024-05-17T09:04:47Z" grpc.time_ms=1.242 span.kind=server system=grpc
@dalwar23 dalwar23 added the bug Something isn't working label May 17, 2024
@leachim742
Copy link

leachim742 commented May 17, 2024

we have currently the same issue with version 2.11.0.
The Application

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  labels:
    argocd.argoproj.io/instance: applications
  name: argocd
  namespace: argocd
spec:
  destination:
    namespace: argocd
    server: 'https://kubernetes.default.svc'
  project: swio-team
  sources:
    - chart: argocd
      helm:
        releaseName: argocd
        valueFiles:
          - $values/apps/argocd/values.yml
      repoURL: 'https://argoproj.github.io/argo-helm'
      targetRevision: 6.9.*
    - ref: values
      repoURL: 'ssh://git@git/somegit/ourgit.git'
      targetRevision: main

Errors are the same

@yrosaguiar
Copy link
Contributor

yrosaguiar commented May 18, 2024

I found a solution, add the non helm application as first one of the sources.

    - ref: values
      repoURL: 'ssh://git@git/somegit/ourgit.git'
      targetRevision: main
    - chart: argocd
      helm:
        releaseName: argocd
        valueFiles:
          - $values/apps/argocd/values.yml
      repoURL: 'https://argoproj.github.io/argo-helm'
      targetRevision: 6.9.*

@adiii717
Copy link

I found a solution, add the non helm application as first one of the sources.

    - ref: values
      repoURL: 'ssh://git@git/somegit/ourgit.git'
      targetRevision: main
    - chart: argocd
      helm:
        releaseName: argocd
        valueFiles:
          - $values/apps/argocd/values.yml
      repoURL: 'https://argoproj.github.io/argo-helm'
      targetRevision: 6.9.*

Thanks, it works for us as well, we started getting this error after upgrading the Helm chart version to 6.9.3.

Another issue we experienced with this change is that we lost the application revision from the public Helm chart in the ArgoCD UI.

before
image
Now
image

@dalwar23
Copy link
Author

I suppose this release has addressed the issue. However, I need to check if it works as expected.

@ftmiro
Copy link

ftmiro commented Jun 14, 2024

I don't face the same problem as described here. At least not in the version 2.11.2. I have the following application, configured since a while:

sources:
  - repoURL: 'https://github.com/someorg/somerepo.git'
    path: a-directory
    targetRevision: 503336e76433866a4676e00b3cd560d1c6c93af4
    helm:
      valueFiles:
        - $values/values.yaml
      parameters:
        - name: repository
          value: somerepo
      releaseName: some-release
  - repoURL: 'https://github.com/someorg/values-source.git'
    targetRevision: 7a734d47aef298f848b521332da0f7f8f35e2cfa
    ref: values

This app is working since ArgoCD 2.9.* and we also had 2.10.* running for a while before the last update.

@agaudreault agaudreault added the multi-source-apps Bugs or enhancements related to multi-source Applications. label Jun 21, 2024
@dalwar23
Copy link
Author

I can confirm that this problem has been solved as of version 2.11.3. In this version the order of repo is respected and sync error doesn't happen. ArgoCD GUI also shows that it's connected to helm chart repo and correct version.

thanks for all the help.

I will close this Issue as it has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working multi-source-apps Bugs or enhancements related to multi-source Applications.
Projects
None yet
Development

No branches or pull requests

6 participants