Bug 1414657

Summary: [trello B69d7Q9g] 503 page does not show guide detail when endpoint is down or unready
Product: OpenShift Container Platform Reporter: Xingxing Xia <xxia>
Component: NetworkingAssignee: Phil Cameron <pcameron>
Networking sub component: router QA Contact: zhaozhanqi <zzhao>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, bbennett, eparis, jforrest, jokerman, mmccomas, pcameron, tdawson, xxia, yapei
Version: 3.5.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1442022 (view as bug list) Environment:
Last Closed: 2017-04-12 19:09:52 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:

Description Xingxing Xia 2017-01-19 07:27:26 UTC
Description of problem:
503 page does not show guide detail when endpoint is down or unready

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

How reproducible:
Always

Steps to Reproduce:
1. Create project, create app resources
$ oc new-app openshift/hello-openshift --name hello
$ oc expose service hello

2. Get route
$ oc get route hello # route is got: hello-xxia-proj.1221-bg2.*.com

3. After "hello" app pod is running, use browser to access a none-existent host: http://not-exist-hello-xxia-proj.1221-bg2.*.com

4.
a. Scale down app
$ oc scale dc hello --replicas=0
b. Then use browser to access the route in step 2: http://hello-xxia-proj.1221-bg2.*.com

Actual results:
3. Browser shows desired 503 error detail:
Application is not available
The application is currently not serving requests at this endpoint. It may not have been started or is still starting.
Possible reasons you are seeing this page:
    The host doesn't exist. Make sure the hostname was typed correctly and that a route matching this hostname exists.
    The host exists, but doesn't have a matching path. Check if the URL  path was typed correctly and that the route was created using the  desired path.
    Route and path matches, but all pods are down. Make sure that the  resources exposed by this route (pods, services, deployment configs,  etc) have at least one pod running.

4.
b. Browser shows as same as before this US completes:
503 Service Unavailable
No server is available to handle this request.

Expected results:
4.
b. It should show 503 error detail as in step 3

Comment 1 Fabiano Franz 2017-01-19 19:23:35 UTC
Moving to the Networking team to check the feasibility. 

Is it possible to serve the same file (images/router/haproxy/conf/error-page-503.http) in the case described in step 4 here?

Comment 2 Ben Bennett 2017-01-25 19:30:00 UTC
The bug is that when you scale down pods the error message shown is different from when you hit path that doesn't correspond to a route... they should be the same.

Comment 3 Yadan Pei 2017-02-03 05:58:28 UTC
Hi Phil,

Is fix started or already going? This bug currently blocks us from accepting us [trello B69d7Q9g]

Comment 4 Phil Cameron 2017-02-03 13:36:23 UTC
yapei Fix is started. I'll post updates as things change.

Comment 5 Phil Cameron 2017-02-06 21:41:05 UTC
origin PR 12840

Comment 6 openshift-github-bot 2017-02-09 10:13:38 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/c9dfc66c40d495498539c2c173463f487e998785
503 page does not show guide detail as expected.

503 page does not show guide detail when endpoint is down or unready

bug: 1414657
https://bugzilla.redhat.com/show_bug.cgi?id=1414657

Comment 7 Troy Dawson 2017-02-10 22:54:42 UTC
This has been merged into ocp and is in OCP v3.5.0.19 or newer.

Comment 9 Xingxing Xia 2017-02-13 08:46:16 UTC
$ cd /path/to/ose_repo
$ git pull
$ git log --pretty="%h %cd - %s" --date=local v3.5.0.19 | grep 12840
752c409 Thu Feb 9 18:13:33 2017 - Merge pull request #12840 from pecameron/bz1414657

It is seen v3.5.0.19 already includes the fix PR.
But after test against openshift v3.5.0.19, the bug is still reproduced. Step 4 in comment 0 still returns:
503 Service Unavailable
No server is available to handle this request

Comment 10 Phil Cameron 2017-02-13 18:24:57 UTC
xxia
I am missing something here.

I have built origin/master and rebuilt the router image and pushed it to the cluster repository.
I set up a router, rrr which references the pushed image. The router ended up on 10.254.254.28 

I have set up a "hello openshift!" app and exposed the service at host "hello-openshift-v3.not.in5.mycloud.com". The rrr router has admitted the route.

curl -H "host: hello-openshift-v3.not.in5.mycloud.com" 10.254.254.28Hello OpenShift!

I scale the app to 0
oc scale rc/hello-rc --replicas=0
curl -H "host: hello-openshift-v3.not.in5.mycloud.com" 10.254.254.28Hello
.
.
.
      <h1>Application is not available</h1>
      <p>The application is currently not serving requests at this endpoint. It may not have been started or is still starting.</p>
.
.
.

oc scale rc/hello-rc --replicas=1
While waiting for pod to start 
curl -H "host: hello-openshift-v3.not.in5.mycloud.com" 10.254.254.28
returns:
      <h1>Application is not available</h1>
messages. When pod finally starts.
curl -H "host: hello-openshift-v3.not.in5.mycloud.com" 10.254.254.28
Hello OpenShift!

If I curl to a host name that is not exposed in a route:
curl -H "host: hello-openshift-v3.not.in555555.mycloud.com" 10.254.254.28
returns:
      <h1>Application is not available</h1>
messages.

What is unexpected here?

Comment 11 Xingxing Xia 2017-02-14 04:49:07 UTC
(In reply to Phil Cameron from comment #10)
> xxia
> I am missing something here.
> 
> I have built origin/master and rebuilt the router image and pushed it to the
> cluster repository.
Not aware that it requires rebuilt router image to verify the bug. Tested upon today's env of OCP v3.5.0.20, the bug is fixed. Now step 4 in comment 0 also returns same message detail as step 3

Moving to VERIFIED (skipping middle ON_QA)
Thanks!

Comment 13 errata-xmlrpc 2017-04-12 19:09:52 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-2017:0884