-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fresh flux installation - panic: runtime error: invalid memory address or nil pointer dereference #3195
Comments
If you're able to, can you try the image |
Fixing a typo in a |
This appears to still be an issue even with that prerelease.
last commit to my repo I moved files from the root directory into a subdirectory because fluxcd was scanning other yaml files I have in there.
|
I am also getting the same issue on a rancher RKE cluster. My directory structure for the kubernetes manifest files are [repo]/gitops/namespaces,[repo]/gitops/releases/dev.
After running the above command I am getting the same error as above. panic: runtime error: invalid memory address or nil pointer dereference goroutine 110 [running]: |
I am getting the same error. After an hour of looking it at it, if I have more than one item in I have a main repo called
I was expecting the line Any questions, happy to provide more details for replication. |
I already tried with |
I was getting error even for a single path in GKE with |
Been struggling with this.. Noticed this issue doesn't happen with 1.19.0 |
We noticed the same issue. Supplying a In 1.19.0 it works as expected. |
I can reproduce the panic in the original report, with flux 1.20.0, by supplying a path that doesn't exist in the repository.
However, the latter is not ideal either, since it will stop a sync proceeding. This is detailed in bug #3184 which is separate but interacts with this one: on startup, flux will try to construct the state of the last sync by looking at the repository at the high water mark (sync tag); if a path is missing, it'll either panic (due to this bug) or log an error and fail to sync (in the pre-release build). @dataplex I think you're seeing #3184 -- not a panic, but no syncing either -- does that seem right to you? @camorra-skk Try using paths without the leading slash, e.g., @matthewbrahms I think you're getting the combo-bug, with the new path not being in the old revision, triggering a panic. @gautamr @marratj Possibly you're seeing one of the above situations too. Same recommendation goes: try the pre-release, and check that the git-paths exist in the repo. Thanks for the reports everyone. I think the fix will rest largely with mitigating #3184 so I'm going to concentrate there to start with. |
On AWS EKS, I've just tried to install the flux and helm operator. The flux pod starts then it dies immediately with the error: panic: runtime error: invalid memory address or nil pointer dereference
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behaviour:
helm upgrade -i flux \ --set image.pullSecret=regcred \ --set registry.automationInterval=1m \ --set git.pollInterval=1m \ --set git.url=git@gitlab.com:[repo].git \ --set git.branch=develop \ --set git.path="fluxcd/helm\,fluxcd/namespaces\,fluxcd/releases/dev" \ --set git.label=[project]-dev \ --set prometheus.enabled=true \ --namespace fluxcd \ fluxcd/flux
Expected behaviour
Flux and HelmOperator are running and listening on GitLab changes
Logs
`bpint@mac-01-52:~/Developer/bs/k8s-cluster$ kc logs -f flux-5f78d75468-jbt94
Flag --git-verify-signatures has been deprecated, changed to --git-verify-signatures-mode, use that instead
ts=2020-07-16T10:05:33.818586156Z caller=main.go:259 version=1.20.0
ts=2020-07-16T10:05:33.818634392Z caller=main.go:412 msg="using kube config: "/root/.kube/config" to connect to the cluster"
ts=2020-07-16T10:05:33.843227855Z caller=main.go:492 component=cluster identity=/etc/fluxd/ssh/identity
ts=2020-07-16T10:05:33.843282699Z caller=main.go:493 component=cluster identity.pub="ssh-rsa [ssh key - didn't want to share, so, removed from the log]"
ts=2020-07-16T10:05:33.843314734Z caller=main.go:498 host=https://10.100.0.1:443 version=kubernetes-v1.16.8-eks-fd1ea7
ts=2020-07-16T10:05:33.843369625Z caller=main.go:510 kubectl=/usr/local/bin/kubectl
ts=2020-07-16T10:05:33.844074742Z caller=main.go:527 ping=true
ts=2020-07-16T10:05:33.847280738Z caller=main.go:666 url=ssh://git@gitlab.com/bimspot/k8s-cluster.git user="Weave Flux" email=support@weave.works signing-key= verify-signatures-mode=none sync-tag=bimspot-dev state=git readonly=false registry-disable-scanning=false notes-ref=bimspot-dev set-author=false git-secret=false sops=false
ts=2020-07-16T10:05:33.84783731Z caller=main.go:772 upstream="no upstream URL given"
ts=2020-07-16T10:05:33.848180111Z caller=images.go:17 component=sync-loop msg="polling for new images for automated workloads"
ts=2020-07-16T10:05:33.848217612Z caller=images.go:27 component=sync-loop msg="no automated workloads"
ts=2020-07-16T10:05:33.848422907Z caller=loop.go:108 component=sync-loop err="loading last-synced resources: git repo not ready: git repo has not been cloned yet"
ts=2020-07-16T10:05:33.849280735Z caller=main.go:795 addr=:3030
ts=2020-07-16T10:05:34.330334888Z caller=checkpoint.go:24 component=checkpoint msg="up to date" latest=1.20.0
ts=2020-07-16T10:05:46.507824549Z caller=loop.go:134 component=sync-loop event=refreshed url=ssh://git@gitlab.com/bimspot/k8s-cluster.git branch=develop HEAD=12d643d4debaeabefab20f956e4a66232ce76b94
ts=2020-07-16T10:05:46.514036608Z caller=sync.go:60 component=daemon info="trying to sync git changes to the cluster" old= new=12d643d4debaeabefab20f956e4a66232ce76b94
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x176c94f]
goroutine 82 [running]:
github.com/fluxcd/flux/pkg/cluster/kubernetes/resource.Load.func1(0xc0000b8750, 0x26, 0x0, 0x0, 0x20f5120, 0xc0006ef0b0, 0x0, 0xc0006e6870)
/home/circleci/go/src/github.com/fluxcd/flux/pkg/cluster/kubernetes/resource/load.go:32 +0x6f
path/filepath.Walk(0xc0000b8750, 0x26, 0xc00072f618, 0x0, 0x0)
/usr/local/go/src/path/filepath/path.go:402 +0x6a
github.com/fluxcd/flux/pkg/cluster/kubernetes/resource.Load(0xc001d542c0, 0x1a, 0xc0006e6780, 0x3, 0x3, 0xc001d54500, 0x20, 0x20, 0x40c1d6)
/home/circleci/go/src/github.com/fluxcd/flux/pkg/cluster/kubernetes/resource/load.go:31 +0x19b
github.com/fluxcd/flux/pkg/cluster/kubernetes.(*manifests).LoadManifests(0xc000648930, 0xc001d542c0, 0x1a, 0xc0006e6780, 0x3, 0x3, 0xc0000b8840, 0x0, 0x20)
/home/circleci/go/src/github.com/fluxcd/flux/pkg/cluster/kubernetes/manifests.go:122 +0x67
github.com/fluxcd/flux/pkg/manifests.(*rawFiles).GetAllResourcesByID(0xc00197e540, 0x213dda0, 0xc0000bc058, 0x3990981b40c935b4, 0x39d263b326feea65, 0xc00072f760)
/home/circleci/go/src/github.com/fluxcd/flux/pkg/manifests/rawfiles.go:96 +0x60
github.com/fluxcd/flux/pkg/daemon.doSync(0x213dda0, 0xc0000bc058, 0x21257a0, 0xc00197e540, 0x2158440, 0xc000190400, 0xc0000b8840, 0x2b, 0x20f2f20, 0xc00009fc80, ...)
/home/circleci/go/src/github.com/fluxcd/flux/pkg/daemon/sync.go:221 +0x66
github.com/fluxcd/flux/pkg/daemon.(*Daemon).Sync(0xc000361e60, 0x213dda0, 0xc0000bc058, 0x1e45a32e, 0xed6a21d7a, 0x0, 0xc000500b70, 0x28, 0x21256a0, 0xc0002cc4c0, ...)
/home/circleci/go/src/github.com/fluxcd/flux/pkg/daemon/sync.go:71 +0x404
github.com/fluxcd/flux/pkg/daemon.(*Daemon).Loop(0xc000361e60, 0xc00009a2a0, 0xc00034ca00, 0x20f2f20, 0xc00009fec0)
/home/circleci/go/src/github.com/fluxcd/flux/pkg/daemon/loop.go:103 +0x525
created by main.main
/home/circleci/go/src/github.com/fluxcd/flux/cmd/fluxd/main.go:777 +0x5990`
Additional context
The text was updated successfully, but these errors were encountered: