python26 ctypes MemoryError under mod_wsgi

It is possible to encounter a MemoryError error related Python 2.6, on RHEL systems. This appears in the apache_error_main_docs_sde_4_5_6.log file (with the version replaced by the live version), and looks like a long stack trace ending in lines similar to the following:


[error] import ctypes

[error] File "/usr/local/lib/python2.7/ctypes/", line 552, in <module>

[error] _reset_cache()

[error] File "/usr/local/lib/python2.7/ctypes/", line 276, in _reset_cache

[error] CFUNCTYPE(c_int)(lambda: None)

[error] MemoryError


This is most likely caused by a misconfiguration of SELinux. To confirm if it is, run the command sudo setenforce 0, then restart apache using sde apache restart and confirm that SDE starts up correctly and and does not run into errors.


This is the related bug report for Red Hat:


To fix the issue, run the following commands:

sudo setsebool -P httpd_tmp_exec on
sudo setenforce 1
sudo sde apache restart

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request