Bug 1653697 - OpenShift BitBucket webhook causes atomic-openshift-master-api service crash when pushing tagged commits
Summary: OpenShift BitBucket webhook causes atomic-openshift-master-api service crash ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.9.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: wewang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-27 12:30 UTC by Antti Rahikainen
Modified: 2018-11-27 15:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-27 15:06:43 UTC
Target Upstream Version:


Attachments (Terms of Use)
Failing BitBucket webhook payload (5.69 KB, text/plain)
2018-11-27 12:31 UTC, Antti Rahikainen
no flags Details
Succesful BitBucket webhook payload (11.73 KB, text/plain)
2018-11-27 12:32 UTC, Antti Rahikainen
no flags Details
openshift-logs (7.09 KB, text/plain)
2018-11-27 12:36 UTC, Antti Rahikainen
no flags Details

Description Antti Rahikainen 2018-11-27 12:30:08 UTC
Description of problem:

If BitBucket webhook is used to triggeer build and git-commit contains git tag, OpenShift master-api-service crashes and coredump is created.


Version-Release number of selected component (if applicable):

oc version
oc v3.9.30
kubernetes v1.9.1+a0ce1bc657
features: Basic-Auth GSSAPI Kerberos SPNEGO


How reproducible:

Every time


Steps to Reproduce:
1. Create Bitbucket webhook to trigger a build using: Triggers: repo:push
2. Push some code to repository with tag to trigger the build
3. OpenShift master-api-service crashes

Actual results:

Openshift-master-api-service crashes and generates core-dump

Expected results:

Build starts normally


Additional info:

https://github.com/openshift/origin/blob/e004e6513ec755a7a106dc97516703847e470d0b/pkg/build/webhook/bitbucket/bitbucket.go#L159

On line 159 the parser expects lastCommits to be present on the JSON-payload.

But when push is tagged with some git-tag parser fails to read the commit information.

Comment 1 Antti Rahikainen 2018-11-27 12:31:39 UTC
Created attachment 1508809 [details]
Failing BitBucket webhook payload

Comment 2 Antti Rahikainen 2018-11-27 12:32:08 UTC
Created attachment 1508810 [details]
Succesful BitBucket webhook payload

Comment 3 Antti Rahikainen 2018-11-27 12:36:17 UTC
Created attachment 1508811 [details]
openshift-logs

Comment 4 Antti Rahikainen 2018-11-27 13:27:56 UTC
Seems to fixed on upstream 3.10: https://github.com/openshift/origin/blob/release-3.10/pkg/build/webhook/bitbucket/bitbucket.go

if len(event.Push.Changes) == 0 || len(event.Push.Changes[0].Commits) == 0 

So should this be backported to 3.9?

Where:

if len(event.Push.Changes) == 0

And webhook payload includes changes but no commits (just tags).

Comment 5 Ben Parees 2018-11-27 15:06:43 UTC
We would only backport it if there is a specific customer request and that customer cannot reasonably upgrade to 3.10.

Closing as won't fix for now, pending that request/requirement.


Note You need to log in before you can comment on or make changes to this bug.