Bug 1262340 - OpenShift BC does not work with proxies.
OpenShift BC does not work with proxies.
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Ben Parees
Wenjing Zheng
Depends On:
  Show dependency treegraph
Reported: 2015-09-11 08:52 EDT by Eric Rich
Modified: 2015-10-02 10:22 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-10-02 10:22:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Eric Rich 2015-09-11 08:52:31 EDT
Description of problem:

Builds that try to work behind a proxy can not connect or form a route. 

>         "source": {
>             "type": "Git",
>             "git": {
>                 "uri": "https://github.com/VeerMuchandi/time.git",
>                 "httpsProxy": ""


Based on the link above, the config provided, should be enough to allow builds using git to work (from behind a proxy); the change that introduced the option to specify proxies for git cloning did this for both STI and Docker builds:


Note this was added in 3.0.1 

However even with this in place the following errors are seen: 

F0901 19:54:19.712384       1 builder.go:64] Build error: dial tcp connection refused

#### is the github,com  ip, it's trying to connect

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

How reproducible: VERY 

Steps to Reproduce:
1. https://docs.openshift.org/latest/dev_guide/builds.html#using-a-proxy-for-git-cloning
2. https://access.redhat.com/solutions/1519243
3. buildconfig

      httpsProxy:    #https://
      uri: https://github.com/VeerMuchandi/time.git
    type: Git

Actual results:

Fails with: 

F0901 19:54:19.712384       1 builder.go:64] Build error: dial tcp connection refused

#### is the github,com  ip, it's trying to connect

Expected results:

A successfull build. 

Additional info:
Comment 1 Cesar Wong 2015-09-11 08:55:05 EDT
Ben, you likely addressed this already with your PR
Comment 3 Ben Parees 2015-09-11 11:10:38 EDT
yup, this was fixed by https://github.com/openshift/origin/pull/4548
Comment 4 Wenjing Zheng 2015-09-14 00:58:08 EDT
Verified with below version:
openshift v3.0.2.0
kubernetes v1.1.0-alpha.0-1605-g44c91b1
Comment 5 Johnny Liu 2015-09-14 03:10:34 EDT
Reproduce this issue on openshift-, verified this bug on openshift-, and PASS.

1. Deploy your app.
oc new-app https://github.com/jianlinliu/docker-build.git

2. Trigger the Docker build, then it should failed.
# oc build-logs docker-build-1
I0914 02:53:36.388092       1 builder.go:35] $BUILD env var is {"kind":"Build","apiVersion":"v1","metadata":{"name":"docker-build-1","namespace":"jialiu","selfLink":"/oapi/v1/namespaces/jialiu/builds/docker-build-1","uid":"50d7ff94-5aad-11e5-994e-525400ac59b9","resourceVersion":"115110","creationTimestamp":"2015-09-14T06:53:33Z","labels":{"app":"docker-build","buildconfig":"docker-build"},"annotations":{"openshift.io/build.number":"1"}},"spec":{"serviceAccount":"builder","source":{"type":"Git","git":{"uri":"https://github.com/jianlinliu/docker-build.git"}},"strategy":{"type":"Docker","dockerStrategy":{"from":{"kind":"DockerImage","name":"library/centos"}}},"output":{"to":{"kind":"DockerImage","name":""},"pushSecret":{"name":"builder-dockercfg-mtd0u"}},"resources":{}},"status":{"phase":"Pending","config":{"kind":"BuildConfig","namespace":"jialiu","name":"docker-build"}}} 
F0914 02:53:38.507510       1 builder.go:47] Build error: dial tcp no route to host

3. Add http(s) proxy for BuildConfig.
# oc edit bc
      httpsProxy: file.rdu.redhat.com:3128
      uri: https://github.com/openshift/simple-openshift-sinatra-sti.git
    type: Git

4. Trigger build again manually. This time it should succeed.
# oc start-build docker-build

# oc build-logs docker-build-2
# oc build-logs docker-build-2
I0914 02:57:53.827183       1 builder.go:35] $BUILD env var is {"kind":"Build","apiVersion":"v1","metadata":{"name":"docker-build-2","namespace":"jialiu","selfLink":"/oapi/v1/namespaces/jialiu/builds/docker-build-2","uid":"ea14c74a-5aad-11e5-994e-525400ac59b9","resourceVersion":"115162","creationTimestamp":"2015-09-14T06:57:50Z","labels":{"app":"docker-build","buildconfig":"docker-build"},"annotations":{"openshift.io/build.number":"2"}},"spec":{"serviceAccount":"builder","source":{"type":"Git","git":{"uri":"https://github.com/jianlinliu/docker-build.git","httpsProxy":"file.rdu.redhat.com:3128"}},"strategy":{"type":"Docker","dockerStrategy":{"from":{"kind":"DockerImage","name":"library/centos"}}},"output":{"to":{"kind":"DockerImage","name":""},"pushSecret":{"name":"builder-dockercfg-mtd0u"}},"resources":{}},"status":{"phase":"Pending","config":{"kind":"BuildConfig","namespace":"jialiu","name":"docker-build"}}} 
I0914 02:57:53.829116       1 docker.go:165] Setting https proxy variables for Git to file.rdu.redhat.com:3128
I0914 02:57:53.829193       1 docker.go:202] Cloning source from https://github.com/jianlinliu/docker-build.git
I0914 02:57:59.278708       1 docker.go:189] Resetting HTTPS_PROXY variable for Git to 
I0914 02:57:59.278800       1 docker.go:191] Resetting https_proxy variable for Git to 
I0914 02:57:59.289968       1 docker.go:83] Starting Docker build from jialiu/docker-build-2 BuildConfig ...
Image successfully pushed
Buffering to Disk
Pushing [=>                                                 ]      1 B/32 B
Pushing [==================================================>]     32 B/32 B
Pushing [==================================================>]     32 B/32 B
Image successfully pushed
Digest: sha256:3b041dc305e2580560b8cc84cf91d92878634278014f0da0eeda7d22774e4be3
Comment 8 Josep 'Pep' Turro Mauri 2015-10-02 10:22:27 EDT
This was accidentally left open after the 3.0.2 update that includes a fix for it:


closing it manually

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