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

Got TypeAssertionError, and pod crash #106

Closed
fmiqbal opened this issue Jun 8, 2024 · 2 comments
Closed

Got TypeAssertionError, and pod crash #106

fmiqbal opened this issue Jun 8, 2024 · 2 comments

Comments

@fmiqbal
Copy link

fmiqbal commented Jun 8, 2024

I got error

[fikrimi@crimson:projects]$ k get pods
NAME                                      READY   STATUS    RESTARTS        AGE
capacitor-6ffb8c69-qk6h4                  1/1     Running   291 (14m ago)   2d23h

the log

W0608 03:41:38.771391       1 client_config.go:618] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
time="2024-06-08T03:41:38Z" level=info msg="Starting gitrepositories.source.toolkit.fluxcd.io controller"
time="2024-06-08T03:41:38Z" level=info msg="Starting ocirepositories.source.toolkit.fluxcd.io controller"
time="2024-06-08T03:41:38Z" level=info msg="Starting buckets.source.toolkit.fluxcd.io controller"
W0608 03:41:38.827178       1 warnings.go:70] v1beta2 HelmRepository is deprecated, upgrade to v1
time="2024-06-08T03:41:38Z" level=info msg="Starting helmrepositories.source.toolkit.fluxcd.io controller"
W0608 03:41:38.828902       1 warnings.go:70] v1beta2 HelmRepository is deprecated, upgrade to v1
W0608 03:41:38.830181       1 warnings.go:70] v1beta2 HelmRepository is deprecated, upgrade to v1
W0608 03:41:38.830837       1 warnings.go:70] v1beta2 HelmChart is deprecated, upgrade to v1
time="2024-06-08T03:41:38Z" level=info msg="Starting helmcharts.source.toolkit.fluxcd.io controller"
time="2024-06-08T03:41:38Z" level=info msg="Starting kustomizations.kustomize.toolkit.fluxcd.io controller"
W0608 03:41:38.982100       1 warnings.go:70] v1beta2 HelmChart is deprecated, upgrade to v1
W0608 03:41:38.983396       1 warnings.go:70] v1beta2 HelmChart is deprecated, upgrade to v1
W0608 03:41:39.186755       1 warnings.go:70] v2beta2 HelmRelease is deprecated, upgrade to v2
W0608 03:41:39.584006       1 warnings.go:70] v2beta2 HelmRelease is deprecated, upgrade to v2
time="2024-06-08T03:41:39Z" level=info msg="Starting helmreleases.helm.toolkit.fluxcd.io controller"
time="2024-06-08T03:41:39Z" level=info msg="Starting event controller"
time="2024-06-08T03:41:39Z" level=info msg="Starting pod controller"
time="2024-06-08T03:41:39Z" level=info msg="Starting service controller"
time="2024-06-08T03:41:39Z" level=info msg="Starting deployment controller"
time="2024-06-08T03:41:39Z" level=info msg="Starting ingress controller"
time="2024-06-08T03:41:39Z" level=info msg=Initialized
W0608 03:41:39.782082       1 warnings.go:70] v2beta2 HelmRelease is deprecated, upgrade to v2
W0608 03:41:39.785467       1 warnings.go:70] v2beta2 HelmRelease is deprecated, upgrade to v2
W0608 03:41:44.315762       1 warnings.go:70] v2beta2 HelmRelease is deprecated, upgrade to v2
W0608 03:41:44.322313       1 warnings.go:70] v1beta2 HelmRepository is deprecated, upgrade to v1
W0608 03:41:44.327415       1 warnings.go:70] v1beta2 HelmChart is deprecated, upgrade to v1
W0608 03:41:44.678568       1 warnings.go:70] v2beta2 HelmRelease is deprecated, upgrade to v2
W0608 03:41:44.882720       1 warnings.go:70] v1beta2 HelmRepository is deprecated, upgrade to v1
W0608 03:41:45.078076       1 warnings.go:70] v1beta2 HelmChart is deprecated, upgrade to v1
W0608 03:45:28.258727       1 warnings.go:70] v2beta2 HelmRelease is deprecated, upgrade to v2
W0608 03:45:28.263429       1 warnings.go:70] v1beta2 HelmRepository is deprecated, upgrade to v1
W0608 03:45:28.267889       1 warnings.go:70] v1beta2 HelmChart is deprecated, upgrade to v1
W0608 03:45:28.622806       1 warnings.go:70] v2beta2 HelmRelease is deprecated, upgrade to v2
W0608 03:45:28.821465       1 warnings.go:70] v1beta2 HelmRepository is deprecated, upgrade to v1
W0608 03:45:29.021859       1 warnings.go:70] v1beta2 HelmChart is deprecated, upgrade to v1
W0608 03:45:30.025189       1 warnings.go:70] v2beta2 HelmRelease is deprecated, upgrade to v2
W0608 03:45:30.221778       1 warnings.go:70] v1beta2 HelmRepository is deprecated, upgrade to v1
W0608 03:45:30.422446       1 warnings.go:70] v1beta2 HelmChart is deprecated, upgrade to v1
E0608 03:46:06.303431       1 runtime.go:79] Observed a panic: &runtime.TypeAssertionError{_interface:(*abi.Type)(0x1f663c0), concrete:(*abi.Type)(nil), asserted:(*abi.Type)(0x228c220), missingMethod:""} (interface conversion: interface {} is nil, not *v1.Pod)
goroutine 214 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x1ff20e0, 0xc001c8a960})
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:75 +0x85
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc000efe3a0?})
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:49 +0x6b
panic({0x1ff20e0?, 0xc001c8a960?})
	/opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132
github.com/gimlet-io/capacitor/pkg/controllers.PodController.func1({{0xc000b30a20?, _}, {_, _}}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...)
	/home/runner/work/capacitor/capacitor/pkg/controllers/podController.go:40 +0x3d4
github.com/gimlet-io/capacitor/pkg/controllers.(*Controller).processNextItem(0xc00052e9b0)
	/home/runner/work/capacitor/capacitor/pkg/controllers/controller.go:185 +0x465
github.com/gimlet-io/capacitor/pkg/controllers.(*Controller).runWorker(...)
	/home/runner/work/capacitor/capacitor/pkg/controllers/controller.go:243
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x30?)
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:226 +0x33
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc001773760, {0x2602100, 0xc0015ab590}, 0x1, 0xc00011a780)
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:227 +0xaf
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc001773760, 0x3b9aca00, 0x0, 0x1, 0xc00011a780)
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:204 +0x7f
k8s.io/apimachinery/pkg/util/wait.Until(...)
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:161
created by github.com/gimlet-io/capacitor/pkg/controllers.(*Controller).Run in goroutine 171
	/home/runner/work/capacitor/capacitor/pkg/controllers/controller.go:235 +0x375
panic: interface conversion: interface {} is nil, not *v1.Pod [recovered]
	panic: interface conversion: interface {} is nil, not *v1.Pod

goroutine 214 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc000efe3a0?})
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:56 +0xcd
panic({0x1ff20e0?, 0xc001c8a960?})
	/opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132
github.com/gimlet-io/capacitor/pkg/controllers.PodController.func1({{0xc000b30a20?, _}, {_, _}}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...)
	/home/runner/work/capacitor/capacitor/pkg/controllers/podController.go:40 +0x3d4
github.com/gimlet-io/capacitor/pkg/controllers.(*Controller).processNextItem(0xc00052e9b0)
	/home/runner/work/capacitor/capacitor/pkg/controllers/controller.go:185 +0x465
github.com/gimlet-io/capacitor/pkg/controllers.(*Controller).runWorker(...)
	/home/runner/work/capacitor/capacitor/pkg/controllers/controller.go:243
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x30?)
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:226 +0x33
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc001773760, {0x2602100, 0xc0015ab590}, 0x1, 0xc00011a780)
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:227 +0xaf
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc001773760, 0x3b9aca00, 0x0, 0x1, 0xc00011a780)
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:204 +0x7f
k8s.io/apimachinery/pkg/util/wait.Until(...)
	/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:161
created by github.com/gimlet-io/capacitor/pkg/controllers.(*Controller).Run in goroutine 171
	/home/runner/work/capacitor/capacitor/pkg/controllers/controller.go:235 +0x375

the deployment is using flux with this spec

---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
  name: capacitor
  namespace: flux-system
spec:
  interval: 12h
  url: oci://ghcr.harbor.my.company.docker.proxy.domain/gimlet-io/capacitor-manifests
  ref:
    semver: ">=0.1.0"
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: capacitor
  namespace: flux-system
spec:
  targetNamespace: flux-system
  interval: 1h
  retryInterval: 2m
  timeout: 5m
  wait: true
  prune: true
  path: "./"
  sourceRef:
    kind: OCIRepository
    name: capacitor
@Stephani0106
Copy link

We had the same problem here.

image
image

Did you find any solution?

@Stephani0106
Copy link

Seems like the version v0.4.5 of the OCI repository fix the problem.

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

No branches or pull requests

3 participants