Bug 1271955 - [platformmanagement_public_522] Got "bad request" when access frontend service and pod via api proxy for sample-app template
[platformmanagement_public_522] Got "bad request" when access frontend servic...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Cesar Wong
Jianwei Hou
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-15 03:23 EDT by weiwei jiang
Modified: 2016-10-30 18:54 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-23 16:17:31 EST
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 weiwei jiang 2015-10-15 03:23:32 EDT
Description of problem:
Create a template app via examples/sample-app/application-template-stibuild.json, and then got "bad request" when access the services and pod via api proxy with cluster-admin permission. 
# curl -k https://127.0.0.1:8443/api/v1/proxy/namespaces/wjiang/services/http:frontend:web/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
  <head><title>Bad Request</TITLE></HEAD>
  <body>
    <h1>Bad Request</H1>
    bad URI `/'.
    <hr>
    <address>
     WEBrick/1.3.1 (Ruby/2.0.0/2013-11-22) at
     frontend-1-8ee3j:8080
    </ADDRESS>
  </BODY>
</HTML>

# curl -k https://127.0.0.1:8443/api/v1/proxy/namespaces/wjiang/pods/http:frontend-1-8ee3j:8080/                                             
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
  <head><title>Bad Request</TITLE></HEAD>
  <body>
    <h1>Bad Request</H1>
    bad URI `/'.
    <hr>
    <address>
     WEBrick/1.3.1 (Ruby/2.0.0/2013-11-22) at
     frontend-1-8ee3j:8080
    </ADDRESS>
  </BODY>
</HTML>


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

How reproducible:
always

Steps to Reproduce:
1. Create a template app via examples/sample-app/application-template-stibuild.json
2. Access the services and pod via api proxy with cluster-admin permission
3.

Actual results:
As description.

Expected results:
Should work without error message.

Additional info:
Comment 1 Jordan Liggitt 2015-10-15 08:17:17 EDT
Is the root URL valid for that app? Ben/Cesar, any idea why the app doesn't think '/' is valid?
Comment 2 Cesar Wong 2015-10-15 10:04:21 EDT
If I hit the pod directly with an address like curl http://<pod-ip>:8080/ or http://<pod-ip>:8080 I get the expected web page result. Not sure what the proxy is doing to cause the 400. Digging into it a little bit more.
Comment 3 Jordan Liggitt 2015-10-15 13:04:48 EDT
It sets a "X-Forwarded-Uri" header... though that doesn't seem to match the error about '/' being invalid
Comment 4 Ben Parees 2015-10-19 11:39:31 EDT
is this the only image/application for which this happens?
Comment 5 Cesar Wong 2015-10-19 20:22:01 EDT
It's going to happen to any image running the Ruby 2.0 WEBrick server.
Comment 6 Cesar Wong 2015-10-21 09:32:38 EDT
PR https://github.com/kubernetes/kubernetes/pull/15784
Comment 7 Cesar Wong 2015-10-23 08:44:17 EDT
Origin PR: https://github.com/openshift/origin/pull/5278
Comment 8 weiwei jiang 2015-10-25 22:36:01 EDT
Checked with devenv-rhel7_2556, and the bug has been fixed.

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