Bug 1283952 - Default haproxy 503 response lack HTTP response header
Summary: Default haproxy 503 response lack HTTP response header
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: Ram Ranganathan
QA Contact: zhaozhanqi
URL:
Whiteboard:
: 1296008 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-20 11:29 UTC by Marek Schmidt
Modified: 2022-08-04 22:20 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ose-haproxy-router:v3.1.0.4
Last Closed: 2016-01-26 19:19:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0070 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 3.1.1 bug fix and enhancement update 2016-01-27 00:12:41 UTC

Description Marek Schmidt 2015-11-20 11:29:30 UTC
Description of problem:

The default HAProxy "503" response lack response headers, and is thus an invalid HTTP response.

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


How reproducible:


Steps to Reproduce:

curl -v 127.0.0.1:80  on an openshift master with a router

Actual results:

* About to connect() to 127.0.0.1 port 80 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1
> Accept: */*
> 
<html><body><h1>503 Service Unavailable</h1>
No server available to handle the request.
</body></html>
* Connection #0 to host 127.0.0.1 left intact


Expected results:

I'd expect something like the following lines to also appear:

HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Connection: close
Content-Type: text/html

Additional info:

I guess the HAProxy expect that response headers are part of the custom HTTP 503 page... https://github.com/openshift/ose/blob/master/images/router/haproxy/conf/error-page-503.html

Comment 1 Tomas Schlosser 2015-11-20 11:42:28 UTC
Just for the record, same command on OSE 3.0.2 gives following answer:
* About to connect() to 127.0.0.1 port 80 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 503 Service Unavailable
< Cache-Control: no-cache
< Connection: close
< Content-Type: text/html
< 
<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>
* Closing connection 0

Comment 2 Marek Schmidt 2015-11-20 11:50:32 UTC
See also https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-errorfile

"<file>   designates a file containing the full HTTP response. It is
          recommended to follow the common practice of appending ".http" to
          the filename so that people do not confuse the response with HTML
          error pages"

Comment 3 Ram Ranganathan 2015-12-05 00:26:42 UTC
Fixed via PR: https://github.com/openshift/origin/pull/6204

Comment 4 zhaozhanqi 2015-12-10 02:16:12 UTC
Rebuild haporxy image on the latest origin repo
# docker images |grep openshift/origin-haproxy-router
openshift/origin-haproxy-router             latest              2229e31bc36e        31 minutes ago      366.1 MB

1. create router whith above image
2. Check the result:

 curl -v 127.0.0.1:80
* Rebuilt URL to: 127.0.0.1:80/
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.37.0
> Host: 127.0.0.1
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 503 Service Unavailable
< Pragma: no-cache
< Cache-Control: private, max-age=0, no-cache, no-store
< Connection: close
< Content-Type: text/html
< 
<html>
  <body>
    <h1>503 Service Unavailable</h1>
    No server available to handle the request.
  </body>
</html>

this bug has been fixed on origin, will verified this bug once it's merged to ose. thanks

Comment 5 zhaozhanqi 2015-12-11 02:44:17 UTC
verified this bug with router image on ose

registry.access.redhat.com/openshift3/ose-haproxy-router                                        v3.1.0.4            81c50204da05        4 weeks ago         410.2 MB


# curl -v 127.0.0.1:80
* About to connect() to 127.0.0.1 port 80 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 503 Service Unavailable
< Cache-Control: no-cache
< Connection: close
< Content-Type: text/html
< 
<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>

Comment 6 zhaozhanqi 2015-12-14 04:09:22 UTC
Reback this bug to ON_QA,  Above maybe using a wrong env. I re test this on a new ose env, found it has not merged the PR (https://github.com/openshift/origin/pull/6204).

Comment 7 zhaozhanqi 2015-12-15 06:29:20 UTC
hi, Ram

Could you help check the this?
Found the PR https://github.com/openshift/origin/pull/6204 has not been merged to the latest router image on OSE env

# docker images |grep router
registry.access.redhat.com/openshift3/ose-haproxy-router                                         v3.1.0.4            6a3fe65c07f1        3 days ago          410.5 MB

# oc rsh router-1-75zbr
[root@openshift-113 conf]# ll
total 68
-rwxrwxrwx. 1 root root  2042 Dec 11 13:19 default_pub_keys.pem
-rwxrwxrwx. 1 root root   103 Dec 11 13:48 error-page-503.html
-rwxrwxrwx. 1 root root 16766 Dec 11 13:48 haproxy-config.template
-rwxrwxrwx. 1 root root  9579 Dec 15 01:21 haproxy.config
-rwxrwxrwx. 1 root root    52 Dec 15 01:21 os_edge_http_be.map
-rw-r--r--. 1 root root    18 Dec 15 01:21 os_edge_http_expose.map
-rw-r--r--. 1 root root    18 Dec 15 01:21 os_edge_http_redirect.map
-rwxrwxrwx. 1 root root    18 Dec 15 01:21 os_http_be.map
-rwxrwxrwx. 1 root root    18 Dec 15 01:21 os_reencrypt.map
-rwxrwxrwx. 1 root root    18 Dec 15 01:21 os_sni_passthrough.map
-rwxrwxrwx. 1 root root    18 Dec 15 01:21 os_tcp_be.map

Comment 8 Ram Ranganathan 2015-12-15 20:20:38 UTC
Am not sure how the OSE build picks up changes -- CCing Troy. 
Troy, can you please help. Thanks in advance.

Comment 12 zhaozhanqi 2015-12-17 02:10:33 UTC
Thanks for your details reference. it makes things clear.

Comment 13 zhaozhanqi 2015-12-22 07:47:43 UTC
verified this bug with haproxy router image:

rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ose-haproxy-router                     v3.1.1.0            fac972949d0e        2 days ago          412.7 MB

$ curl -v 127.0.0.1:80
* About to connect() to 127.0.0.1 port 80 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 503 Service Unavailable
< Pragma: no-cache
< Cache-Control: private, max-age=0, no-cache, no-store
< Connection: close
< Content-Type: text/html
< 
<html>
  <body>
    <h1>503 Service Unavailable</h1>
    No server available to handle the request.
  </body>
</html>

Comment 14 Ram Ranganathan 2016-01-07 22:41:37 UTC
*** Bug 1296008 has been marked as a duplicate of this bug. ***

Comment 16 errata-xmlrpc 2016-01-26 19:19:11 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/RHSA-2016:0070


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