Bug 1601918 - jib maven plugin fails due to mismatching registry certificates
Summary: jib maven plugin fails due to mismatching registry certificates
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image Registry
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: Dongbo Yan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-17 13:02 UTC by Siamak Sadeghianfar
Modified: 2018-08-03 14:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-03 14:23:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
maven logs (444.62 KB, text/plain)
2018-07-18 14:53 UTC, Siamak Sadeghianfar
no flags Details

Description Siamak Sadeghianfar 2018-07-17 13:02:53 UTC
When using Google's jib maven plugin to build and push images Online registry, the plugin complains about mismatching certificates:

hostname in certificate didn't match: <registry.pro-us-east-1.openshift.com> != <*.b9ad.pro-us-east-1.openshiftapps.com> OR <*.b9ad.pro-us-east-1.openshiftapps.com> OR <b9ad.pro-us-east-1.openshiftapps.com>

Steps to Reproduce:

$ wget https://github.com/spring-projects/spring-petclinic/archive/master.zip
$ unzip master
$ cd spring-petclinic-master
$ export PRJ_NAME=testprj
$ oc login ONLINE
$ oc new-project $PRJ_NAME
$ mvn compile com.google.cloud.tools:jib-maven-plugin:0.9.6:build -Dimage=registry.pro-us-east-1.openshift.com/$PRJ_NAME/spring-petclinic

Comment 1 Ben Parees 2018-07-17 14:17:22 UTC
not sure who's responsible for setting up the registry cert in pro, but let's start w/ Stefanie.

Comment 2 Stefanie Forrester 2018-07-17 22:39:47 UTC
The registry cert itself seems fine. It matches the hostname registry.pro-us-east-1.openshift.com:

[dakini@localhost ~]$ curl -v --head https://registry.pro-us-east-1.openshift.com
* Server certificate:
*  subject: C=US; ST=North Carolina; L=Raleigh; O=Red Hat Inc.; OU=RHC Cloud Operations; CN=*.pro-us-east-1.openshift.com
*  start date: May 19 00:00:00 2018 GMT
*  expire date: May 23 12:00:00 2019 GMT
*  subjectAltName: host "registry.pro-us-east-1.openshift.com" matched cert's "*.pro-us-east-1.openshift.com"
*  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA

Comment 3 Ben Parees 2018-07-18 01:41:51 UTC
any idea where b9ad.pro-us-east-1.openshiftapps.com would be coming from?

Comment 4 Siamak Sadeghianfar 2018-07-18 07:13:50 UTC
(In reply to Ben Parees from comment #3)
> any idea where b9ad.pro-us-east-1.openshiftapps.com would be coming from?

The subdomain b9ad.pro-us-east-1.openshiftapps.com is what I see assigned to me on Online. All apps I create are under that domain but not sure how the registry is getting mixed up with that.

Comment 5 Ben Parees 2018-07-18 14:47:32 UTC
Seems like a jib issue to me.  Can you get some verbose output from maven so maybe we can see what it actually thinks it is doing?

Comment 6 Siamak Sadeghianfar 2018-07-18 14:53:02 UTC
Created attachment 1459734 [details]
maven logs

Comment 7 Ben Parees 2018-07-18 22:33:03 UTC
I get a completely different error:

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.6:build (default-cli) on project spring-petclinic: Build image failed: Tried to retrieve authentication method for registry.pro-us-east-1.openshift.com but failed because: Failed get authentication method from 'WWW-Authenticate' header | If this is a bug, please file an issue at https://github.com/GoogleContainerTools/jib/issues/new: Failed to authenticate with the registry because: 'service' was not found in the 'WWW-Authenticate' header, tried to parse: Bearer realm="https://registry.pro-us-east-1.openshift.com/openshift/token" -> [Help 1]


but fundamentally i think you're more likely to get resolution to this by opening a Jib issue, it doesn't seem like our registry is configured incorrectly, so it may have something to do with how they are connecting to it/authenticating to it.

(I performed a local docker login to the registry, so my docker config.json should have proper credentials, which Jib doc indicates it will use by default).

I also can't get it to push to docker.io, with a different resulting error, i'm curious if you managed to get that working as a starting point?

Comment 8 Siamak Sadeghianfar 2018-07-19 08:48:33 UTC
Created a jib issue: https://github.com/GoogleContainerTools/jib/issues/659

Comment 9 Ben Parees 2018-08-03 14:23:53 UTC
Based on the latest comments on the issue it sounds like this is resolved.
https://github.com/GoogleContainerTools/jib/issues/659#issuecomment-406369597


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