Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1373788 - When master port is 443, oc start build by webhook from webconsole lost url port and failed with unknown signed certification.
When master port is 443, oc start build by webhook from webconsole lost url p...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.3.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Cesar Wong
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-07 03:19 EDT by XiaochuanWang
Modified: 2017-03-08 13 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Comparison of master host/port with that specified by the user fails because the user-specified URL may not contain the default port (when using 443). Consequence: The build fails to trigger. Fix: Fix the comparison of the host/port to account for default port. Result: Start build works when the master port is 443 and is using a self-signed certificate.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-18 07:53:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 12:23:26 EST

  None (edit)
Description XiaochuanWang 2016-09-07 03:19:04 EDT
Description of problem:
Start build by webhook url from console(no port for the webhookurl) failed with unknown signed certification.

Version-Release number of selected component (if applicable):
oc/openshift 3.3.0.30

How reproducible:
Always

Steps to Reproduce:
1. oc process -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json | oc create -f -
2. Go to web console, go to build config page, check "Configuration" and copy the link of "GitHub webhook URL"
3. oc start-build --from-webhook='https://xxx/oapi/v1/namespaces/xiaocwan-sti/buildconfigs/ruby-sample-build/webhooks/secret101/generic' --loglevel=8

Actual results:
2 "GitHub webhook URL" and "GitHub webhook URL" on web-console lost the port (:443) compared to `oc describe bc/<bc>`
3 Start build with webhook (without port) will lead the below error:
Unable to connect to the server: x509: certificate signed by unknown authority
I0907 10:28:35.308518   26281 startbuild.go:609] Triggering hook https://xxx/oapi/v1/namespaces/xiaocwan-p/buildconfigs/ruby-sample-build/webhooks/secret101/github
I0907 10:28:36.168264   26281 helpers.go:199] Connection error: Post https://xxx/oapi/v1/namespaces/xiaocwan-p/buildconfigs/ruby-sample-build/webhooks/secret101/github: x509: certificate signed by unknown authority
F0907 10:28:36.168322   26281 helpers.go:110] Unable to connect to the server: x509: certificate signed by unknown authority

Expected results:
2. webhook url on web console should keep same with `oc describe bc`
3. New build start with "build "ruby-sample-build-2" started"

Additional info:
`oc describe bc/<bc>` has the port and it will not raise the error.
Not reproduced on env:8443
Comment 1 Jessica Forrester 2016-09-07 08:27:10 EDT
443 is an optional port, it should not be required, it looks like there is a bug on oc start-build
Comment 2 Ben Parees 2016-09-21 04:30:28 EDT
sorry didn't realize Cesar had a pull open for this:
https://github.com/openshift/origin/pull/10836
Comment 3 XiaochuanWang 2016-09-30 03:45:22 EDT
Reproduced by same steps as comment 0 on latest origin which port is 8443, ami: rhel7_5101
oc/openshift v1.4.0-alpha.0+75ee6c9

Please refer to attachment for the full log.
Comment 5 Cesar Wong 2016-09-30 08:46:20 EDT
@XiaochuanWang I'm not sure that you reproduced the issue. If you logged in to the cluster and decided to skip certificate verification, then you will still get a certificate error when invoking start-build --from-webhook. However, if you are logged in with a valid certificate (oc login --certificate-authority=/path/to/ca.crt), then the webhook invocation should not complain about an invalid certificate. This part was working as long as the URL to the cluster had a port that was not 443. If the URL to the cluster had a 443 port, then you could reproduce this bug.
Comment 6 XiaochuanWang 2016-10-08 05:21:45 EDT
Not reproduced on OCP openshift 3.3.1.1
Steps:
1. oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json 
2. Go to web console, go to build config page, check "Configuration" and copy the link of "Generic webhook URL"
3. oc start-build --from-webhook='https://xxx:8443/oapi/v1/namespaces/xiaocwan-sti/buildconfigs/ruby-sample-build/webhooks/secret101/generic'

New build started, URL from web console is same with `oc describe bc`.

(To compare:) # oc start-build --from-webhook='https://xxx/oapi/v1/namespaces/xiaocwan-sti/buildconfigs/ruby-sample-build/webhooks/secret101/generic'
The connection to the server xxx.xxx.xxx.com was refused - did you specify the right host or port?
Comment 7 XiaochuanWang 2016-10-11 03:22:27 EDT
Also not reproduced on OCP openshift/oc 3.3.1.1 with port 443 env, steps are same as Comment 6.
Comment 9 errata-xmlrpc 2017-01-18 07:53:42 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0066

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