0

I'm running a Django website off Apache and MySQL. I'm using a t1.micro instance. After every couple of days, my server starts giving a 500 error. I solve this problem by restarting the Apache2 and MySQL server. Any idea on what might be causing this and how to solve it will be appreciated.

[Tue Aug 12 20:29:18.770130 2014] [:error] [pid 6233] [client 31.13.102.116:62200] mod_wsgi (pid=6233): Exception occurred processing WSGI script '/var/www/html/sp-django-master/mysite/wsgi.py'., referer: http://www.meddy.co/doclistings/?selection=Internal+Medicine&genderselect=Select+a+Gender&languageselect=Choose+a+Language&submit
[Tue Aug 12 20:29:18.770256 2014] [:error] [pid 6233] [client 31.13.102.116:62200] IOError: failed to write data, referer: http://www.meddy.co/doclistings/?selection=Internal+Medicine&genderselect=Select+a+Gender&languageselect=Choose+a+Language&submit
[Wed Aug 13 14:53:10.843252 2014] [mpm_prefork:notice] [pid 1105] AH00169: caught SIGTERM, shutting down
[Wed Aug 13 14:53:11.808998 2014] [mpm_prefork:notice] [pid 8047] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.3 mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Wed Aug 13 14:53:11.809131 2014] [core:notice] [pid 8047] AH00094: Command line: '/usr/sbin/apache2'

2 Answers 2

0

You need to look in /var/log/apache2/error_log (or wherever your apache error log is configured to go) It will tell you in there what the actual problem is.

A problem which arises over time, and is solved by an apache and/or mysql restart could be something memory/resource related. I guess memory is the most obvious, but that's speculation.

1
  • Thanks for you answer. Yes, memory is also the thing that came to my mind. I've appended the error log into the question above. It seems like a problem in mod_wsgi which is the adapter to Apache for Django.
    – maahd
    Aug 13, 2014 at 16:52
0

The error message:

IOError: failed to write data

generally indicates that the HTTP client communicating with your web site is dropping the connection. One would normally only see it if you are using mod_wsgi embedded mode.

It is usually a transient issue and should not be a permanent issue.

If it is a permanent issue and your site is no longer accepting any requests, more information is needed about your specific configuration and whether you are using mod_wsgi daemon mode or not.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .