Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1241045

Summary: oc exec does not work over a proxy
Product: OpenShift Container Platform Reporter: Josep 'Pep' Turro Mauri <pep>
Component: ocAssignee: Andy Goldstein <agoldste>
Status: CLOSED ERRATA QA Contact: Yanping Zhang <yanpzhan>
Severity: medium Docs Contact:
Priority: high    
Version: 3.0.0CC: agoldste, bleanhar, dmcphers, erich, jialiu, jokerman, libra-bugs, libra-onpremise-devel, misalunk, mmccomas, plarsen, pruan, rmartine, sdodson, yanpzhan
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: openshift-3.0.2.0-0.git.16.4d626fe.el7ose Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1275213 (view as bug list) Environment:
Last Closed: 2015-10-01 17:14:08 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:
Bug Depends On:    
Bug Blocks: 1275213    
Attachments:
Description Flags
Windows Test Client
none
MacOSX test client
none
linux test client none

Description Josep 'Pep' Turro Mauri 2015-07-08 10:46:56 UTC
Description of problem:
When executing osc exec, the proxy configured with HTTP_PROXY is ignored. Other commands such as osc logs -f ... are respecting HTTP_PROXY and are working fine.

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

Reported with osc version 0.5.2.2 running on windows 7 to an OSE 3.0 beta 4 installation.

Reproduced with oc v3.0.0.0-25-g235b0e7 on Linux to an OSE 3.0 GA.

How reproducible:
Always

Steps to Reproduce:
1. Have an oc client system without direct connectivity to OSE except via an HTTP proxy:
   export HTTP_PROXY=<proxy_url>
2. Attempt an "oc exec" command

Actual results:
The command "osc exec -p xyz-6-aabv1  -- ls" fails with:

 report: error: Error sending request: Get https://master:8443/api/v1beta3/namespaces/test/pods/xyz-6-aabv1/exec?command=ls&container=xyz&stderr=true&stdout=true: dial tcp X.X.X.X:8443: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

 reproducer: error: Error sending request: Get https://master:8443/api/v1/namespaces/test/pods/xyz-6-aabv1/exec?command=ls&container=xyz&stderr=true&stdout=true: dial tcp X.X.X.X:8443: connection refused

Expected results:
"oc exec" would work over a proxy.

Also, it should work when the proxy requires authentication.

Additional info:
Configuring http_proxy (lowercase) makes no difference.

Comment 1 Ben Parees 2015-07-20 19:16:07 UTC
also tracked in https://github.com/openshift/origin/issues/3370

Comment 2 Andy Goldstein 2015-07-22 14:26:39 UTC
Upstream WIP PR https://github.com/GoogleCloudPlatform/kubernetes/pull/11694

Comment 8 Eric Rich 2015-08-31 18:00:36 UTC
BZ 1242961 and BZ 1253675 seem to be related to this!

Comment 9 Andy Goldstein 2015-08-31 18:05:27 UTC
@Eric 1242961 is not related to this bug.

1253675 maybe is, although I think that is more about how to configure the servers (docker, master, nodes).

Comment 10 Scott Dodson 2015-08-31 19:56:21 UTC
Created attachment 1068741 [details]
Windows Test Client

Test client for windows

Comment 11 Scott Dodson 2015-08-31 19:57:18 UTC
Created attachment 1068742 [details]
MacOSX test client

Comment 12 Scott Dodson 2015-08-31 19:58:15 UTC
Created attachment 1068743 [details]
linux test client

Comment 25 Johnny Liu 2015-09-29 07:13:05 UTC
Verified this bug with openshift-3.0.2.0-0.git.16.4d626fe.el7ose.x86_64, and PASS.


$ export http_proxy=10.14.6.144:3128
$ oc logs simple-openshift-sinatra-sti-1-w06dh
You might consider adding 'puma' into your Gemfile.
[2015-09-29 02:34:29] INFO  WEBrick 1.3.1
[2015-09-29 02:34:29] INFO  ruby 2.0.0 (2015-04-13) [x86_64-linux]
[2015-09-29 02:34:29] INFO  WEBrick::HTTPServer#start: pid=1 port=8080
$ oc exec simple-openshift-sinatra-sti-1-w06dh -- ls
Gemfile
Gemfile.lock
app.rb
bundle
config.ru

Comment 27 errata-xmlrpc 2015-10-01 17:14:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

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