Bug 813061 - DIY Application content is being overridden for 4xx status codes
DIY Application content is being overridden for 4xx status codes
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Mrunal Patel
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-16 14:56 EDT by Ram Ranganathan
Modified: 2015-05-14 18:53 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-08 13:58:38 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)
status 400 python sample (1.04 KB, text/x-python-script)
2012-04-16 14:57 EDT, Ram Ranganathan
no flags Details

  None (edit)
Description Ram Ranganathan 2012-04-16 14:56:11 EDT
Description of problem:
For a DIY custom application, if the application server returns a 4xx status code, then the content returned back from the application server is getting overridden. 

Version-Release number of selected component (if applicable):
diy-0.1 on production

How reproducible:
Always.

Steps to Reproduce:
1. Create a diy application  rhc app create -a diy1 -t diy-0.1 .
2. Add the attached python script to your git repo [say to diy1/diy directory] 
    and start it on deployment (either modify the .openshift/action_hooks or
    you can ssh into the instance and run the python script).
3. git commit  &&  git push
4. ssh $(rhc app show -a diy1 | grep "Git URL" | cut -f 3 -d ':' | cut -f 3 -d '/')
5. cd $OPENSHIFT_REPO_DIR/diy/  &&  python status400.py

From your client run: 
curl  -vvv  $(rhc app show -a diy1 | grep "Public URL" | cut -f 2- -d ':')
  
Actual results:
The 400 http status code is returned back but the content is overlaid by apache's default error page.

Expected results:
The 400 http status code and page content is returned back to the caller.

Additional info:
Comment 1 Ram Ranganathan 2012-04-16 14:57:19 EDT
Created attachment 577805 [details]
status 400 python sample
Comment 2 Ram Ranganathan 2012-04-16 15:00:08 EDT
The ProxyErrorOverride On directive is causing the errors to get overriden.

Bug created for forum post: https://www.redhat.com/openshift/community/forums/openshift/apache-captures-bad-requests-with-do-it-yourself-modules
Comment 3 Mike McGrath 2012-05-15 14:52:35 EDT
Lets pull this one in to this sprint.

Ram can you confirm this fix (and fix it in devenv) then work with Thomas to get it updated in int/stg/prod?
Comment 4 Mike McGrath 2012-05-15 15:11:23 EDT
oh sorry, this one's assigned to Mrunal.  So Mrunal, can you do this this sprint?  If not let me know.
Comment 5 Mrunal Patel 2012-05-30 19:28:22 EDT
Submitted pull request - https://github.com/openshift/crankcase/pull/94
Comment 6 yquan 2012-05-31 05:08:06 EDT
The new patch have not integrated to devenv_1809,So just keep on this status,I will test again when the new build come out.
Comment 7 yquan 2012-05-31 06:55:53 EDT
I tested it on devenv_1810:

step:

1.create an diy app
2.git push the status400.py to the app repo
3.stop this app #because some other progress occupied the 8080 port.
4.ssh on the app ,
5.run the script 


The curl output:


[root@localhost ~]# curl  -vvv http://diy0-domaintest0002.dev.rhcloud.com/
* About to connect() to diy0-domaintest0002.dev.rhcloud.com port 80 (#0)
*   Trying 23.22.151.234... connected
* Connected to diy0-domaintest0002.dev.rhcloud.com (23.22.151.234) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.7 (i386-redhat-linux-gnu) libcurl/7.21.7 NSS/3.13.3.0 zlib/1.2.5 libidn/1.22 libssh2/1.2.7
> Host: diy0-domaintest0002.dev.rhcloud.com
> Accept: */*
> 
< HTTP/1.1 400 Bad Request
< Date: Thu, 31 May 2012 10:55:15 GMT
< Server: BaseHTTP/0.3 Python/2.6.6
< Content-type: text/html; charset=UTF-8
< Vary: Accept-Encoding,User-Agent
< Strict-Transport-Security: max-age=15768000, includeSubDomains
< ProxyTime: D=6485
< Connection: close
< Transfer-Encoding: chunked
< 
<html>
<head><title>void *status400;</title></head>
<body><br/><h3>Custom 400 status code page</h3></body>
</html>
* Closing connection #0

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