Internal Server error while using Python OpenId with Google Authentication - python

I have installed askbot.org on my local machine and When I tri to use google openid, I get following error. Here is full apache log. (I have replaced some hex strings)
http://bit.ly/apache_log
Can someone explain to me what could be problem ?

From your log, this seems to be the big issue:
[Wed Mar 07 22:58:13 2012] [error] Received "invalidate_handle" from server
From the answer to this question on invalidate_handle, it looks like a bug in the "Relying Party". I would double-check your configuration.

Related

OpenCV on Flask only works with "flask run" and not under Apache2

I want to use Open CV on a Flask Server but when I import cv2 and load up the page on my browser, it get the Error ERR_EMPTY_RESPONSE.
I get no import erros or other exceptions from Flask itself, only this notice from my Apache2 logfile.
[Sun Jan 03 14:07:44.895826 2021] [core:notice] [pid 20595] AH00052: child pid 20600 exit signal Aborted (6)
I have tried running it with flask run --host('0.0.0.0') and everything worked fine and Cv2 routes worked completly fine.
I don't know what's the cause of this problem, because Open Cv works fine in every other python app and other Flask installations and only doesn't in this specific instance!
EDIT: It seems as if it had do with something in my old Virtual Enviroment, I created a new one and everything is working fine now.
Not really great to do it this way, but what worked was to put the flask app into a new and fresh virtual enviroment and tell apache to use it when executing the .wsgi file.

python flask mod_wsgi application crashing on apache with high memory usage

I have an apache webserver which I have setup a website using python based flask using mod_wsgi.
I'm having a problem with my application crashing. The python script reads in a lot of data, and on this particular machine, needs to swap (only has 4GB RAM) a bit in order to process the data it reads in before it can get to a point where the data is optimized and the code will use less memory (during this processing, memory usage peaks at about 7GB, but I have an 8GB swap file and 4GB RAM), which takes several minutes upon first load. The application crashes when run through apache and I am not getting much information as far as debugging what apache is doing and why. Here is all that is coming up in error.log
[Thu Feb 06 06:58:33 2014] [info] mod_wsgi (pid=29315): Starting process 'website' with uid=33, gid=33 and threads=1.
[Thu Feb 06 06:58:33 2014] [info] mod_wsgi (pid=29315): Initializing Python.
[Thu Feb 06 07:15:40 2014] [error] [client MASKED] Premature end of script headers: website.wsgi, referer: http://MASKED/
[Thu Feb 06 07:15:40 2014] [info] mod_wsgi (pid=29315): Process 'website' has died, restarting.
I am able to test the application using flask's built in development webserver, and after the code gets done processing the data, it is able to clear up some memory, and have plenty of free RAM to run (about 2.3GB free RAM after the initial processing is done).
I can get the application to run using apache if a much smaller test dataset is used.
I think there may be some timeout or memory limitation in apache that is not configured, but I am not sure what this could be. I have tried setting
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 3001
in apache2.conf file, but this doesn't seem to help.
I have also set processes=1 threads=1 under WSGIDaemonProcess in my /etc/apache2/sites-available/default file just to reduce the amount of memory that is used.

How do I delete mod_python?

I keep getting these errors in my Apache logs:
[error] python_init: Python version mismatch, expected '2.6.5+', found '2.6.6'.
[error] python_init: Python executable found '/usr/bin/python'.
[error] python_init: Python path being used '/usr/lib/python2.6/:/usr/lib/python2.6/plat-linux2:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/lib-old:/usr/lib/python2.6/lib-dynload'.
[notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[notice] mod_python: using mutex_directory /tmp
From what I've read, these errors come from mod_python. I'm using Flask and WSGI for my Python project, however, so I don't know why these errors are coming up.
Is there an easy way I can delete mod_python? - I've tried a2dismod, but mod_python doesn't appear to exist, even though I see it within Apache's mods-available directory.
EDIT: I've just tried a2dismod python, and that seems to have worked. I think I n00bishly was trying to disable mod_python. My Python apps still appear to work just fine.
Thanks in advance!
Look through your httpd.conf file, and remove the line that says:
LoadModule mod_python /path/to/mod_python.so
Then restart apache:
apachectl restart

Python 2.6 threading KeyError with Apache

I'm running Apache, installed using macports on OS X, to serve a Django app.
I'm getting many lines in the Apache error_log like these:
[Wed Feb 23 11:35:42 2011] [error] Exception KeyError: KeyError(-1606572256,) in <module 'threading' from '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.pyc'> ignored
The server doesn't seem to be having noticeable problems while these errors are logged, but it does crash every so often requiring a manual restart - which may or may not be related to these error messages.
Any ideas?
That bug is almost a year old. Update mod_wsgi.

Stackless python stopped mod_python/apache from working

I installed stackless pyton 2.6.2 after reading several sites that said its fully compatible with vanilla python. After installing i found that my django applications do not work any more.
I did reinstall django (1.1) again and now im kind of lost. The error that i get is 500:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.11 (Ubuntu) DAV/2 PHP/5.2.6-3ubuntu4.1 with Suhosin-Patch mod_python/3.3.1 Python/2.6.2 mod_ruby/1.2.6 Ruby/1.8.7(2008-08-11) mod_ssl/2.2.11 OpenSSL/0.9.8g Server at 127.0.0.1 Port 80
What else, could or should i do?
Edit: From 1st comment i understand that the problem is not in django but mod_python & apache? so i edited my question title.
Edit2: I think something is wrong with some paths setup. I tried going from mod_python to mod_wsgi, managed to finally set it up correctly only to get next error:
[Sun Aug 16 12:38:22 2009] [error] [client 127.0.0.1] raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
[Sun Aug 16 12:38:22 2009] [error] [client 127.0.0.1] ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
Alan
When you install a new version of Python (whether stackless or not) you also need to reinstall all of the third party modules you need -- either from sources, which you say you don't want to do, or from packages built for the new version of Python you've just installed.
So, check the repository from which you installed Python 2.6.2 with aptitude: does it also have versions for that specific Python of mod_python, mysqldb, django, and any other third party stuff you may need? There really is no "silver bullet" for package management and I know of no "sumo distribution" of Python bundling all the packages you could ever possibly need (if there were, it would have to be many 10s of GB;-).

Categories

Resources