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

fix(directives): potential nil deref ArgoCD health #2891

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

hiddeco
Copy link
Contributor

@hiddeco hiddeco commented Nov 4, 2024

Based on findings from a nightly build:

time="2024-11-04T07:56:53Z" level=error msg="Observed a panic" Stage="{<name> <namespace>}" controller=stage controllerGroup=kargo.akuity.io controllerKind=Stage error="<nil>" name=<name> namespace=<namespace> panic="runtime error: invalid memory address or nil pointer dereference" panicGoValue="\"invalid memory address or nil pointer dereference\"" reconcileID="\"84b08423-5491-4dfe-b535-99ecfe74b43a\"" stacktrace="goroutine 272 [running]:\nk8s.io/apimachinery/pkg/util/runtime.logPanic({0x49085c0, 0x40010107e0}, {0x1f07f00, 0x5e90da0})\n\t/go/pkg/mod/k8s.io/apimachinery@v0.31.2/pkg/util/runtime/runtime.go:107 +0x98\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile.func1()\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:105 +0xf0\npanic({0x1f07f00?, 0x5e90da0?})\n\t/usr/local/go/src/runtime/panic.go:785 +0x124\ngit.luolix.top/akuity/kargo/internal/directives.(*argocdUpdater).getApplicationHealth(0x4000586ff0, {0x49085c0, 0x40010108a0}, 0x4000ed3620, {{0x4000f4fab8?, 0x2000?}, {0x4001389be0?, 0x0?}}, {0x4000fd1430, 0x1, ...})\n\t/kargo/internal/directives/argocd_health.go:213 +0x474\ngit.luolix.top/akuity/kargo/internal/directives.(*argocdUpdater).runHealthCheckStep(0x4000586ff0, {0x49085c0, 0x40010108a0}, 0x4000ed3620, {{0x4000154140?, 0x1d70e60?, 0x1dc4a60?}})\n\t/kargo/internal/directives/argocd_health.go:107 +0x268\ngit.luolix.top/akuity/kargo/internal/directives.(*argocdUpdater).RunHealthCheckStep(0x4000586ff0, {0x49085c0, 0x40010108a0}, 0x4000ed3620)\n\t/kargo/internal/directives/argocd_health.go:74 +0x174\ngit.luolix.top/akuity/kargo/internal/directives.(*SimpleEngine).CheckHealth(0x4000154d40, {0x49085c0, 0x40010108a0}, {{0x4000af9570?, 0x205d480?}, {0x4000af9560?, 0x4000bc4328?}}, {0x4000f94330, 0x1, 0x0?})\n\t/kargo/internal/directives/simple_engine.go:189 +0x2d4\ngit.luolix.top/akuity/kargo/internal/controller/stages.(*reconciler).syncPromotions(0x4000158dc0, {0x49085c0, 0x40010108a0}, 0x4000f73c00, {{0x0, 0x0}, {0x4000af9b5a, 0x6}, {0x40007eb400, 0xa, ...}, ...})\n\t/kargo/internal/controller/stages/stages.go:1078 +0xf60\ngit.luolix.top/akuity/kargo/internal/controller/stages.(*reconciler).syncNormalStage(0x4000158dc0, {0x49085c0, 0x40010108a0}, 0x4000f73c00)\n\t/kargo/internal/controller/stages/stages.go:608 +0x118\ngit.luolix.top/akuity/kargo/internal/controller/stages.(*reconciler).Reconcile(0x4000158dc0, {0x49085c0, 0x40010107e0}, {{{0x40003268d0?, 0x0?}, {0x40003268c6?, 0x4001521c78?}}})\n\t/kargo/internal/controller/stages/stages.go:525 +0x3a4\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile(0x4001002b40?, {0x49085c0?, 0x40010107e0?}, {{{0x40003268d0?, 0x0?}, {0x40003268c6?, 0x0?}}})\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:116 +0x9c\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler(0x4923ee0, {0x49085f8, 0x40000a88c0}, {{{0x40003268d0, 0xf}, {0x40003268c6, 0x7}}})\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:303 +0x2b0\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem(0x4923ee0, {0x49085f8, 0x40000a88c0})\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:263 +0x18c\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2()\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:224 +0x80\ncreated by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2 in goroutine 157\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:220 +0x3c8\n"

Copy link

netlify bot commented Nov 4, 2024

Deploy Preview for docs-kargo-io canceled.

Name Link
🔨 Latest commit 8ba46a7
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/672892c84c713e000898881d

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.99%. Comparing base (eedee91) to head (8ba46a7).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2891   +/-   ##
=======================================
  Coverage   49.98%   49.99%           
=======================================
  Files         275      275           
  Lines       24526    24530    +4     
=======================================
+ Hits        12259    12263    +4     
  Misses      11596    11596           
  Partials      671      671           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
@hiddeco hiddeco force-pushed the fix-argocd-health-nil-deref branch from 8c8a506 to 8ba46a7 Compare November 4, 2024 09:24
@krancour krancour added this to the v1.0.4 milestone Nov 4, 2024
@hiddeco hiddeco added this pull request to the merge queue Nov 4, 2024
Merged via the queue into akuity:main with commit 1eab368 Nov 4, 2024
19 checks passed
@hiddeco hiddeco deleted the fix-argocd-health-nil-deref branch November 4, 2024 17:32
github-actions bot pushed a commit that referenced this pull request Nov 4, 2024
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
(cherry picked from commit 1eab368)
@akuitybot
Copy link

Successfully created backport PR for release-1.0:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants