• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Webmail giving 500 internal server error

Gareth Westwood

Basic Pleskian
Hi All,

I updated my server to Obsidian Version 18.0.21 yesterday. Everything went well and I did some testing and it all seemed to be fine... until today when I received a couple of calls from customers who use webmail (roundcube) to access their email. I did not test this yesterday so assume it has been broken since the update.

I only had roundcube enabled so enabled hord as well via the plesk installer and changed a couple of domains over to see if that worked. It didn't. I have also tested on port 80 and 443, neither work.

I have also tried several different PHP versions and FastCGI / FPM, also to no avail.

Could someone point me in the right direction to work out what is going on.
 
PS, I have found a few posts relating to a mysql error, it does not appear to be that issue as mysql is installed and working fine for web sites on the server.
 
HI,

it would help if you were to check your logs and let us know any errors they might show. Otherwise it's just fishing in the dark...
/var/log/plesk-roundcube/errors
/var/log/httpd/error_log
would be good starting points :)

Cheers
 
Hey Tom,
Wasn't sure where to start looking for logs for webmail so thanks for that.
/var/log/plesk-roundcube/errors is not showing anyhting when I reload the page. Last entry was an invalid logon from 09/01/2020 (the day I did the upgrade)
/var/log/httpd/error_log however gives;
Mon Jan 13 09:19:45 2020 (6209): Fatal Error Unable to allocate shared memory segment of 134217728 bytes: mmap: Cannot allocate memory (12)
[Mon Jan 13 09:19:45 2020] [warn] [client ww.xx.yy.zz] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Mon Jan 13 09:19:45 2020] [error] [client ww.xx.yy.zz] Premature end of script headers: index.php​

I have a vague recollection that I had this problem when updating to a newer version of PHP on another site. I'll be good and have a google for that error rather than expecting others to do it for me!
 
I found the following which appears to describe my problem but does not fix it.
Websites, webmail or Plesk are not accessible: Cannot allocate memory (12)

ipcs -lm gives the following;
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 32768
max total shared memory (kbytes) = 8388608
min seg size (bytes) = 1​

So it looks fairly clear that when something is running it is trying to allocate more memory than the max segment size and fails. I'm now just not sure what it is that runs (when you load the webmail page (I'm assuming it's apache or php) or which version and therefore which config file to start with.
 
I've also just tried adding "opcache.memory_consumption=32" to the end of /etc/psa-webmail/roundcube/php.ini and that seems to have fixed the problem however there is a warning at the top of that file that it is generated automatically, so, new question

Does anyone know where /etc/psa-webmail/roundcube/php.ini is generated from and how to change the defaults / add a line to it?
 
Had a reply from Brujo but I can't see it here (which is strange).

I have also just realized that I was having a problem whereby the webserver configuration file was failing to be generated as I had some now depreciated commands in the config files for some of my sites.
Apache cannot be started on a Plesk server: Invalid command 'php_admin_value'

Confusingly in plesk it is just complaining about one site so I was ignoring that message, when I found email that made it clear that it was the entire server config that was failing I did something about it.

So I guess any changes I made in plesk might not have been getting through to my running config anyway. Errant commands have now been removed and the config seems to be building properly (although I see a red banner telling me there is a problem with one of the files still even though I've resolved it)
 
you might use/install in Plesk Panel > Extension or via add components
Webserver Configurations Troubleshooter
see: Plesk Webserver Configuration Troubleshooter


often it tells you more detailed about the issue of the config files..

It was already installed but I have never looked at it before.
It complained about some configuration files from domains that have been deleted so I fixed them and it is now all green.

Still not totally clear if I have resolved the issue "properly" or not. Should the webmail for a given domain run using the version of PHP that the domain name is configured to run or does it run using a version of PHP that is defined elsewhere?
 
Hi Again all,

I had left my install with the "opcache.memory_consumption=32" added to the end of /etc/psa-webmail/roundcube/php.ini which had resolved my issue until yesteday (or maybe the day before) when it seems the system re-built that file and wiped out my mod.

The opcache limit is also in the php 7.3 ini file so assuming that Brujo's suggestion that webmail is using php 7.3 is correct I am still missing a proper solution here. The php.ini in /etc/psa-webmail/roundcube is clearly being generated from somewhere, does anyone know where?
 
After taking a look through /usr/local/psa/admin/conf/templates/default/webmail/roundcube.php it would appear that my install is using plesk-php73-fastgci

plesk bin php_handler --list | grep fastcgi shows that the ini file for this is located in /opt/plesk/php/7.3/etc/php.ini
cat /opt/plesk/php/7.3/etc/php.ini | grep opcache.mem
shows that opcache.memory_consumption=32 is indeed included in the ini file.

So, if webmail is using 7.3, as it appears to be and if 7.3 has the memory limit applied then why is webmail ignoring that directive unless it is specifically added to the end of it's own ini file
 
File has been reset again by whatever it is that rebuilds it and killed webmail.
The "fix" of adding the line back is still working

Does anyone have any ideas what builds that file and how I change it's defaults?
 
Back
Top