Bug 1368114

Summary: [Behind Proxy] nodejs-4-rhel7 image cannot work behind http proxy
Product: OpenShift Container Platform Reporter: Ben Parees <bparees>
Component: ImageStreamsAssignee: Ben Parees <bparees>
Status: CLOSED CURRENTRELEASE QA Contact: Wang Haoran <haowang>
Severity: high Docs Contact:
Priority: high    
Version: 3.3.0CC: aos-bugs, bparees, haowang, jkaur, jokerman, kanderso, mmccomas, plarsen, pweil, qe-baseos-apps, tdawson, trogers, xtian, zsvetlik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Older version of nodesj-tunnel-agent package did not handle proxies correctly. Consequence: Failure to retrieve packages when using a proxy. Fix: Updated to newer nodejs-tunnel-agent package/version. Result: Proxy behavior is correct now.
Story Points: ---
Clone Of: 1366491 Environment:
Last Closed: 2016-11-22 22:23:24 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:
Bug Depends On: 1366491    
Bug Blocks:    

Description Ben Parees 2016-08-18 12:58:36 UTC
This is a tracking bug for 1366491 to ensure we have this blocker bug on our radar despite 1366491 not being against OCP.

+++ This bug was initially created as a clone of Bug #1366491 +++

Description of problem:
nodejs-4-rhel7 image cannot work behind http proxy , nodejs-010-rhel7 works, but have Error log .

Version-Release number of selected component (if applicable):
openshift v3.3.0.18
kubernetes v1.3.0+507d3a7
etcd 2.3.0+git

brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/rhscl/nodejs-4-rhel7             latest              e6bc445bbb9c        2 weeks ago         449.4 MB
brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/nodejs-010-rhel7      latest              c2ed886f2b79        2 weeks ago         439.3 MB


How reproducible:
always

Steps to Reproduce:
1. install env with http_proxy enable in the buildDefaults admission plugin 
BuildDefaults:
        configuration:
          apiVersion: v1
          env:
          - name: HTTP_PROXY
            value: http://file.rdu.redhat.com:3128
          - name: HTTPS_PROXY
            value: http://file.rdu.redhat.com:3128
          - name: NO_PROXY
            value: .cluster.local,169.254.169.254,openshift-205.lab.sjc.redhat.com,openshift-206.lab.sjc.redhat.com,openshift-207.lab.sjc.redhat.com,openshift-220.lab.sjc.redhat.com
          - name: http_proxy
            value: http://file.rdu.redhat.com:3128
          - name: https_proxy
            value: http://file.rdu.redhat.com:3128
          - name: no_proxy
            value: .cluster.local,169.254.169.254,openshift-205.lab.sjc.redhat.com,openshift-206.lab.sjc.redhat.com,openshift-207.lab.sjc.redhat.com,openshift-220.lab.sjc.redhat.com
          gitHTTPProxy: http://file.rdu.redhat.com:3128
          gitHTTPSProxy: http://file.rdu.redhat.com:3128
          kind: BuildDefaultsConfig

2.oc new-app https://github.com/openshift/nodejs-ex
3.check the logs
[root@openshift-220 ~]# oc logs -f build/nodejs-ex-1
Using HTTP proxy http://file.rdu.redhat.com:3128 and HTTPS proxy http://file.rdu.redhat.com:3128 for script download
Downloading "https://github.com/openshift/nodejs-ex" ...

---> Installing application source ...
---> Setting npm http proxy to http://file.rdu.redhat.com:3128
---> Setting npm http proxy to http://file.rdu.redhat.com:3128
---> Setting npm https proxy to http://file.rdu.redhat.com:3128
---> Setting npm https proxy to http://file.rdu.redhat.com:3128
---> Building your Node application from source
ERROR: npm info it worked if it ends with ok
ERROR: npm info using npm.1
ERROR: npm info using node.2
ERROR: npm info preinstall nodejs-ex.1
ERROR: npm info attempt registry request try #1 at 02:22:05
ERROR: npm http request GET https://registry.npmjs.org/ejs
ERROR: npm ERR! Linux 3.10.0-327.22.2.el7.x86_64
ERROR: npm ERR! argv "/opt/rh/rh-nodejs4/root/usr/bin/node" "/opt/rh/rh-nodejs4/root/usr/bin/npm" "install" "-d"
ERROR: npm ERR! node v4.4.2
ERROR: npm ERR! npm  v2.15.1
ERROR: 
ERROR: npm ERR! Request path contains unescaped characters.
ERROR: npm ERR! 
ERROR: npm ERR! If you need help, you may report this error at:
ERROR: npm ERR!     <https://github.com/npm/npm/issues>
ERROR: npm info attempt registry request try #1 at 02:22:08
ERROR: npm http request GET https://registry.npmjs.org/express
ERROR: npm ERR! Linux 3.10.0-327.22.2.el7.x86_64
ERROR: npm ERR! argv "/opt/rh/rh-nodejs4/root/usr/bin/node" "/opt/rh/rh-nodejs4/root/usr/bin/npm" "install" "-d"
ERROR: npm ERR! node v4.4.2
ERROR: npm ERR! npm  v2.15.1
ERROR: 
ERROR: npm ERR! Request path contains unescaped characters.
ERROR: npm ERR! 
ERROR: npm ERR! If you need help, you may report this error at:
ERROR: npm ERR!     <https://github.com/npm/npm/issues>
ERROR: npm info attempt registry request try #1 at 02:22:08
ERROR: npm http request GET https://registry.npmjs.org/mocha
ERROR: npm ERR! Linux 3.10.0-327.22.2.el7.x86_64
ERROR: npm ERR! argv "/opt/rh/rh-nodejs4/root/usr/bin/node" "/opt/rh/rh-nodejs4/root/usr/bin/npm" "install" "-d"
ERROR: npm ERR! node v4.4.2
ERROR: npm ERR! npm  v2.15.1
ERROR: 
ERROR: npm ERR! Request path contains unescaped characters.
ERROR: npm ERR! 
ERROR: npm ERR! If you need help, you may report this error at:
ERROR: npm ERR!     <https://github.com/npm/npm/issues>
ERROR: npm info attempt registry request try #1 at 02:22:08
ERROR: npm http request GET https://registry.npmjs.org/mongodb
ERROR: npm ERR! Linux 3.10.0-327.22.2.el7.x86_64
ERROR: npm ERR! argv "/opt/rh/rh-nodejs4/root/usr/bin/node" "/opt/rh/rh-nodejs4/root/usr/bin/npm" "install" "-d"
ERROR: npm ERR! node v4.4.2
ERROR: npm ERR! npm  v2.15.1
ERROR: 
ERROR: npm ERR! Request path contains unescaped characters.
ERROR: npm ERR! 
ERROR: npm ERR! If you need help, you may report this error at:
ERROR: npm ERR!     <https://github.com/npm/npm/issues>
ERROR: npm info attempt registry request try #1 at 02:22:08
ERROR: npm http request GET https://registry.npmjs.org/morgan
ERROR: npm ERR! Linux 3.10.0-327.22.2.el7.x86_64
ERROR: npm ERR! argv "/opt/rh/rh-nodejs4/root/usr/bin/node" "/opt/rh/rh-nodejs4/root/usr/bin/npm" "install" "-d"
ERROR: npm ERR! node v4.4.2
ERROR: npm ERR! npm  v2.15.1
ERROR: 
ERROR: npm ERR! Request path contains unescaped characters.
ERROR: npm ERR! 
ERROR: npm ERR! If you need help, you may report this error at:
ERROR: npm ERR!     <https://github.com/npm/npm/issues>
ERROR: npm info attempt registry request try #1 at 02:22:08
ERROR: npm http request GET https://registry.npmjs.org/object-assign
ERROR: npm ERR! Linux 3.10.0-327.22.2.el7.x86_64
ERROR: npm ERR! argv "/opt/rh/rh-nodejs4/root/usr/bin/node" "/opt/rh/rh-nodejs4/root/usr/bin/npm" "install" "-d"
ERROR: npm ERR! node v4.4.2
ERROR: npm ERR! npm  v2.15.1
ERROR: 
ERROR: npm ERR! Request path contains unescaped characters.
ERROR: npm ERR! 
ERROR: npm ERR! If you need help, you may report this error at:
ERROR: npm ERR!     <https://github.com/npm/npm/issues>
ERROR: npm info attempt registry request try #1 at 02:22:08
ERROR: npm http request GET https://registry.npmjs.org/chai
ERROR: npm ERR! Linux 3.10.0-327.22.2.el7.x86_64
ERROR: npm ERR! argv "/opt/rh/rh-nodejs4/root/usr/bin/node" "/opt/rh/rh-nodejs4/root/usr/bin/npm" "install" "-d"
ERROR: npm ERR! node v4.4.2
ERROR: npm ERR! npm  v2.15.1
ERROR: 
ERROR: npm ERR! Request path contains unescaped characters.
ERROR: npm ERR! 
ERROR: npm ERR! If you need help, you may report this error at:
ERROR: npm ERR!     <https://github.com/npm/npm/issues>
ERROR: npm info attempt registry request try #1 at 02:22:08
ERROR: npm http request GET https://registry.npmjs.org/chai-http
ERROR: npm ERR! Linux 3.10.0-327.22.2.el7.x86_64
ERROR: npm ERR! argv "/opt/rh/rh-nodejs4/root/usr/bin/node" "/opt/rh/rh-nodejs4/root/usr/bin/npm" "install" "-d"
ERROR: npm ERR! node v4.4.2
ERROR: npm ERR! npm  v2.15.1
ERROR: 
ERROR: npm ERR! Request path contains unescaped characters.
ERROR: npm ERR! 
ERROR: npm ERR! If you need help, you may report this error at:
ERROR: npm ERR!     <https://github.com/npm/npm/issues>
ERROR: 
ERROR: npm ERR! Please include the following file with any support request:
ERROR: npm ERR!     /opt/app-root/src/npm-debug.log
error: build error: non-zero (13) exit code from brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/rhscl/nodejs-4-rhel7:latest

3. update the bc to use nodejs:010 and triger a build
4. check the logs:
ERROR: npm info attempt registry request try #1 at 02:24:35
ERROR: npm http fetch GET https://registry.npmjs.org/semver/-/semver-5.3.0.tgz
ERROR: npm http fetch 200 https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz
ERROR: npm http fetch 200 https://registry.npmjs.org/semver/-/semver-5.3.0.tgz
ERROR: npm info install resolve-from.0 into /opt/app-root/src/node_modules/mongodb/node_modules/mongodb-core/node_modules/require_optional
ERROR: npm info install semver.0 into /opt/app-root/src/node_modules/mongodb/node_modules/mongodb-core/node_modules/require_optional
ERROR: npm info installOne resolve-from.0
ERROR: npm info installOne semver.0
ERROR: npm info preinstall resolve-from.0
ERROR: npm info build /opt/app-root/src/node_modules/mongodb/node_modules/mongodb-core/node_modules/require_optional/node_modules/resolve-from
ERROR: npm info linkStuff resolve-from.0
ERROR: npm info install resolve-from.0
ERROR: npm info postinstall resolve-from.0
ERROR: npm info preinstall semver.0
ERROR: npm info build /opt/app-root/src/node_modules/mongodb/node_modules/mongodb-core/node_modules/require_optional/node_modules/semver
ERROR: npm info linkStuff semver.0
ERROR: npm info install semver.0
ERROR: npm info postinstall semver.0
ERROR: npm info build /opt/app-root/src/node_modules/mongodb/node_modules/mongodb-core/node_modules/require_optional
ERROR: npm info linkStuff require_optional.0
ERROR: npm info install require_optional.0
ERROR: npm info postinstall require_optional.0
ERROR: npm info build /opt/app-root/src/node_modules/mongodb/node_modules/mongodb-core
ERROR: npm info linkStuff mongodb-core.7
ERROR: npm info install mongodb-core.7
ERROR: npm info postinstall mongodb-core.7
ERROR: npm info build /opt/app-root/src/node_modules/mongodb
ERROR: npm info linkStuff mongodb.5
ERROR: npm info install mongodb.5
ERROR: npm info postinstall mongodb.5
ERROR: npm info build /opt/app-root/src
ERROR: npm info linkStuff nodejs-ex.1
ERROR: npm info install nodejs-ex.1
ERROR: npm info postinstall nodejs-ex.1
ERROR: npm info prepublish nodejs-ex.1
object-assign.0 node_modules/object-assign

ejs.1 node_modules/ejs

morgan.0 node_modules/morgan
├── on-headers.1
├── basic-auth.4
├── depd.0
├── on-finished.0 (ee-first.1)
└── debug.0 (ms.1)

chai.0 node_modules/chai
├── assertion-error.2
├── type-detect.0
└── deep-eql.3 (type-detect.1)

express.0 node_modules/express
├── escape-html.3
├── array-flatten.1
├── utils-merge.0
├── cookie-signature.6
├── merge-descriptors.1
├── fresh.0
├── methods.2
├── vary.0
├── path-to-regexp.7
├── encodeurl.1
├── range-parser.0
├── parseurl.1
├── content-type.2
├── cookie.1
├── etag.0
├── content-disposition.1
├── serve-static.1
├── depd.0
├── on-finished.0 (ee-first.1)
├── qs.0
├── debug.0 (ms.1)
├── finalhandler.0 (unpipe.0, statuses.0)
├── proxy-addr.2 (forwarded.0, ipaddr.js.1)
├── send.1 (destroy.4, ms.1, statuses.0, mime.4, http-errors.0)
├── type-is.13 (media-typer.0, mime-types.11)
└── accepts.3 (negotiator.1, mime-types.11)

chai-http.1 node_modules/chai-http
├── methods.1
├── cookiejar.6
├── qs.0
├── is-ip.0 (ip-regex.3)
└── superagent.0 (extend.1, methods.1, cookiejar.1, component-emitter.2, reduce-component.1, mime.4, qs.3, debug.0, formidable.14, readable-stream.27-1, form-data.0)

mocha.3 node_modules/mocha
├── escape-string-regexp.2
├── supports-color.0
├── growl.2
├── to-iso-string.2
├── commander.0
├── diff.0
├── debug.0 (ms.1)
├── mkdirp.1 (minimist.8)
├── jade.3 (commander.1, mkdirp.0)
└── glob.11 (inherits.1, minimatch.0)

mongodb.5 node_modules/mongodb
├── es6-promise.2
├── readable-stream.31 (inherits.1, isarray.1, string_decoder.31, core-util-is.2)
└── mongodb-core.7 (bson.2, require_optional.0)
ERROR: npm info ok 


Pushing image 172.30.211.221:5000/haowang/nodejs-ex:latest ...
Pushed 0/4 layers, 3% complete
Pushed 1/4 layers, 31% complete
Pushed 1/4 layers, 55% complete
Pushed 2/4 layers, 75% complete
Pushed 2/4 layers, 92% complete
Pushed 3/4 layers, 100% complete
Pushed 4/4 layers, 100% complete
Push successful

Actual results:
nodejs-4-rhel7 build failed
nodejs-010-rhel7 build success but have error log
Expected results:
the two image build should success without error log

Additional info:

--- Additional comment from Ben Parees on 2016-08-12 15:17:13 EDT ---

the "ERROR:" prefix indicates that output came from stderr from the assemble script.  We've removed that prefix in s2i and will make the change in origin soon, but it's benign and not reflective of a real error, it's just a symptom of npm not using stderr correctly.

checking on the nodejs4 issue.

--- Additional comment from Ben Parees on 2016-08-12 15:43:24 EDT ---

the proxy issue appears to be a known bug in the tunnel-agent package, we need SCL to update it:
https://github.com/npm/npm/issues/4569#issuecomment-62051308

--- Additional comment from Ben Parees on 2016-08-12 15:44:57 EDT ---

(Current package is rh-nodejs4-nodejs-tunnel-agent-0.3.0-4.el7.noarch)

Comment 1 Ben Parees 2016-09-19 08:05:42 UTC
nodejs-4-rhel7 has been updated, now includes rh-nodejs4-nodejs-tunnel-agent-0.4.3-1.el7.noarch

please re-test.

Comment 2 Wang Haoran 2016-09-19 08:26:00 UTC
Verified with image :
brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/rhscl/nodejs-4-rhel7@sha256:c1aa48962868d3633e418b899784219169b08887ac830bf9847bf1429be55964

Comment 3 Peter Larsen 2016-09-21 14:03:12 UTC
Is there a back-port for OSE 3.2?

Comment 4 Ben Parees 2016-09-21 14:07:10 UTC
the image isn't tied to a release, you can use the new image w/ a 3.2 cluster, just update your imagestream imports.

Comment 5 Peter Larsen 2016-09-21 14:15:18 UTC
(In reply to Ben Parees from comment #4)
> the image isn't tied to a release, you can use the new image w/ a 3.2
> cluster, just update your imagestream imports.

Thanks Ben - just confirmed I see the image stream in the official 3.2 release repository. I got "misled" by the "target release 3.3" tag.