Bug 2003696
| Summary: | Custom 404 503 page failure when import from file | ||||||
|---|---|---|---|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Timothy Rees <trees> | ||||
| Component: | Networking | Assignee: | Miheer Salunke <misalunk> | ||||
| Networking sub component: | router | QA Contact: | jechen <jechen> | ||||
| Status: | CLOSED NOTABUG | Docs Contact: | |||||
| Severity: | high | ||||||
| Priority: | unspecified | CC: | aos-bugs, hongli, jechen, misalunk, mmasters, snalawad, xsoldaat | ||||
| Version: | 4.9 | ||||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2021-09-14 16:23:40 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: | |||||||
| Attachments: |
|
||||||
|
Description
Timothy Rees
2021-09-13 13:02:30 UTC
I am not sure Please ignore my previous comment Putting an http response in inverted quotes is wrong "HTTP/1.0 404 Not Found\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n<html>\r\n<head><title>Not Found</title></head>\r\n<body>\r\n<p>Custom error page:The requested document was not found.</p>\r\n</body>\r\n</html>\r\n" A http repsonse looks like this -> https://raw.githubusercontent.com/openshift/router/master/images/router/haproxy/conf/error-page-503.http ---we ship by default https://raw.githubusercontent.com/Jonathan-Rosewood/haproxy-custom-errors/master/503.http --- a custom one Where is it mentioned to do this ? I don't see this thing mentioned anywhere cat << EOF > error-page-404.http "HTTP/1.0 404 Not Found\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n<html>\r\n<head><title>Not Found</title></head>\r\n<body>\r\n<p>Custom error page:The requested document was not found.</p>\r\n</body>\r\n</html>\r\n" EOF cat << EOF > error-page-503.http "HTTP/1.0 503 Service Unavailable\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n<html>\r\n<head><title>Application Unavailable</title></head>\r\n<body>\r\n<p>Custom error page:The requested application is not available.</p>\r\n</body>\r\n</html>\r\n" EOF Also as per the doc it should not be HttpErrorCodePages but httpErrorCodePages
$ oc patch -n openshift-ingress-operator ingresscontroller/default --patch '{"spec":{"httpErrorCodePages": "my-custom-error-code-pages"}}' --type=merge
The docs team is still working on this doc so it is work in progress.
What should the contents of error-page-404.http and error-page-503.http be for the most fundamental, working example? @misalunk I am not able to reproduce this bug, I tried deleting configmap "my-custom-error-code-pages" from openshift-config namespace first, then I re-created the configmap. I also tried just delete configmap "default-errorpages" from openshift-ingress namespace. In both cases, haproxy router was restarted and health check was ok. Please see attachment "reproduction of bug 2003696" my error page files: [jechen@jechen ~]$ cat ./NE-379-test/error-page-503.http HTTP/1.0 503 Service Unavailable Connection: close Content-Type: text/html <html> <head><title>Custom:Application Unavailable</title></head> <body> <p>Custom error page:The requested application is not available.</p> </body> </html> [jechen@jechen ~]$ cat ./NE-379-test/error-page-404.http HTTP/1.0 404 Not Found Connection: close Content-Type: text/html <html> <head><title>Custom:Not Found</title></head> <body> <p>Custom error page:The requested document was not found.</p> </body> </html> The input in comment 0 is invalid because it uses literal double-quotes and "\r\n" strings. Bug 2003961 covers the documentation side of things (the documentation seems clear to me, but maybe we could be a little more explicit that the user needs to include HTTP response headers). Closing as NOTABUG. |