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

Tekton operator >= 0.73 raise as error: panic: runtime error: invalid memory address or nil pointer dereference #2476

Closed
cmoulliard opened this issue Dec 23, 2024 · 1 comment · Fixed by #2482
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@cmoulliard
Copy link

Expected Behavior

Deployment on kubernetes of the Tekton Operator (>= 0.73) should not raise an error: panic: runtime error: invalid memory address or nil pointer dereference but a more human readable.

Actual Behavior

Tekton operator >= 0.73 raise as error: panic: runtime error: invalid memory address or nil pointer dereference

I1220 15:44:58.104509       1 leaderelection.go:250] attempting to acquire leader lease tekton-operator/tekton-operator-lifecycle.github.com.tektoncd.operator.pkg.reconciler.kubernetes.tektonresult.reconci
I1220 15:45:59.263201       1 leaderelection.go:260] successfully acquired lease tekton-operator/tekton-operator-lifecycle.github.com.tektoncd.operator.pkg.reconciler.shared.tektonconfig.reconciler.00-of-0
{"level":"info","timestamp":"2024-12-20T15:45:59.264Z","logger":"tekton-operator-lifecycle","caller":"leaderelection/context.go:158","msg":"\"tekton-operator-6f69d5b8c9-9rklm_d77cc153-cfe3-4667-9e02-593715
{"level":"info","timestamp":"2024-12-20T15:45:59.268Z","logger":"tekton-operator-lifecycle","caller":"tektonconfig/tektonconfig.go:105","msg":"Reconciling TektonConfig","commit":"dbf2fac-dirty","knative.de
{"level":"error","timestamp":"2024-12-20T15:45:59.330Z","logger":"tekton-operator-lifecycle","caller":"tektonconfig/reconciler.go:295","msg":"Returned an error","commit":"dbf2fac-dirty","knative.dev/pod":"
{"level":"error","timestamp":"2024-12-20T15:45:59.331Z","logger":"tekton-operator-lifecycle","caller":"controller/controller.go:566","msg":"Reconcile error","commit":"dbf2fac-dirty","knative.dev/pod":"tekt
{"level":"info","timestamp":"2024-12-20T15:45:59.331Z","logger":"tekton-operator-lifecycle","caller":"tektonconfig/tektonconfig.go:105","msg":"Reconciling TektonConfig","commit":"dbf2fac-dirty","knative.de
{"level":"info","timestamp":"2024-12-20T15:45:59.331Z","logger":"tekton-operator-lifecycle.event-broadcaster","caller":"record/event.go:364","msg":"Event(v1.ObjectReference{Kind:\"TektonConfig\", Namespace
{"level":"error","timestamp":"2024-12-20T15:45:59.365Z","logger":"tekton-operator-lifecycle","caller":"tektonconfig/reconciler.go:295","msg":"Returned an error","commit":"dbf2fac-dirty","knative.dev/pod":"
{"level":"error","timestamp":"2024-12-20T15:45:59.365Z","logger":"tekton-operator-lifecycle","caller":"controller/controller.go:566","msg":"Reconcile error","commit":"dbf2fac-dirty","knative.dev/pod":"tekt
{"level":"info","timestamp":"2024-12-20T15:45:59.365Z","logger":"tekton-operator-lifecycle","caller":"tektonconfig/tektonconfig.go:105","msg":"Reconciling TektonConfig","commit":"dbf2fac-dirty","knative.de
{"level":"info","timestamp":"2024-12-20T15:45:59.365Z","logger":"tekton-operator-lifecycle.event-broadcaster","caller":"record/event.go:364","msg":"Event(v1.ObjectReference{Kind:\"TektonConfig\", Namespace
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1436a0c]

goroutine 408 [running]:
github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade.upgradePipelineProperties({0x1d432e8, 0x4001264060}, 0x1a566ba?, {0x1f?, 0x0?}, {0xffff53a791b8, 0x40002ff350}, 0x40011475d8?)
    github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/pre_upgrade.go:70 +0x8c
github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade.(*Upgrade).executeUpgrade(0x4000068200, {0x1d432e8, 0x4001264060}, {0x2ccefc0, 0x2, 0x0?}, 0x1)
    github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/upgrade.go:99 +0x2ec
github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade.(*Upgrade).RunPreUpgrade(...)
    github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/upgrade.go:65
github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig.(*Reconciler).ReconcileKind(0x40003ded80, {0x1d432e8, 0x4001264060}, 0x400122a408)
    github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/tektonconfig.go:117 +0x2ac
github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig.(*reconcilerImpl).Reconcile(0x40004e4820, {0x1d432e8, 0x4001264030}, {0x40005b31e6, 0x6})
    github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig/reconciler.go:236 +0x3d4
knative.dev/pkg/controller.(*Impl).processNextWorkItem(0x400070dc80)
    knative.dev/[email protected]/controller/controller.go:542 +0x3b8
knative.dev/pkg/controller.(*Impl).RunContext.func3()
    knative.dev/[email protected]/controller/controller.go:491 +0x5c
created by knative.dev/pkg/controller.(*Impl).RunContext in goroutine 392
    knative.dev/[email protected]/controller/controller.go:489 +0x298

Steps to Reproduce the Problem

  1. Create a kind cluster
  2. Deploy the Tekton Operator >= 0.73
  3. Deploy the following Tekton Config: https://github.com/ch007m/fork-konflux-ci/blob/idpbuilder/idp/dependencies/tekton-config/tekton-config.yml

Additional Info

  • Kubernetes version:

    Output of kubectl version:

Client Version: v1.31.2
Kustomize Version: v5.4.2
Server Version: v1.30.3
  • Tekton Pipeline version:

    Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

❯ tkn version
Client version: 0.38.1
Pipeline version: unknown, pipeline controller may be installed in another namespace please use tkn version -n {namespace}
Operator version: v0.74.0
@cmoulliard cmoulliard added the kind/bug Categorizes issue or PR as related to a bug. label Dec 23, 2024
@vdemeester vdemeester transferred this issue from tektoncd/pipeline Jan 2, 2025
l-qing added a commit to l-qing/tekton-operator that referenced this issue Jan 3, 2025
l-qing added a commit to l-qing/tekton-operator that referenced this issue Jan 3, 2025
l-qing added a commit to l-qing/tekton-operator that referenced this issue Jan 6, 2025
l-qing added a commit to l-qing/tekton-operator that referenced this issue Jan 7, 2025
l-qing added a commit to l-qing/tekton-operator that referenced this issue Jan 8, 2025
@kjq
Copy link

kjq commented Jan 8, 2025

I am seeing the same issue running in the latest Minikube with Kubernetes 1.31 when I upgraded from 73 to 74 (to test before deploying). 73 was working fine. When I copy over the config on the docs it seems to work.

This is the error I see:

{"level":"info","timestamp":"2025-01-08T15:27:05.871Z","logger":"tekton-operator-lifecycle.event-broadcaster","caller":"record/event.go:364","msg":"Event(v1.ObjectReference{Kind:\"TektonConfig\", Namespace:\"\", Name:\"config\", UID:\"a918f28a-2e82-45e2-b6b3-7c65e05db8ed\", APIVersion:\"operator.tekton.dev/v1alpha1\", ResourceVersion:\"16893\", FieldPath:\"\"}): type: 'Warning' reason: 'InternalError' reconcile again and proceed","commit":"9ae359b-dirty","knative.dev/pod":"tekton-operator-f656d79c5-2g8rv"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1996a37]

goroutine 410 [running]:
github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade.upgradePipelineProperties({0x22c74e8, 0xc000968690}, 0x2?, {0xc0004ba390?, 0x1fc12ff?}, {0x7f5abefb9838, 0xc00049fa80}, 0x0?)
	github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/pre_upgrade.go:70 +0x97
github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade.(*Upgrade).executeUpgrade(0xc00088fa40, {0x22c74e8, 0xc000968690}, {0x32a0790, 0x2, 0x1fc592c?}, 0x1)
	github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/upgrade.go:100 +0x3bd
github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade.(*Upgrade).RunPreUpgrade(...)
	github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/upgrade.go:66
github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig.(*Reconciler).ReconcileKind(0xc000885050, {0x22c74e8, 0xc000968690}, 0xc001092008)
	github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/tektonconfig.go:117 +0x36c
github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig.(*reconcilerImpl).Reconcile(0xc000396dc0, {0x22c74e8, 0xc000968660}, {0xc000b4e466, 0x6})
	github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonconfig/reconciler.go:236 +0x4d2
knative.dev/pkg/controller.(*Impl).processNextWorkItem(0xc0009b7e00)
	knative.dev/[email protected]/controller/controller.go:542 +0x508
knative.dev/pkg/controller.(*Impl).RunContext.func3()
	knative.dev/[email protected]/controller/controller.go:491 +0x59
created by knative.dev/pkg/controller.(*Impl).RunContext in goroutine 469
	knative.dev/[email protected]/controller/controller.go:489 +0x325

If I copy the example TektonConfig and update the properties to match what I have (which is just a smaller config) and remove these properties

  • nodeSelector: <>
  • disable-home-env-overwrite: true
  • disable-working-directory-overwrite: true

it worked.

So, my TektonConfig looks like:

  apiVersion: operator.tekton.dev/v1alpha1
  kind: TektonConfig
  metadata:
    name: config
  spec:
    profile: all
    targetNamespace: tekton-pipelines
    targetNamespaceMetadata:
      labels: {}
      annotations: {}
    config:
      tolerations: []
      priorityClassName: system-cluster-critical
    pipeline:
      await-sidecar-readiness: true
      coschedule: isolate-pipelinerun
      disable-affinity-assistant: true
      disable-creds-init: false
      disable-inline-spec: "pipeline,pipelinerun,taskrun"
      enable-api-fields: stable
      enable-bundles-resolver: true
      enable-cel-in-whenexpression: false
      enable-cluster-resolver: true
      enable-custom-tasks: false
      enable-git-resolver: true
      enable-hub-resolver: false
      enable-param-enum: false
      enable-provenance-in-status: true
      enable-step-actions: false
      enforce-nonfalsifiability: none
      keep-pod-on-cancel: false
      max-result-size: 4096
      metrics.count.enable-reason: false
      metrics.pipelinerun.duration-type: histogram
      metrics.pipelinerun.level: pipeline
      metrics.taskrun.duration-type: histogram
      metrics.taskrun.level: task
      require-git-ssh-secret-known-hosts: false
      results-from: termination-message
      running-in-environment-with-injected-sidecars: true
      send-cloudevents-for-runs: false
      set-security-context: false
      trusted-resources-verification-no-match-policy: ignore
      performance:
        disable-ha: true
        buckets: 1
        replicas: 1
        threads-per-controller: 2
        kube-api-qps: 5.0
        kube-api-burst: 10
      options:
        disabled: false
        configMaps: {}
        deployments: {}
        webhookConfigurationOptions: {}
    pruner:
      disabled: false
      keep: 1
      schedule: "0 * * * *"
      resources:
        - taskrun
        - pipelinerun
    chain:
      disabled: true
    dashboard:
      readonly: false
      options:
        disabled: false
        configMaps: {}
        deployments: {}
        webhookConfigurationOptions: {}
    hub:
      params:
        - name: enable-devconsole-integration
          value: "true"
      options:
        disabled: true
        configMaps: {}
        deployments: {}
        webhookConfigurationOptions: {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants