Bug 1584996

Summary: [Behindproxy]Failed to connect to maven repo when build with openshift/wildfly-101-centos7
Product: OpenShift Container Platform Reporter: Wenjing Zheng <wzheng>
Component: RFEAssignee: Ben Parees <bparees>
Status: CLOSED UPSTREAM QA Contact: Wenjing Zheng <wzheng>
Severity: low Docs Contact:
Priority: medium    
Version: 3.10.0CC: aos-bugs, bparees, erich, jokerman, mmccomas, snalawad, wsun, wzheng
Target Milestone: ---Keywords: Reopened
Target Release: 3.11.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-12 13:53:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wenjing Zheng 2018-06-01 06:22:40 UTC
Description of problem:
Meet below error when build with openshift/wildfly-101-centos7 image in a behind proxy cluster:
[INFO] Downloading: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:07 min
[INFO] Finished at: 2018-06-01T02:39:11+00:00
[INFO] Final Memory: 13M/102M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo1.maven.org/maven2): Connect to repo1.maven.org:443 [repo1.maven.org/151.101.200.209] failed: Connection timed out (Connection timed out) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Aborting due to error code 1 from mvn package
error: build error: non-zero (13) exit code from openshift/wildfly-101-centos7@sha256:e6b024745274fc786155a5103fbe4913bbfe1d5c51a31bd7f634a08c3b012750

Version-Release number of selected component (if applicable):
docker.io/openshift/wildfly-101-centos7    7503a354c0f5 

How reproducible:
always

Steps to Reproduce:
1.Create a wildfly app
oc new-app openshift/wildfly-101-centos7~https://github.com/danmcp/openshift-jee-sample.git -e AUTO_DEPLOY_EXPLODED=true
2.
3.

Actual results:
openshift-jee-sample-1   Source    Git@51807be   Failed (AssembleFailed)   About an hour ago   2m14s

Expected results:
Build should succeed like in cluster which is NOT behind proxy.

Additional info:

Comment 1 Ben Parees 2018-06-01 14:28:33 UTC
did you set "HTTP_PROXY_HOST" and "HTTP_PROXY_PORT" ?

those are the variables the wildfly image uses to configure its maven proxy settings.

Comment 3 Wenjing Zheng 2018-07-23 09:40:28 UTC
Is it possible to let wildfly image read the proxy setting in master-config? so that users don't need to define it manuallt.

Comment 4 Ben Parees 2018-07-23 15:30:05 UTC
> Is it possible to let wildfly image read the proxy setting in master-config? so that users don't need to define it manuallt.

definitely not master-config.

The global proxy settings for builds would come from the build defaulter/overrider plugin, which, when using ansible, do automatically get configured to set the cluster proxy settings.  However they still will only set HTTP_PROXY/HTTPS_PROXY, so the wildfly image won't do anything with them today.

The wildfly image would need to be updated to respect HTTP_PROXY/HTTPS_PROXY instead of(or in addition to) HTTP_PROXY_HOST/HTTP_PROXY_PORT.

I can look at making that change.

Comment 5 Wenjing Zheng 2018-07-24 02:57:29 UTC
Thanks for your reply, I will change this bug to a RFE bug to track this issue, ok?

Comment 6 Ben Parees 2018-07-24 18:20:11 UTC
PR: https://github.com/openshift-s2i/s2i-wildfly/pull/171

Comment 7 Wenjing Zheng 2018-08-14 06:30:44 UTC
Ben,whether this change only apply to openshift/wildfly-130-centos7? But openshift/wildfly-130-centos7 also failed with below error:
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo1.maven.org/maven2): http://file.rdu.redhat.com: Name or service not known: Unknown host http://file.rdu.redhat.com: Name or service not known -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Aborting due to error code 1 from mvn package
error: build error: non-zero (13) exit code from openshift/wildfly-130-centos7@sha256:7e8d7d44402ce2a91f640e6d45563733e667a33ffc9f478b04b06d08a9e35606

Comment 8 Ben Parees 2018-08-14 13:25:00 UTC
Yes I only made the change in the 13.0 wildfly image.


I think this is working correctly..  maven is now using your proxy as expected.  However the container running maven presumably does not have access to the redhat network(or perhaps the VPN DNS settings) and thus can't resolve the proxy hostname you're using.

Comment 9 Wenjing Zheng 2018-08-21 03:03:59 UTC
Out proxy address has port number 3128, actually, it should use http://file.rdu.redhat.com:3128 to download package.

Comment 10 Ben Parees 2018-08-21 03:10:54 UTC
you're getting an unknown host error, the port is irrelevant because it failed to resolve "file.rdu.redhat.com" as a valid hostname.

Comment 11 Wenjing Zheng 2018-08-21 10:21:23 UTC
OK, moving this bug to be verified now.