Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache/WSGI process dying

I recently have changed the server for some Django/Python sites and immediately I got into trouble. My Apache instance or the WSGI daemon simply dies! No logs, no warnings or errors. I have to restart the Apache as root and I'm thinking is a serious permissions flaw somewhere. My Linux knowlegde is limited and aparently I'm the only one who had this problem, because I cannot relate to other answers I've found so far.

The WSGI version is 3.3 (multiprocess = True and multithread = True), Python 2.7 and Django 1.4 on a Debian machine. Some of the python libraries I needed, Django included, didn't come from the Debian's repository; I had them installed "manually".

Sometimes, I dont know if it is important or not, I get this error:

"ImportError: Failed to import _strptime because the import lockis held by another thread."

like image 571
StefanNch Avatar asked Jan 26 '26 09:01

StefanNch


1 Answers

Read:

  • http://modwsgi.readthedocs.io/en/develop/user-guides/frequently-asked-questions.html#apache-process-crashes
  • http://modwsgi.readthedocs.io/en/develop/user-guides/installation-issues.html
  • http://modwsgi.readthedocs.io/en/develop/user-guides/application-issues.html

Make sure you are not loading mod_python at same time.

Ensure you are using mod_wsgi daemon mode and not embedded mode.

Force application to run in main interpreter application group.

The _strptime issue is a Python bug (only fixed in 3.3). Explicitly import _strptime module at the start of the WSGI script file.

like image 168
Graham Dumpleton Avatar answered Jan 27 '26 23:01

Graham Dumpleton