Roundcube - 500 Internal Server Error

Following on from the build of a new host - Build of New Host

I installed Virtualmin, locked down Postfix and emails to go out of the new host & in. I can see them in Virtualmin\Webnmin under a users mailbox.

I installed Roundcube - 1.2.9 LTS. Going to https://myDomain2.com/roundcube - I am presented with the login page. Entering the user credentials and hitting submit - the page sits there for almost 1 minute. Then I get the 500 Internal Server Error.

Looking in /home/VirtualServer1/logs/error_log

all I see are pairs of lines such as

[Mon Jun 08 02:35:58.123339 2020] [fcgid:warn] [pid 27383] [client 70.99.222.222:59854] mod_fcgid: read data timeout in 41 seconds, referer: https://myDomain.com/roundcube/
[Mon Jun 08 02:35:58.123473 2020] [core:error] [pid 27383] [client 70.99.222.222:59854] End of script output before headers: index.php, referer: https://myDomain.com/roundcube/

[The above IP has been anonymised.]

I’ve looked through other logs - and there’s nothing in them for the time\s I’m trying to login via Roundcube.

Operating system- Ubuntu Linux 18.04.4
Perl version - 5.026001
BIND version - 9.11
Postfix version - 3.3.0
Apache version - 2.4.29
PHP versions - 7.2.24
MySQL version - 5.7.30-0ubuntu0.18.04.1

I’ve tried uninstalling Roundcube and res-installing it, the result is the same.

Would greatly appreciate any input on why Roundcube isn’t working and getting it fixed.

Thanks in advance.

Dibs

The latest LTS is 1.2.10, either try that or try to install Roundcube 1.4.6 as a test from the stable branch.
Or try the old-stable 1.3.13.

I installed Roundcube - 1.2.9 LTS.

There is no reason for installing older version, as the latest stable is 1.4.5.

How did you install RoundCube?
I think the best way is using install scripts. Because it will take care of needed modules.

Yes - installed thru Virtualmin’s Install scripts bit of the GUI.

I tried 1.4.5 as well - result was the same. Error 500 after login and same 2 entries in the log.

Thanks

Dibs

It just works for me out of the box. However, your case seems to have a need to fix execution mode, I would think. Check Websites Options and see which execution mode is working and which is not but before that, run config check.

[Mon Jun 08 02:35:58.123473 2020] [core:error] [pid 27383] [client 70.99.222.222:59854] End of script output before headers: index.php, referer

This error is usually cased by world-writable permissions set on the script or cgi-bin directory, which again, shouldn’t be happening by default.

@Ilia - just ran config check and it moaned about mydestination not having an entry for myDomain which is the master domain.

The original entry was

$myhostname, host2.masterDomain.com, localhost.masterDomain.com, , localhost

and had 2 commas. Corrected that to

$myhostname, host2.masterDomain.com, masterDomain.com, localhost.masterDomain.com, localhost

and ran check config and no issues highlighted.

Website Options - I’ve actually tried them all with the same results each time.

  1. With it set to FCGId (run as virtual server owner) - appears to be default, I still get Internal Server Timeout and in /home/myVirtualServer/logs/error_log I get

[Mon Jun 08 18:22:09.682765 2020] [fcgid:warn] [pid 7581] [client 11.22.33.44:50958] mod_fcgid: read data timeout in 31 seconds, referer: https://myDomain.com/roundcube/
[Mon Jun 08 18:22:09.682826 2020] [core:error] [pid 7581] [client 11.22.33.44:50958] End of script output before headers: index.php, referer: https://myDomain.com/roundcube/

Just a thought - looking at the IP (anonymised) should port 50958 be listening on the server?

  1. Setting Website Options to CGI wrapper (run as virtual server owner), I still get the RoundCube login page with username as I typed it, the password field gets wiped and for 10s or so, there is a message below the login fields that says “Connection to IMAP server failed.”.

/home/myVirtualServer/logs/error_log shows no entries for the time period & login attempt. The main mail.log shows nothing either.

  1. Setting Website Options to Apache mod_php (run as Apache’s user) still gets “Connection to IMAP server failed.” on RoundCube screen.

Mail.log shows nothing. /home/myVirtualServer/logs/error_log shows lots of identical lines as below

[Mon Jun 08 18:36:37.467255 2020] [php7:warn] [pid 12145] [client 11.22.33.44:51019] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/myVirtualServer/public_html/roundcube/program/lib/Roundcube/rcube_plugin_api.php on line 454, referer: https://myDomain.com/roundcube/

  1. Setting Website Options to FPM (run as virtual server owner) the RoundCube page doesn’t load up and I get Service Unavailble. /home/MyVirtualServer/logs/error_log has the following lines,

[Mon Jun 08 18:43:01.811161 2020] [proxy:error] [pid 15443] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:8000 () failed
[Mon Jun 08 18:43:01.811315 2020] [proxy_fcgi:error] [pid 15443] [client 11.22.33.44:51053] AH01079: failed to make connection to backend: localhost
[Mon Jun 08 18:43:26.387075 2020] [proxy:error] [pid 15441] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:8000 (
) failed
[Mon Jun 08 18:43:26.387204 2020] [proxy_fcgi:error] [pid 15441] [client 11.22.33.44:51057] AH01079: failed to make connection to backend: localhost

Absolutely no idea why Roundcube isn’t playing ball. Really don’t want to wipe the VPS and try all over again - considering everything else SMTP, POP, DKIM, etc are all behaving.

Thanks in advance

Dibs

How did you install Virtualmin?

I followed the installation instructions at https://www.virtualmin.com/download.html

I think I’ve got to the bottom of it.

Roundcube has config file where you can enable logging

public_html/roundcube/config/

There are 2 files of interest:

  • config.inc.php

  • defaults.inc.php

The 1st one overrides the 2nd one. The 2nd one has entries for logging etc. The log files by default will appear in

public_html/roundcube/logs

There was a missing php module - php-zip. Once installed - the error in errors.log stopped. Still wouldn’t allow me to log in tho.

In the end it was replacing default server (IMAP & SMTP) with 127.0.0.1 instead of localhost.

2 issues still remain.

  • sending emails is very slow. Even from Webmin\Virtualmin let alone Roundcube. About 1 min. The server has 1GB of ram & a 512mb swap - about the same as the existing host (which is due to be replaced by this new host and that is almost instantaneous when it comes to sending emails). Any thoughts on where to look?
  • I think something might be amiss somewhere with respect to localhost. Out of the box Roundcube should work - I had to replace the IMAP\SMTP server entries from localhost to 127.0.0.1. I’m having a slight intellectual intermission - any suggestions where to look?

Thanks in advance

Dibs

p.s. On the slow sending of emails - I do remember during the install, the installer asked something about emails (could have been a Postfix bit) where I wanted the slow version or fast version. The latter taking a bit of memory - I selected the slow version. It think (not 100% sure) it mentioned something about a 2nd lookup or thereabouts. Could that be what’s causing the sending of mail to be really slow (relative to the existing host)?

Will the System Settings >> Re-Run Install Wizard mess things up if I re-run it?

I’m inclined to change the slow to fast option relating to email processing - assuming I get asked that again.

Thanks in advance

Dibs

That was probably related to spamassassin, not postfix…

@calport - now that you mention it and I think about it, it is probably to do with the choice between running spamc & spamassasin (standalone program).

I still need to get to the bottom of why the existing host sends emails virtually instantly and new one takes much longer with spamc enabled and almost as quick as the old host with it disabled.

That and the mailq takes a few minutes longer to process emails on the the new host.

Thanks in advance.

Dibs

No. Outgoing mail is not scanned for viruses or spam. Slow sending is 99% a DNS problem.

I’m marking this as fixed. The fix was to change the entries in the Roundcube config file\s from local host to 127.0.0.1 and the issue with the slow emails going etc - the solution is in Postfix - 30s delay in sending emails

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.