Apache: Resource temporarily unavailable: setuid: unable to change to uid

Today we discovered a weird issue in one cPanel box, it was having a strange Apache error and it was crashing on and on. We checked the logs and found this error: Resource temporarily unavailable: setuid: unable to change to uid:

[Tue Apr 27 10:01:03 2016] [alert] (11)Resource temporarily unavailable: setuid: unable to change to uid: 99
[Tue Apr 27 10:01:03 2016] [alert] Child 14231 returned a Fatal error... Apache is exiting!
[Tue Apr 27 10:01:03 2016] [alert] (11)Resource temporarily unavailable: setuid: unable to change to uid: 99
[Tue Apr 27 10:01:03 2016] [emerg] (42)Identifier removed: couldn't grab the accept mutex
[Tue Apr 27 10:01:03 2016] [emerg] (23)Invalid argument: couldn't release the accept mutex

Reading a little bit on cPanel forums and according to cPanel Tech Team, this this error can happen because low system memory or file handlers.

How can I fix Apache Resource temporarily unavailable: setuid: unable to change to uid error?

A possible work around for cPanel servers is to apply the following changes to httpd.conf configuration file:

nano -w /usr/local/apache/conf/httpd.conf

This must be placed above the <IfModule prefork.c> block:

AcceptMutex fcntl

Save the changes:

/usr/local/cpanel/bin/apache_conf_distiller --update
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart

If your httpd service doesn’t start ok after that, try killing the remaining httpd process, like this, and then start the server again:

killall -9 httpd
/etc/init.d/httpd restart

This should fix your Resource temporarily unavailable: setuid: unable to change to uid error on Apache. Please let us know if you know any other alternative solutions.

Further reading: mpm_common Apache module

 

About the Author: Santiago Borges

Experienced Sr. Linux SysAdmin and Web Technologist, passionate about building tools, automating processes, fixing server issues, troubleshooting, securing and optimizing high traffic websites.

Leave a Reply

Your email address will not be published. Required fields are marked *