-
Bug
-
Resolution: Unresolved
-
Undefined
-
Pipelines 1.16.0
-
False
-
None
-
False
-
Fix crash of the pipelines-as-code-controller when there is bad payload coming to the bitbucket provider
-
-
Description of problem:
Pipeline As Code controller keep going to crashloopbackoff with a null pointer reference memory panic.
{"level":"info","ts":1728492686.2326016,"caller":"configutil/config.go:50","msg":"updating value for field ErrorDetectionSimpleRegexp: from '^(?P<filename>[^:]*):(?P<line>[0-9]+):(?P<column>[0-9]+)?([ ]*)?(?P<error>.*)' to '^(?P<filename>[^:]*):(?P<line>[0-9]+):(?P<column>[0-9]+):([ ]*)?(?P<error>.*)'"}panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1f0f2f9] goroutine 155 [running]:
(0xc00012a580, {0xc0002cc200?, 0x40?}, 0x7f680c7c1438?, 0xc000170ea0, {0xc0005c6200, 0x40}) /go/src/
github.com/openshift-pipelines/pipelines-as-code/pkg/provider/bitbucketserver/parse_payload.go:75
+0xb59
github.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*sinker).processEventPayload
(0xc0001149c0, {0x2cdffb8, 0xc0005eaa50}, 0xc000170ea0) /go/src/
github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/sinker.go:30
+0x97
github.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*sinker).processEvent
(0xc0001149c0, {0x2cdffb8, 0xc0005eaa50}, 0x0?) /go/src/
github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/sinker.go:54
+0x137
/go/src/
github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/adapter.go:199
+0x2c created by
in goroutine 152 /go/src/
github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/adapter.go:198
+0x9d7
Prerequisites (if any, like setup, operators/versions):
Steps to Reproduce
# Upgrade pipelines operator to 1.16
# send payload from Bitbucket server or try the following.
curl -X POST https://pipelines-as-code-controller-openshift-pipelines.apps.bo-ose-hpc-prod.micron.com \ -H "Authorization: Bearer <SECRET>" \ -H "Content-Type: application/json" \ -d '{"eventKey":"pr:comment:added","comment":{"text":"/ok-to-test"}}' \ -H "X-Event-Key: pr:comment:added"
Actual results:
The pac controller crashes with memory panic as mentioned above
Expected results:
The pac controller should not crash
Reproducibility (Always/Intermittent/Only Once): Always
Acceptance criteria:
Definition of Done:
Build Details:
Additional info (Such as Logs, Screenshots, etc):