Coder Social home page Coder Social logo

Comments (10)

grisha avatar grisha commented on August 19, 2024

Could you paste the relevant part of your Apache config?

from mod_python.

huskier avatar huskier commented on August 19, 2024

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.
#################################################
// Roundup Issue tracker
###############begin###########################
//enable Python optimizations (like 'python -O')
PythonOptimize On
//let apache handle static files from 'html' directories
AliasMatch /roundup/(.+)/@@file/(.) /var/www/html/roundup/$1/html/$2
//everything else is handled by roundup web UI
AliasMatch /roundup/([^/]+)/(?!@@file/)(.
) /var/www/html/roundup/$1/dummy.py/$2
//roundup requires a slash after tracker name - add it if missing
//RedirectMatch permanent ^/roundup/([^/]+)$ /roundup/$1/

//common settings for all roundup trackers
<Directory /var/www/html/roundup/issues>
Order allow,deny
Allow from all
AllowOverride None
Options None
AddHandler python-program .py
PythonHandler roundup.cgi.apache
//uncomment the following line to see tracebacks in the browser
//(note that some tracebacks will be displayed anyway)
PythonDebug On

//roundup tracker homes
<Directory /var/www/html/roundup/issues>
PythonOption TrackerHome /var/www/html/roundup/issues

###############end###########################

The tree command displays the roundup directory structure.
roundup/
└── issues
├── config.ini
├── config.ini~
├── db
│   ├── backend_name
...........................

Thanks for your help.

from mod_python.

grisha avatar grisha commented on August 19, 2024

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:

req.add_cgi_vars()

from mod_python.

huskier avatar huskier commented on August 19, 2024

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"
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 367, in main
self.inner_main()
File "/usr/lib/python2.6/site-packages/roundup/cgi/client.py", line 567, in inner_main
self.write_html(html)
File "/usr/lib/python2.6/site-packages/roundup/cgi/client.py", line 1274, in write_html
if self.env['REQUEST_METHOD'] == 'HEAD':
KeyError: 'REQUEST_METHOD'

from mod_python.

grisha avatar grisha commented on August 19, 2024

Are you sure you simply didn't forget to make the same change when you upgraded to 1.5.0?

from mod_python.

huskier avatar huskier commented on August 19, 2024

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.

from mod_python.

grisha avatar grisha commented on August 19, 2024

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 self.env['REQUEST_METHOD'] == 'HEAD' line :

if 'REQUEST_METHOD' not in self.env:
    raise Exception(self.env)

The content of env should appear in the error traceback then.

from mod_python.

grisha avatar grisha commented on August 19, 2024

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.

from mod_python.

huskier avatar huskier commented on August 19, 2024

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.
LD_PRELOAD=/lib/libpthread.so.0
export LD_PRELOAD

Frustrating!

I will let you know if I get around the problem. Thanks!

from mod_python.

grisha avatar grisha commented on August 19, 2024

I'm closing this issue since we don't know what the problem is - feel free to re-open if you figure it out.

from mod_python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.