[Answered ]-Django OSError: failed to write data

2👍

The errors indicate you are likely using mod_wsgi daemon mode.

The error:

OSError: failed to write data

is likely because the Apache child worker process which was proxying to the mod_wsgi daemon process was killed while a response was still being written back from the mod_wsgi daemon process via the proxying process. Triggering logrotate could indeed trigger that as it will cause processes to be killed off.

The error:

AssertionError: assert tlock is not None

is because you are using an old mod_wsgi version that doesn’t have some changes in it to accommodate that Python 3.4 change internals related to interpreter destruction. You need to upgrade mod_wsgi to get rid of it. In itself it doesn’t cause an issue as the process is exiting anyway, but will cause noise in the log files on every restart or shutdown.

Leave a comment