ZShmStorage(): Fatal error: failed to allocate semaphore. Permission denied - apache

I've read numerous posts about Semaphore issues, but none appear to be related to this particular issue. I am running Apache 2.4 and PHP 7.1 as part of Zend Server CE, and when starting the Apache service, the following fatal error shows up in the Apache error log:
ZShmStorage(): Fatal error: failed to allocate semaphore. Permission denied
I'm guessing that is related to shared memory storage, but I'm unclear ...
what it is actually trying to allocate the semaphore for
where to look for configuration relating to said semaphore
I thought maybe it was related to the Zend Cache, so I made sure that the permissions looked correct for the [ZendServerPath]/tmp/datacache.
I also thought maybe it was related to the PHP Sessions, so I made sure that the directory specified for the session.save_path in the [ZendServerPath]/etc/php.ini file had proper permissions as well.
I'm unsure where else to look, as there doesn't appear to be any discussions (that I've found) relating to this, but instead it's all about available space and whatnot. In the off chance that it was related to something that borked during allocation, I went ahead executed ipcs -s and noted that there were ~20 Semaphore Arrays present while the Zend Server was running. I stopped the service and ran ipcs -s again -- no Semaphore Arrays were left lingering. Restarted the Zend Server service and the error was encountered again and ~20 Semaphore Arrays were also reallocated.
Any assistance or info to point me in the right direction would be appreciated.

I know this is too late to help #amorio, but maybe it'll help someone else.
The error is specifically from ZShmStorage(), which means it's not apache or php's fault. It really doesn't help that the error message is a bit misleading.
A bit more context on the error, at least in my case. I'm betting it's the same using php(-cgi).
Starting php-fpm (/usr/local/zend/sbin/php-fpm --nodaemonize -c /usr/local/zend/etc/php-7.1-fpm.ini --pid /usr/local/zend/var/run/php-fpm.pid --fpm-config /usr/local/zend/etc/php-7.1-fpm.conf) [10.11.2020 18:18:05 ERROR] ZShmStorage(): Fatal error: failed to allocate semaphore. Permission denied
<br />
<b>Warning</b>: Could not initialize Zend Data Cache: Fatal error: failed to allocate semaphore. Permission denied in <b>Unknown</b> on line <b>0</b><br />
Zend Server installed to /usr/local/zend.
I ran into this same issue on ZendServer 9.1.10 on Ubuntu 16.04. In my case, I had to fix permissions on /usr/local/zend/tmp/datacache so www-data (apache user) had write access.
/usr/local/zend/etc/conf.d/datacache.ini is where the save path is defined.

Related

Hyper-v Machine shuts down unexpectedly, Hyper-V log shows an Error:"DM operation add for the virtual machine"

This cause me a big production problems, please help me.
one virtual machine shutted down unexpectly.
The Hype-v log shows:
DM operation add for the virtual machine 'XXXXName' failed with error: Unspecified error (0x80004005) (Virtual machine ID 7EDDD39A-F963-4FAA-8854-6179B7611AC3).
could it be possible if nobody touch the Hype-v and DM error happened??? please tell me how to fix this problem.
DM is "dynamic memory". Your virtual machine tried to add memory and failed. A human didn't trigger this, you've just run out of memory.
https://social.technet.microsoft.com/Forums/windowsserver/en-US/f60b2767-dbfc-41d0-8019-24039aab187d/dynamic-memory-issue-dm-add-fails-with-0x800705aa?forum=winserverhyperv
Edit: the reason it failed, the error code, is explained here. It's possible there was a permission problem trying to allocate more memory. But still, essentially, you ran out of memory.
https://appuals.com/solved-how-to-fix-error-0x80004005/

Simplepie plugin causing an internal server error?

My website host did some checking for me and indicated that Simplepie plugin is causing a memory problem. Can you say which files need to be removed in order to access my Sopacameraclub.com site again? below is the info provided to me:
[3:23:25 AM]Vyshnavi Gottumukkala:From the error logs I see 20180118T164756: www.sopacameraclub.com/wp-admin/index.php
PHP Fatal error: Out of memory (allocated 118489088) (tried to allocate 1966080 bytes) in /hermes/bosnaweb08a/b2428/ipg.sopacameraclubcom/wp-includes/SimplePie/Item.php on line 2736
[3:25:03 AM]Vyshnavi Gottumukkala:From the error, I see issue with SimplePie application . Please contact the vendor and correct it or you can remove the files from your website
Simplepie was not causing the problem. I had too many plugins loaded which was causing the memory problem. Once I deactivated enough plugins there was enough memory to keep my site running.

Centos server hanged due to postfix/sendmail spam emails

My centos server is running web applications in LAMP stack. A couple of days back, the server was not responding for about 10 mins and I got http response failure alert from my monitoring tool. When I checked the httpd error log I found a huge log entry (~12000 lines) related to sendmail.
14585 sendmail: fatal: open /etc/postfix/main.cf: Permission denied
The server ran out of memory and not responding.
14534 [Fri Aug 19 22:14:52.597047 2016] [mpm_prefork:error] [pid 26641] (12)Cannot allocate memory: AH00159: fork: Unable to fork new process
14586 /usr/sbin/sendmail: error while loading shared libraries: /lib64/librt.so.1: cannot allocate version reference table: Cannot allocate memory
We are not using sendmail in any of our application. How can I stop this attack in future?
Thank you in advance!
Sorry I have no comment facilities; it looks like one of your website pages is vulnarable for code injection, finding out where and what page may be a huge job. Focus on input (forms) variables. Always sanitize input variables before using them! P.s. php uses "sendmail", even if you use Postfix, it will use a sendmail binary to send mail and the sendmail binary will redirect it to Postfix. If your forms work well and the 12k error log lines come out of the blue, then I would think someone is trying to inject code through your website (happens all the time by the way).

Phusion Passenger internal server error

I'm using Apache + Passenger on my Linode server, with a Postgresql-9.4 database. Every so often, I get the following error, but it is unpredictable and rights itself a few minutes later with no actions taken, so it is extremely hard to debug:
Internal server error
Phusion Passenger has listed more information about the error below.
An error occurred while starting the web application. It sent an unknown response type "".
Has anyone else run into an error like this, or know what it could imply?
Firstly go through this question, as it might solve your problem:
Passenger: internal server error
There are possible causes of problems listed here:
https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems

Tomcat showing this error "This is very likely to create a memory leak". How to resolve this issue?

I have created a web application in Apache Cocoon.This website is running properly but after every 3-4 days, it stops responding. It doesn't run until and unless, we restart the tomcat service. In the catalina.2011-05-09.log file, it shows following error:-
"May 9, 2011 3:17:34 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/webresources] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation."
I am not been able to understand the cause of this problem. Can someone suggest me how to resolve this issue?
You are using a library that is starting one or more threads and is not properly shutting them down or releasing other resources captured by the thread. This often happens with things like Apache HTTP components (I get this error with Http Components) and anything that uses separate threads internally. What libraries are you using in your Cocoon application?
It is telling you the issue:
[...] is still processing a request that has yet to finish
You need to find out what that request is/is going to. One easy way is to have something like PsiProbe installed.
Also, it's not a bad idea to restart Tomcat every night. It can help alleviate these kinds of issues until you find the root cause.