Pipeline: Nil pointer when PipelineRun created v0.16.x

Created on 15 Sep 2020  ·  6Comments  ·  Source: tektoncd/pipeline

Expected Behavior

PipelineRun reconciles don't panic.

Actual Behavior

Upgrade Tekton pipeline from v0.15.2 (ok) to v0.16.0 - v0.16.2. Tasks and TaskRuns work fine, but creating a PipelineRun crashes the controller with a nil pointer panic.

[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x17f56d1]
goroutine 164 [running]:
github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun.(*Reconciler).ReconcileKind(0xc0003a7080, 0x216c240, 0xc000d8d770, 0xc000d48a00, 0xc000d48a00, 0x0)
        github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/pipelinerun.go:147 +0x1281
github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1beta1/pipelinerun.(*reconcilerImpl).Reconcile(0xc00074db80, 0x216c240, 0xc000d8d710, 0xc000c79680, 0x12, 0xc00087cc70, 0x216c240)
        github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1beta1/pipelinerun/reconciler.go:237 +0x1299
github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller.(*Impl).processNextWorkItem(0xc0008ed0e0, 0xc00096ba00)
        github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller/controller.go:465 +0x785
github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller.(*Impl).RunContext.func3(0xc000eef960, 0xc0008ed0e0)
        github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller/controller.go:403 +0x53
created by github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller.(*Impl).RunContext
        github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller/controller.go:401 +0x1f5

Steps to Reproduce the Problem

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: debug-task
  namespace: tekton
spec:
  steps:
    - name: foo
      image: docker.io/alpine:3.12
      script: |
        echo "hello"
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: debug-pipeline
  namespace: tekton
spec:
  tasks:
    - name: task
      taskRef:
        name: debug-task
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: debug-
  namespace: tekton
spec:
  pipelineRef:
    name: debug-pipeline
kubectl apply -f task.yaml
kubectl apply -f pipeline.yaml
kubectl create -f pipelinerun.yaml

Additional Info

  • Kubernetes version: v1.19.1
  • Tekton Pipeline version: v0.16.2
kinbug

All 6 comments

@dghubble thanks for the issue. Looking at the code this shouldn't happen except if there is not default timeout applied. I am not sure why there wouldn't be any applied (we do set one). Did you configure the default timeout ? Can you share the tekton-pipelines configmap content ?

(Created #3235 for a quick fix but I wonder how it happened and how we did not catch this in the CI)

Oh maybe. I've never really customized it.

apiVersion: v1
kind: ConfigMap
metadata:
  name: tekton-defaults
  namespace: tekton
data:
  _example: |-
    ################################
    #                              #
    #    EXAMPLE CONFIGURATION     #
    #                              #
    ################################

    # This block is not actually functional configuration,
    # but serves to illustrate the available configuration
    # options and document them in a way that is accessible
    # to users that `kubectl edit` this config map.
    #
    # These sample configuration options may be copied out of
    # this example block and unindented to be in the data block
    # to actually change the configuration.

    # default-timeout-minutes contains the default number of
    # minutes to use for TaskRun and PipelineRun, if none is specified.
    default-timeout-minutes: "60"  # 60 minutes

    # default-service-account contains the default service account name
    # to use for TaskRun and PipelineRun, if none is specified.
    default-service-account: "default"

    # default-managed-by-label-value contains the default value given to the
    # "app.kubernetes.io/managed-by" label applied to all Pods created for
    # TaskRuns. If a user's requested TaskRun specifies another value for this
    # label, the user's request supercedes.
    default-managed-by-label-value: "tekton-pipelines"

    # default-pod-template contains the default pod template to use
    # TaskRun and PipelineRun, if none is specified. If a pod template
    # is specified, the default pod template is ignored.
    # default-pod-template:

Used in the deployment as

          - name: CONFIG_DEFAULTS_NAME
            value: tekton-defaults

Updating to the following doesn't seem to affect the panic.

apiVersion: v1
kind: ConfigMap
metadata:
  name: tekton-defaults
  namespace: tekton
data:
  default-timeout-minutes: "60"

@dghubble ok thanks :hugs:

Well it definitely does seem to be timeout related! If I tweak the PipelineRun to have an explicit timeout, it can be created. No panic!

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: debug-
  namespace: tekton
spec:
  timeout: "60m"
  pipelineRef:
    name: debug-pipeline

@dghubble right, then I think https://github.com/tektoncd/pipeline/pull/3235 should fix it.
@bobcatfish we will need a 0.16.3 sounds like :stuck_out_tongue_closed_eyes:

kk sg! thanks @vdemeester :D

Was this page helpful?
0 / 5 - 0 ratings