Bug 1262340 - OpenShift BC does not work with proxies.
Summary: OpenShift BC does not work with proxies.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: Wenjing Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-11 12:52 UTC by Eric Rich
Modified: 2019-08-15 05:23 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-02 14:22:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Eric Rich 2015-09-11 12:52:31 UTC
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": "http://10.17.224.101:8080"


https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/builds_and_image_streams.html#docker-build

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:

https://github.com/openshift/origin/commit/64d33128a817c5957d4c48f3eb8f4a924ec5b787

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 192.30.252.130:443: connection refused

#### 192.30.252.130 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

  source:
    git:
      httpsProxy: http://10.17.224.101:8080    #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 192.30.252.130:443: connection refused

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

Expected results:

A successfull build. 

Additional info:

Comment 1 Cesar Wong 2015-09-11 12:55:05 UTC
Ben, you likely addressed this already with your PR

Comment 3 Ben Parees 2015-09-11 15:10:38 UTC
yup, this was fixed by https://github.com/openshift/origin/pull/4548

Comment 4 Wenjing Zheng 2015-09-14 04:58:08 UTC
Verified with below version:
openshift v3.0.2.0
kubernetes v1.1.0-alpha.0-1605-g44c91b1

Comment 5 Johnny Liu 2015-09-14 07:10:34 UTC
Reproduce this issue on openshift-3.0.1.0-1.git.529.dcab62c.el7ose.x86_64, verified this bug on openshift-3.0.1.900-0.git.185.2f7757a.el7ose.x86_64, 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":"172.30.169.208:5000/jialiu/docker-build:latest"},"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 192.30.252.128:443: no route to host

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


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

# oc build-logs docker-build-2
<--snip-->
# 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":"172.30.169.208:5000/jialiu/docker-build:latest"},"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 ...
<--snip-->
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 14:22:27 UTC
This was accidentally left open after the 3.0.2 update that includes a fix for it:

https://access.redhat.com/errata/RHBA-2015:1835

closing it manually


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