argocd-image-updater icon indicating copy to clipboard operation
argocd-image-updater copied to clipboard

Git write-back-target helmvalues Got panic: runtime error: invalid memory address or nil pointer dereference

Open minkbear opened this issue 6 months ago • 2 comments

Describe the bug

got error

time="2024-08-21T16:26:00Z" level=info msg=Trace args="[git fetch origin --tags --force --prune]" dir=/tmp/git-workload-in-cluster-app-podinfo-test1868138268 operation_name="exec git" time_ms=1916.5610530000001
time="2024-08-21T16:26:00Z" level=info msg="git config user.name argocd-image-updater" dir=/tmp/git-workload-in-cluster-app-podinfo-test1868138268 execID=29dd2
time="2024-08-21T16:26:00Z" level=info msg=Trace args="[git config user.name argocd-image-updater]" dir=/tmp/git-workload-in-cluster-app-podinfo-test1868138268 operation_name="exec git" time_ms=10.841928000000001
time="2024-08-21T16:26:00Z" level=info msg="git config user.email [email protected]" dir=/tmp/git-workload-in-cluster-app-podinfo-test1868138268 execID=da41d
time="2024-08-21T16:26:00Z" level=info msg=Trace args="[git config user.email [email protected]]" dir=/tmp/git-workload-in-cluster-app-podinfo-test1868138268 operation_name="exec git" time_ms=2.3861109999999996
time="2024-08-21T16:26:00Z" level=info msg="git checkout --force develop" dir=/tmp/git-workload-in-cluster-app-podinfo-test1868138268 execID=cd67d
time="2024-08-21T16:26:00Z" level=info msg=Trace args="[git checkout --force develop]" dir=/tmp/git-workload-in-cluster-app-podinfo-test1868138268 operation_name="exec git" time_ms=36.427568
time="2024-08-21T16:26:00Z" level=info msg="git clean -ffdx" dir=/tmp/git-workload-in-cluster-app-podinfo-test1868138268 execID=4d9e3
time="2024-08-21T16:26:00Z" level=info msg=Trace args="[git clean -ffdx]" dir=/tmp/git-workload-in-cluster-app-podinfo-test1868138268 operation_name="exec git" time_ms=5.22551
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1f565e8]

goroutine 131 [running]:
github.com/argoproj-labs/argocd-image-updater/pkg/argocd.mergeKustomizeOverride(0xc000117098, 0xb29?)
	/src/argocd-image-updater/pkg/argocd/update.go:528 +0x48
github.com/argoproj-labs/argocd-image-updater/pkg/argocd.marshalParamsOverride(0xc0006ee408, {0xc000824c00, 0xb29, 0xb2a})
	/src/argocd-image-updater/pkg/argocd/update.go:428 +0x4a5
github.com/argoproj-labs/argocd-image-updater/pkg/argocd.writeOverrides(0xc0006ee408, 0xc0007065a0, {0x2904318, 0xc0002768c0})
	/src/argocd-image-updater/pkg/argocd/git.go:279 +0x249
github.com/argoproj-labs/argocd-image-updater/pkg/argocd.commitChangesGit(0xc0006ee408, 0xc0007065a0, {0xc000981890, 0x1, 0x1}, 0x2694540)
	/src/argocd-image-updater/pkg/argocd/git.go:214 +0x746
github.com/argoproj-labs/argocd-image-updater/pkg/argocd.commitChanges(0xc000958ff0?, 0xc0006c02a0?, {0xc000981890?, 0xc000505648?, 0xcff4f1?})
	/src/argocd-image-updater/pkg/argocd/update.go:704 +0x4e
github.com/argoproj-labs/argocd-image-updater/pkg/argocd.commitChangesLocked(0xc0006ee408?, 0xc0007065a0?, 0x34?, {0xc000981890?, 0x1?, 0x1?})
	/src/argocd-image-updater/pkg/argocd/update.go:683 +0xfe
github.com/argoproj-labs/argocd-image-updater/pkg/argocd.UpdateApplication(0xc00098bb18, 0xc000958ff0)
	/src/argocd-image-updater/pkg/argocd/update.go:350 +0x1fcd
main.runImageUpdater.func1({_, _}, {{{{0xc00031ecc0, 0xb}, {0xc000209878, 0x14}}, {{0xc0006c0210, 0x24}, {0x0, 0x0}, ...}, ...}, ...})
	/src/argocd-image-updater/cmd/run.go:339 +0x2ef
created by main.runImageUpdater in goroutine 1
	/src/argocd-image-updater/cmd/run.go:321 +0x9d8
time="2024-08-21T16:26:27Z" level=info msg="argocd-image-updater v0.14.0+af844fe starting [loglevel:INFO, interval:2m0s, healthport:8080]"
time="2024-08-21T16:26:27Z" level=warning msg="commit message template at /app/config/commit.template does not exist, using default"
time="2024-08-21T16:26:27Z" level=info msg="Loaded 1 registry configurations from /app/config/registries.conf"

To Reproduce Steps to reproduce the behavior:

Add annotations for ApplicationSet

      annotations:
        argocd-image-updater.argoproj.io/image-list: "myimage=myecrrepo/app-podinfo:test"
        argocd-image-updater.argoproj.io/myimage.update-strategy: digest
        argocd-image-updater.argoproj.io/myimage.force-update: "true"
        argocd-image-updater.argoproj.io/myimage.helm.image-name: image.repository
        argocd-image-updater.argoproj.io/myimage.helm.image-tag: image.tag
        argocd-image-updater.argoproj.io/write-back-method: git
        argocd-image-updater.argoproj.io/write-back-target: "helmvalues:./../values.yaml"

and my values.yaml is

skipDeploy: "false"

containerPort: 9898

image:
  repository: myecrrepo/app-podinfo
  tag: test

container:
  command:

Expected behavior

change image.tag

Version

argocd-image-updater v0.14.0+af844fe

minkbear avatar Aug 21 '24 16:08 minkbear