Bug 1248802 - oc port-forward not working in the EC2
oc port-forward not working in the EC2
Status: CLOSED WORKSFORME
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.0.0
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Andy Goldstein
Yanping Zhang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-30 17:05 EDT by Brenton Leanhardt
Modified: 2015-09-22 13:19 EDT (History)
7 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Brenton Leanhardt 2015-07-30 17:05:42 EDT
Description of problem:

Erik Jacobs reported that the lastest oc client in OSE was not working.

Here's the output:

[root@ose3-master origin]# oc port-forward -p eap-app-2-eobeb 32767:9999 --loglevel=7 -n eaptest
I0730 17:03:11.344711   82184 request.go:694] GET https://master.test.openshift3roadshow.com:8443/api/v1/namespaces/eaptest/pods/eap-app-2-eobeb
I0730 17:03:11.345667   82184 transport.go:43] -H 'User-Agent: oc/v0.17.1 (linux/amd64) kubernetes/496be63'
I0730 17:03:11.441120   82184 request.go:719] Response Status: 200 OK
I0730 17:03:11.441179   82184 request.go:722] Response Header: Cache-Control: no-store
I0730 17:03:11.441195   82184 request.go:722] Response Header: Content-Type: application/json
I0730 17:03:11.441209   82184 request.go:722] Response Header: Date: Thu, 30 Jul 2015 21:03:21 GMT
I0730 17:03:11.441316   82184 request.go:726] Response Body: {"kind":"Pod","apiVersion":"v1","metadata":{"name":"eap-app-2-eobeb","generateName":"eap-app-2-","namespace":"eaptest","selfLink":"/api/v1/namespaces/eaptest/pods/eap-app-2-eobeb","uid":"678c0741-36ea-11e5-8992-0a8636c3fd6f","resourceVersion":"179052","creationTimestamp":"2015-07-30T18:40:09Z","labels":{"application":"eap-app","deployment":"eap-app-2","deploymentConfig":"eap-app","deploymentconfig":"eap-app"},"annotations":{"kubernetes.io/created-by":"{\"kind\":\"SerializedReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"ReplicationController\",\"namespace\":\"eaptest\",\"name\":\"eap-app-2\",\"uid\":\"60a5a97a-36ea-11e5-8992-0a8636c3fd6f\",\"apiVersion\":\"v1\",\"resourceVersion\":\"179026\"}}","openshift.io/deployment-config.latest-version":"2","openshift.io/deployment-config.name":"eap-app","openshift.io/deployment.name":"eap-app-2","openshift.io/scc":"restricted"}},"spec":{"volumes":[{"name":"default-token-zw1fb","secret":{"secretName":"default-token-zw1fb"}}],"containers":[{"name":"eap-app","image":"172.30.43.239:5000/eaptest/eap-app@sha256:edc23d424a6211bcc32b3f5e0e329e2691b661d9031fce3b338307c025722d92","ports":[{"name":"eap-app-tcp-8080","containerPort":8080,"protocol":"TCP"},{"name":"eap-app-ping-8888","containerPort":8888,"protocol":"TCP"},{"name":"eap-mvn-tcp-9999","containerPort":9999,"protocol":"TCP"}],"env":[{"name":"OPENSHIFT_DNS_PING_SERVICE_NAME","value":"eap-app-ping"},{"name":"OPENSHIFT_DNS_PING_SERVICE_PORT","value":"8888"},{"name":"HORNETQ_CLUSTER_PASSWORD","value":"nhaThgNt"},{"name":"HORNETQ_QUEUES"},{"name":"HORNETQ_TOPICS"}],"resources":{},"volumeMounts":[{"name":"default-token-zw1fb","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"readinessProbe":{"exec":{"command":["/bin/bash","-c","/opt/eap/bin/readinessProbe.sh"]},"timeoutSeconds":1},"terminationMessagePath":"/dev/termination-log","imagePullPolicy":"Always","securityContext":{"capabilities":{},"privileged":false,"seLinuxOptions":{"level":"s0:c19,c4"},"runAsUser":1000350000}}],"restartPolicy":"Always","dnsPolicy":"ClusterFirst","nodeSelector":{"region":"primary"},"serviceAccount":"default","host":"ip-172-31-31-54.ec2.internal","imagePullSecrets":[{"name":"default-dockercfg-hqdgr"}]},"status":{"phase":"Running","conditions":[{"type":"Ready","status":"True"}],"hostIP":"172.31.31.54","podIP":"10.1.1.77","startTime":"2015-07-30T18:40:16Z","containerStatuses":[{"name":"eap-app","state":{"running":{"startedAt":"2015-07-30T18:40:16Z"}},"lastState":{},"ready":true,"restartCount":0,"image":"172.30.43.239:5000/eaptest/eap-app@sha256:edc23d424a6211bcc32b3f5e0e329e2691b661d9031fce3b338307c025722d92","imageID":"docker://db02c01ee8210d85e3a9d46c1a6201a2d0418452c9e062719d6a722ef2b38b17","containerID":"docker://1450c7b4cebf8ee1b08e9654b12ed3ac690702bbeabb0af3cdade0a130a67e39"}]}}
I0730 17:03:11.766736   82184 transport.go:43] -H 'User-Agent: oc/v0.17.1 (linux/amd64) kubernetes/496be63'
I0730 17:03:11.963174   82184 portforward.go:225] Forwarding from 127.0.0.1:32767 -> 9999
I0730 17:03:11.963343   82184 portforward.go:225] Forwarding from [::1]:32767 -> 9999


If you then ran 'curl localhost:32767' you see:

I0730 17:04:04.122933   82184 portforward.go:251] Handling connection for 32767

It appears to hang forever.

I compiled the latest 'oc' from upstream and it couldn't even establish the port-forwarding:

^C[root@ose3-master origin]./_output/local/go/bin/# oc port-forward -p eap-app-2-eobeb 32767:9999 --loglevel=7 -n eaptest
I0730 17:05:05.017366   82197 debugging.go:98] GET https://master.test.openshift3roadshow.com:8443/api
I0730 17:05:05.017649   82197 debugging.go:105] Request Headers:
I0730 17:05:05.017662   82197 debugging.go:108]     User-Agent: oc/v1.0.0 (linux/amd64) kubernetes/cd82144
I0730 17:05:05.200293   82197 debugging.go:123] Response Status: 200 OK in 182 milliseconds
I0730 17:05:05.498708   82197 debugging.go:98] GET https://master.test.openshift3roadshow.com:8443/api/v1/namespaces/eaptest/pods/eap-app-2-eobeb
I0730 17:05:05.498774   82197 debugging.go:105] Request Headers:
I0730 17:05:05.498787   82197 debugging.go:108]     User-Agent: oc/v1.0.0 (linux/amd64) kubernetes/cd82144
I0730 17:05:05.585468   82197 debugging.go:123] Response Status: 200 OK in 86 milliseconds
F0730 17:05:05.974755   82197 helpers.go:72] error: Error upgrading connection: the server does not allow this method on the requested resource
Comment 3 Yanping Zhang 2015-07-30 23:09:03 EDT
Check port-forward on both ose and origin, it works.
Below are results from latest ose env:
# oc version
oc v3.0.1.0-525-geddc479
kubernetes v1.0.0

$ oc port-forward -p hello-openshift 32767:8080 --loglevel=7 -n prozyp
I0731 11:07:11.877837    1089 debugging.go:98] GET https://openshift-143.lab.eng.nay.redhat.com:8443/api
I0731 11:07:11.877900    1089 debugging.go:105] Request Headers:
I0731 11:07:11.877913    1089 debugging.go:108]     User-Agent: oc/v1.0.0 (linux/amd64) kubernetes/cd82144
I0731 11:07:11.877924    1089 debugging.go:108]     Authorization: Bearer tLCtEJ4R_cK8SEPjTMBc46o9waTknWHsJwvnjsnvgPI
I0731 11:07:11.906980    1089 debugging.go:123] Response Status: 200 OK in 29 milliseconds
I0731 11:07:11.907474    1089 debugging.go:98] GET https://openshift-143.lab.eng.nay.redhat.com:8443/api/v1/namespaces/prozyp/pods/hello-openshift
I0731 11:07:11.907576    1089 debugging.go:105] Request Headers:
I0731 11:07:11.907687    1089 debugging.go:108]     User-Agent: oc/v1.0.0 (linux/amd64) kubernetes/cd82144
I0731 11:07:11.907762    1089 debugging.go:108]     Authorization: Bearer tLCtEJ4R_cK8SEPjTMBc46o9waTknWHsJwvnjsnvgPI
I0731 11:07:11.939408    1089 debugging.go:123] Response Status: 200 OK in 31 milliseconds
I0731 11:07:12.011743    1089 portforward.go:225] Forwarding from 127.0.0.1:32767 -> 8080
I0731 11:07:12.011927    1089 portforward.go:225] Forwarding from [::1]:32767 -> 8080
I0731 11:07:18.277093    1089 portforward.go:251] Handling connection for 32767


On another terminal:
$ curl 127.0.0.1:32767
Hello OpenShift!
Comment 4 Erik M Jacobs 2015-08-07 06:53:52 EDT
So what is different about the two environments? Why does it work in one place but not work in another place? How can we further troubleshoot?
Comment 5 Andy Goldstein 2015-09-22 13:19:57 EDT
Closing since QE couldn't reproduce. Please reopen if necessary.

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