argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
16.7k stars 5.06k forks source link

TypeError: Cannot read properties of undefined (reading 'kustomize') with multi-source application #15038

Open martijnvdp opened 10 months ago

martijnvdp commented 10 months ago

Checklist:

Describe the bug When using a multi source Application with a helm chart and a kustomize file in the repository we often get an error when we try to view the parameters tab of the application in the GUI

TypeError: Cannot read properties of undefined (reading 'kustomize'

To Reproduce first off it seems to occur randomly so sometimes it works ok and you dont get an error

  1. create an application using sources
project: myproject
destination:
  namespace: alb-ingress
  name: in-cluster
syncPolicy:
  automated:
    prune: true
    selfHeal: true
  syncOptions:
    - PrunePropagationPolicy='backgound'
    - CreateNamespace=false
  retry:
    backoff:
      duration: 5s
      factor: 2
      maxDuration: 3m
sources:
  - repoURL: 'https://github.com/my-org/test'
    path: deployments/alb-ingress/overlay/test/cluster-1
    targetRevision: master
    ref: test
  - repoURL: 'https://aws.github.io/eks-charts'
    targetRevision: 1.4.7
    helm:
      valueFiles:
        - $test/deployments/alb-ingress/overlay/test/cluster-1/values.yaml
    chart: aws-load-balancer-controller

in the repo deployments/alb-ingress/overlay/test/cluster-1

iun addition we have a kustomize.yaml to include extra manifest to the deployment

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

commonLabels:
  costcenter: test
  environment: test
  team: test
  workload-id: aws-load-balancer-controller

resources:
  - cnp_alb_ingress.yaml
  1. after deployment go to the argocd gui
  2. click on application details
  3. click on parameters

Expected behavior

expected to see the application parameters

Screenshots

image

Version

{
    "Version": "v2.8.0+804d4b8",
    "BuildDate": "2023-08-07T14:25:33Z",
    "GitCommit": "804d4b8ca6bc4c2cf02c5c971aa923ec5b8623f0",
    "GitTreeState": "clean",
    "GoVersion": "go1.20.6",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.1.0 2023-06-19T16:58:18Z",
    "HelmVersion": "v3.12.1+gf32a527",
    "KubectlVersion": "v0.24.2",
    "JsonnetVersion": "v0.20.0"
}

Logs

Paste any relevant application logs here.
martijnvdp commented 10 months ago

closed issue that looks a bit like this https://github.com/argoproj/argo-cd/issues/12487

hackinteach commented 5 months ago

I also got the same problem by having both Kustomize and Helm chart as sources.

My argo-cd version:

{
    "Version": "v2.9.3+6eba5be",
    "BuildDate": "2023-12-01T23:05:50Z",
    "GitCommit": "6eba5be864b7e031871ed7698f5233336dfe75c7",
    "GitTreeState": "clean",
    "GoVersion": "go1.21.3",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.2.1 2023-10-19T20:13:51Z",
    "HelmVersion": "v3.13.2+g2a2fb3b",
    "KubectlVersion": "v0.24.2",
    "JsonnetVersion": "v0.20.0"
}

My applicationset yaml:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: traccar
  namespace: argocd
spec:
  generators:
    - list:
        elements:
          - cluster: sample
            url: https://<REDACTED>
            branch: main
  template:
    metadata:
      name: "traccar-{{cluster}}"
      labels:
        environment: "{{cluster}}"
        app: traccar
    spec:
      project: default
      sources:
        - path: "apps/traccar/overlays/{{cluster}}"
          repoURL: <REDACTED>
          targetRevision: "{{ branch }}"
        - chart: traccar
          repoURL: https://traccar.github.io/traccar-helm/
          targetRevision: 1.8.0
          helm:
            releaseName: traccar
            valueFiles:
              - $valuesRepo/apps/traccar/helm/values-master.yaml
              - $valuesRepo/apps/traccar/helm/values-{{cluster}}.yaml
        - ref: valuesRepo
          repoURL: <REDACTED>
          targetRevision: "{{ branch }}"
      syncPolicy:
        syncOptions:
          - CreateNamespace=true
      destination:
        server: "{{url}}"
        namespace: "traccar"

Result when trying to view the parameters on the UI:

Screenshot 2567-01-17 at 11 43 35
idogada-akamai commented 1 month ago

I can't even use the UI now.... I keep getting this error no matter what.

Any update on that?

jdubs commented 1 month ago

Also busted for me.

mdemblani commented 3 weeks ago

A similar issue for me, any update on the fix for this