-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mod_python error: "PythonHandler roundup.cgi.apache" #13
Comments
Could you paste the relevant part of your Apache config? |
The Apache config for roundup part is as following, and I copy the code from the roundup website, and change the directory according to my system. I use "//" instead of "#" for comments, otherwise, the format is weried. //common settings for all roundup trackers The tree command displays the roundup directory structure. Thanks for your help. |
I would say this is a bug in roundup, line 122 in this http://sourceforge.net/p/roundup/code/ci/default/tree/roundup/cgi/apache.py should be:
|
Thanks grisha. This only partially solved the problem. After I changed the line reg.add_common_vars() to req.add_cgi_vars(), I can access the website http://119.78.238.228/roundup/issues/. However, the same error occured again after I clicked the links at random on the site http://119.78.238.228/roundup/issues/. Then, I restart httpd service again. The website is normal again for only a short time. again and again... I changed the roundup 1.4.20 to 1.5.0, but the problem is still there. Your solution cures the problem for a short while. very weried! The error is a little different from the previous one. Here it is. Mod_python error: "PythonHandler roundup.cgi.apache" |
Are you sure you simply didn't forget to make the same change when you upgraded to 1.5.0? |
Absolutely sure. Since the solution is not perfectly solve the problem in 1.4.20, I update the roundup to 1.5.0. If I don't make the change, the roundup application just would not work. After the updating, I modified the file /usr/lib/python2.6/site-packages/roundup/cgi/apache.py line 122 to req.add_cgi_vars(). The roundup app works, but only for a short time. I mean, the same error occurs again after I click some links randomly on the issues tracker website. Then, I have to restart httpd service. Then, I can access the issues tracker site again... Strange. |
I don't have any ideas... It appears that self.env is getting modified somehow... It'd be interesting to try to see what is in self.env just before this happens. You could do this by inserting something like just before the if if 'REQUEST_METHOD' not in self.env:
raise Exception(self.env) The content of env should appear in the error traceback then. |
Okay, I went ahead and installed a little test roundup set up, version 1.5, and it seems to work just find for me (with the req.add_cgi_vars() change), both mod_python 3.4.1 and 3.5.x branch (Python 2.7.5). I've clicked and reloaded pages and I do not get any errors. Another theory I have is that you may have some kind of a python path confusion whereby an older version of roundup apache.py gets loaded, which doesn't have the req.add_cgi_vars(). Your Python is 2.6, but I don't think that should make any difference. |
I tried many times, the problem is still there. Maybe I need to update my Python to 2.7.5 manually, and meantime enable apache with thread support. Frustrating! I will let you know if I get around the problem. Thanks! |
I'm closing this issue since we don't know what the problem is - feel free to re-open if you figure it out. |
Now mptest works fine, but when I use mod_python to configure roundup bug tracker, I've got the following error in browers [I tried Chrome, Firefox, and IE]:
Mod_python error: "PythonHandler roundup.cgi.apache"
Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/mod_python/apache.py", line 398, in HandlerDispatch
result = obj(req)
File "/usr/lib/python2.6/site-packages/roundup/cgi/apache.py", line 135, in handler
_client.main()
File "/usr/lib/python2.6/site-packages/roundup/cgi/client.py", line 362, in main
self.inner_main()
File "/usr/lib/python2.6/site-packages/roundup/cgi/client.py", line 550, in inner_main
self.write_html(html)
File "/usr/lib/python2.6/site-packages/roundup/cgi/client.py", line 1211, in write_html
if self.env['REQUEST_METHOD'] == 'HEAD':
KeyError: 'REQUEST_METHOD'
I've also tried to google the internet, but nothing useful available for this kind of error.
The apache error log gives:
[Tue Nov 05 10:24:37 2013] [notice] mod_python: (Re)importing module 'roundup.cgi.apache'
[Tue Nov 05 02:24:38 2013] [error] [client 119.78.238.228] PythonHandler roundup.cgi.apache: Traceback (most recent call last):, referer: http://119.78.238.228/roundup/
[Tue Nov 05 02:24:38 2013] [error] [client 119.78.238.228] PythonHandler roundup.cgi.apache: File "/usr/lib64/python2.6/site-packages/mod_python/apache.py", line 398, in HandlerDispatch\n result = obj(req), referer: http://119.78.238.228/roundup/
[Tue Nov 05 02:24:38 2013] [error] [client 119.78.238.228] PythonHandler roundup.cgi.apache: File "/usr/lib/python2.6/site-packages/roundup/cgi/apache.py", line 135, in handler\n _client.main(), referer: http://119.78.238.228/roundup/
[Tue Nov 05 02:24:38 2013] [error] [client 119.78.238.228] PythonHandler roundup.cgi.apache: File "/usr/lib/python2.6/site-packages/roundup/cgi/client.py", line 362, in main\n self.inner_main(), referer: http://119.78.238.228/roundup/
[Tue Nov 05 02:24:38 2013] [error] [client 119.78.238.228] PythonHandler roundup.cgi.apache: File "/usr/lib/python2.6/site-packages/roundup/cgi/client.py", line 550, in inner_main\n self.write_html(html), referer: http://119.78.238.228/roundup/
[Tue Nov 05 02:24:38 2013] [error] [client 119.78.238.228] PythonHandler roundup.cgi.apache: File "/usr/lib/python2.6/site-packages/roundup/cgi/client.py", line 1211, in write_html\n if self.env['REQUEST_METHOD'] == 'HEAD':, referer: http://119.78.238.228/roundup/
[Tue Nov 05 02:24:38 2013] [error] [client 119.78.238.228] PythonHandler roundup.cgi.apache: KeyError: 'REQUEST_METHOD', referer: http://119.78.238.228/roundup/
Thanks!
The text was updated successfully, but these errors were encountered: