Skip to content

stack overflow with Circular dependency #26783

@hm-gh-sa

Description

@hm-gh-sa

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

fatal error: stack overflow

with Circular dependency detected global scope resources

To Reproduce

We had a buggy global cluster Resource LogStorage which had a ownerRef of itself.

 k get LogStorage tigera-secure -oyaml | grep -A6 ownerReferences
  ownerReferences:
  - apiVersion: operator.tigera.io/v1
    blockOwnerDeletion: true
    controller: true
    kind: LogStorage
    name: tigera-secure
    uid: 740a9840-7c61-4911-ba8a-6d1a118cfbb6

with argocd 3.3.3 and this PR?(#26640) we got a stack overflow.

Expected behavior

Circular dependency should not results in a stack overflow

Screenshots

Version

argocd: v3.3.3
  BuildDate: 2026-03-09T15:27:57Z
  GitCommit: ff239dcd20c578ecbf5265914cdc5c2f98d85535
  GitTreeState: clean
  GitTag: v3.3.3
  GoVersion: go1.25.5
  Compiler: gc
  Platform: linux/amd64
{"level":"fatal","msg":"Argo CD server address unspecified","time":"2026-03-11T06:44:47Z"}

Logs

argocd-application-controller-2 application-controller time="2026-03-11T05:51:28Z" level=warning msg="Circular dependency detected: map[{aquasecurity.github.io ClusterRbacAssessmentReport  clusterrole-elastic-operator}:true {operator.tigera.io LogStorage  tigera-secure}:true {rbac.authorization.k8s.io ClusterRole  elastic-operator}:true]."
argocd-application-controller-2 application-controller time="2026-03-11T05:51:28Z" level=warning msg="Circular dependency detected: map[{operator.tigera.io LogStorage  tigera-secure}:true {rbac.authorization.k8s.io ClusterRoleBinding  tigera-linseed}:true]."
argocd-application-controller-2 application-controller time="2026-03-11T05:51:28Z" level=warning msg="Circular dependency detected: map[{ Namespace  tigera-kibana}:true {operator.tigera.io LogStorage  tigera-secure}:true]."
argocd-application-controller-2 application-controller time="2026-03-11T05:51:28Z" level=warning msg="Ignoring temporary failed attempt to compare app state against repo" app-namespace=argocd application=app-monitoring-pro comparison-level=2 dest-name= dest-namespace=mon dest-server="https://kubernetes.default.svc" error="failed to get repo objects" project=monitoring
argocd-application-controller-2 application-controller time="2026-03-11T05:51:28Z" level=warning msg="Ignoring temporary failed attempt to compare app state against repo" app-namespace=argocd application=gatekeeper-monitoring-hcp-inf comparison-level=2 dest-name= dest-namespace=gatekeeper-system dest-server="https://kubernetes.default.svc" error="failed to get repo objects" project=opa-system
argocd-application-controller-2 application-controller runtime: goroutine stack exceeds 1000000000-byte limit
argocd-application-controller-2 application-controller runtime: sp=0xc05c000348 stack=[0xc05c000000, 0xc07c000000]
argocd-application-controller-2 application-controller fatal error: stack overflow
argocd-application-controller-2 application-controller
argocd-application-controller-2 application-controller runtime stack:
argocd-application-controller-2 application-controller runtime.throw({0x515d7ce?, 0x0?})
argocd-application-controller-2 application-controller 	/usr/local/go/src/runtime/panic.go:1094 +0x48 fp=0xc0000c9e98 sp=0xc0000c9e68 pc=0x481888
argocd-application-controller-2 application-controller runtime.newstack()
argocd-application-controller-2 application-controller 	/usr/local/go/src/runtime/stack.go:1159 +0x5bd fp=0xc0000c9fc8 sp=0xc0000c9e98 pc=0x464d1d
argocd-application-controller-2 application-controller runtime.morestack()
argocd-application-controller-2 application-controller 	/usr/local/go/src/runtime/asm_amd64.s:620 +0x7d fp=0xc0000c9fd0 sp=0xc0000c9fc8 pc=0x4884dd
argocd-application-controller-2 application-controller
argocd-application-controller-2 application-controller goroutine 283 gp=0xc000fd7a40 m=3 mp=0xc0000b3008 [running]:
argocd-application-controller-2 application-controller type:.hash.github.com/argoproj/gitops-engine/pkg/utils/kube.ResourceKey(0xc05c000410, 0xf09650ea20e71eb4?)
argocd-application-controller-2 application-controller 	<autogenerated>:1 +0x6e fp=0xc05c000358 sp=0xc05c000350 pc=0x285baee
argocd-application-controller-2 application-controller runtime.mapaccess1(0x48e8d40, 0xc004b30de0, 0xc05c000410)
argocd-application-controller-2 application-controller 	/usr/local/go/src/internal/runtime/maps/runtime_swiss.go:65 +0x71 fp=0xc05c0003c8 sp=0xc05c000358 pc=0x4104b1
argocd-application-controller-2 application-controller github.com/argoproj/gitops-engine/pkg/cache.(*clusterCache).processCrossNamespaceChildren(0xc004b44000, {0xc041a279c0?, 0xc05c000548?, 0x24?}, 0xc07bffdac8, 0xc01bff9410)
argocd-application-controller-2 application-controller 	/go/src/github.com/argoproj/argo-cd/gitops-engine/pkg/cache/cluster.go:1226 +0xb9 fp=0xc05c0004c0 sp=0xc05c0003c8 pc=0x2855479
argocd-application-controller-2 application-controller github.com/argoproj/gitops-engine/pkg/cache.(*clusterCache).processCrossNamespaceChildren(0xc004b44000, {0xc041a27980?, 0xc05c000640?, 0x24?}, 0xc07bffdac8, 0xc01bff9410)
argocd-application-controller-2 application-controller 	/go/src/github.com/argoproj/argo-cd/gitops-engine/pkg/cache/cluster.go:1248 +0x259 fp=0xc05c0005b8 sp=0xc05c0004c0 pc=0x2855619
argocd-application-controller-2 application-controller github.com/argoproj/gitops-engine/pkg/cache.(*clusterCache).processCrossNamespaceChildren(0xc004b44000, {0xc041a278c0?, 0xc05c000738?, 0x24?}, 0xc07bffdac8, 0xc01bff9410)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomponent:gitops-engineIssue specific on how GitOps engine performs the sync and maintain the cluster cache

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions