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

Conversion webhook panic #6823

Closed
lbernick opened this issue Jun 13, 2023 · 4 comments
Closed

Conversion webhook panic #6823

lbernick opened this issue Jun 13, 2023 · 4 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@lbernick
Copy link
Member

lbernick commented Jun 13, 2023

Actual Behavior

Observing the following webhook logs:

2023/06/13 14:14:53 http: panic serving 10.28.3.3:49418: runtime error: invalid memory address or nil pointer dereference
goroutine 1797 [running]:
net/http.(*conn).serve.func1()
	net/http/server.go:1850 +0xbf
panic({0x1ab5220, 0x2e4db50})
	runtime/panic.go:890 +0x262
github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.retrieveTaskDeprecation(0xc000fc9008)
	github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/task_conversion.go:297 +0xb1
github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.serializeTaskDeprecations(0xc000fd0560, 0xc000b01b00?, {0xc000e64f18, 0x11})
	github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/task_conversion.go:201 +0x5d
github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.(*TaskSpec).ConvertTo(0xc000fc9008, {0x20220d8, 0xc000fd2c30}, 0xc000fd0648, 0xc000b44d58?, {0xc000e64f18?, 0xb5836f?})
	github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/task_conversion.go:77 +0x65
github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.(*Task).ConvertTo(0xc000fc8f00, {0x20220d8, 0xc000fd2c30}, {0x200b0a8?, 0xc000fd0540?})
	github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1/task_conversion.go:69 +0x131
knative.dev/pkg/webhook/resourcesemantics/conversion.(*reconciler).convert(0xc0001f73b0, {0x20220d8, 0xc000fd2ae0}, {{0xc000818d80, 0x43d, 0x480}, {0x0, 0x0}}, {0xc000a8e2d0, 0xd})
	knative.dev/pkg@v0.0.0-20230221145627-8efb3485adcf/webhook/resourcesemantics/conversion/conversion.go:143 +0x1083
knative.dev/pkg/webhook/resourcesemantics/conversion.(*reconciler).Convert(0xc0001f73b0, {0x20220d8?, 0xc000fd2ab0?}, 0xc000ffe880)
	knative.dev/pkg@v0.0.0-20230221145627-8efb3485adcf/webhook/resourcesemantics/conversion/conversion.go:57 +0x219
knative.dev/pkg/webhook.conversionHandler.func1({0x201fab0?, 0xc000f5aee0}, 0xc000fbcd00)
	knative.dev/pkg@v0.0.0-20230221145627-8efb3485adcf/webhook/conversion.go:66 +0x482
net/http.HandlerFunc.ServeHTTP(0xc000b45a30?, {0x201fab0?, 0xc000f5aee0?}, 0x667d05?)
	net/http/server.go:2109 +0x2f
net/http.(*ServeMux).ServeHTTP(0xc000fd2960?, {0x201fab0, 0xc000f5aee0}, 0xc000fbcd00)
	net/http/server.go:2487 +0x149
knative.dev/pkg/webhook.(*Webhook).ServeHTTP(0xc0000f2c80, {0x201fab0, 0xc000f5aee0}, 0xc000fbcd00)
	knative.dev/pkg@v0.0.0-20230221145627-8efb3485adcf/webhook/webhook.go:263 +0xb3
knative.dev/pkg/network/handlers.(*Drainer).ServeHTTP(0xc0001ccc40, {0x201fab0, 0xc000f5aee0}, 0xc000fbcd00)
	knative.dev/pkg@v0.0.0-20230221145627-8efb3485adcf/network/handlers/drain.go:113 +0x15e
net/http.serverHandler.ServeHTTP({0x2011c00?}, {0x201fab0, 0xc000f5aee0}, 0xc000fbcd00)
	net/http/server.go:2947 +0x30c
net/http.(*conn).serve(0xc001110640, {0x20220d8, 0xc0002b1740})
	net/http/server.go:1991 +0x607
created by net/http.(*Server).Serve
	net/http/server.go:3102 +0x4db

Also cannot list tasks:

$ k get task
Error from server: conversion webhook for tekton.dev/v1beta1, Kind=Task failed: Post "https://tekton-pipelines-webhook.tekton-pipelines.svc:443/resource-conversion?timeout=30s": EOF

This appears to be the offending Task:

$ k get task echo-good-morning
Error from server: conversion webhook for tekton.dev/v1beta1, Kind=Task failed: Post "https://tekton-pipelines-webhook.tekton-pipelines.svc:443/resource-conversion?timeout=30s": EOF

# leebernick @ leebernick-macbookpro2 in ~/tekton/pipeline on git:main o [10:59:31] C:1
$ k get tasks.v1beta1.tekton.dev echo-good-morning
NAME                AGE
echo-good-morning   396d

# leebernick @ leebernick-macbookpro2 in ~/tekton/pipeline on git:main o [10:59:40]
$ k get tasks.v1beta1.tekton.dev echo-good-morning -o yaml
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"tekton.dev/v1beta1","kind":"Task","metadata":{"annotations":{},"name":"echo-good-morning","namespace":"default"},"spec":{"steps":[{"image":"alpine","name":"echo","readinessProbe":{"exec":{"command":["cat","/tmp/healthy"]}},"script":"echo \"Good Morning!\"\n"}]}}
  creationTimestamp: "2022-05-12T19:08:38Z"
  generation: 1
  name: echo-good-morning
  namespace: default
  resourceVersion: "225627635"
  uid: 15674cea-58d2-4c59-b3ea-48171674559c
spec:
  steps:
  - image: alpine
    name: echo
    readinessProbe:
      exec:
        command:
        - cat
        - /tmp/healthy
    resources: {}
    script: |
      echo "Good Morning!"

Additional Info

  • Kubernetes version:
Client Version: v1.25.4
Kustomize Version: v4.5.7
Server Version: v1.24.12-gke.500
  • Tekton Pipeline version:

main branch

@lbernick lbernick added the kind/bug Categorizes issue or PR as related to a bug. label Jun 13, 2023
@chitrangpatel
Copy link
Contributor

/assign

chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue Jun 13, 2023
Prior to this, the conversion of task spec from v1beta1
was panicing when the step template was nil since it could not
access the underlying deprecated fields. This PR fixes that bug.
Related issue: tektoncd#6823
@chitrangpatel
Copy link
Contributor

#6825 attempts to fix this.

chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue Jun 13, 2023
Prior to this, the conversion of task spec from v1beta1
was panicing when the step template was nil since it could not
access the underlying deprecated fields. This PR fixes that bug.
Related issue: tektoncd#6823
chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue Jun 13, 2023
Prior to this, the conversion of task spec from v1beta1
was panicing when the step template was nil since it could not
access the underlying deprecated fields. This PR fixes that bug.
Related issue: tektoncd#6823
tekton-robot pushed a commit that referenced this issue Jun 13, 2023
Prior to this, the conversion of task spec from v1beta1
was panicing when the step template was nil since it could not
access the underlying deprecated fields. This PR fixes that bug.
Related issue: #6823
@chitrangpatel
Copy link
Contributor

Can we close this now?

@lbernick
Copy link
Member Author

yes this appears fixed now, thanks Chitrang!

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

No branches or pull requests

2 participants