Web interface not working after auto-update

Report bugs and workarounds
Post Reply
kingramon0
Posts: 21
Joined: 28 Jun 2014 19:17

Web interface not working after auto-update

Post by kingramon0 » 09 Nov 2017 17:56

Our server auto-updated a few days ago, despite that feature being turned off (it's not the first time this has happened either).

Now on 3.0.2.5, we can't get into the web interface. When browsing to /status.php we get this:

Code: Select all

// Define MailWatch logo name define('MW_LOGO', 'mailwatch-logo.png'); // Define language (de, en, fr, it, nl, pt_br); // See http://www.lingoes.net/en/translator/langcode.htm define('LANG', 'en'); // Optional: If USER_SELECTABLE_LANG is defined and the value contains more than one language then the user gets a dropdown // in the gui to change the language of his browser. The selectable languages are defined as a comma separated list. //define('USER_SELECTABLE_LANG', 'de,en,fr,it,nl,pt_br'); // Session Handling - conflicts can exist when the your environment makes use of multiple php sessions on the same server // to resolve this, uncomment the following option. See https://github.com/mailwatch/MailWatch/issues/730 for more info // define('SESSION_NAME', 'MailWatch'); // Session Timeout - Sets the global session timeout value, default is 600 sec (10 minutes) if not defined // Range is 0 to 99999 seconds. Setting to 0 will disable session timeout and active session statuses. // This can also be set individually per user in the MailWatch GUI for greater flexibility. //define('SESSION_TIMEOUT', 600); // Greylisting menu item define('SHOW_GREYLIST', true); // Hide Unknown Mail from quarantine reports define('HIDE_UNKNOWN', false); //Quarantine Auto Release //Set true to allow auto release of quarantined items from quarantine report define('AUTO_RELEASE', false); //Give Domain Admins ability to release dangerous content, like viruses define('DOMAINADMIN_CAN_RELEASE_DANGEROUS_CONTENTS', false); define('DOMAINADMIN_CAN_SEE_DANGEROUS_CONTENTS', false); /* Password Reset */ // Give users the ability to reset a forgotten password. define('PWD_RESET', false); // Number of hours link is valid for. define('RESET_LINK_EXPIRE',1); // Set the following 2 variables (and uncomment) if you wish to define // an alternative sender name and address for password resets. // NOTE: Both must be set, otherwise it will use the default settings. // define('PWD_RESET_FROM_NAME', 'Some other name'); // Set if you wish reset email sent from alternative name. // define('PWD_RESET_FROM_ADDRESS', 'support@yourdomain.com'); // Set is you wish reset email sent from alternative address. /* End Password Reset */ // Interval for the traffic chart for admins in minutes (default is 60, max 1440 (24h)) define('STATUSGRAPH_INTERVAL', 60); //Allow domain admins to create/edit/delete other domain admins from the same domain (not recommended, only for backward compatibility) //define('ENABLE_SUPER_DOMAIN_ADMINS',true); //Allow the username of domain admins and normal users to not be in mail format (not recommended, only for backward compatibility) //define('ALLOW_NO_USER_DOMAIN',true); The following conf.php mandatory entries are missing, check and compare your conf.php with conf.php.example.
- ALLOWED_TAGS
- AUDIT
- AUDIT_DAYS_TO_KEEP
- AUTO_RELEASE
- DATE_FORMAT
- DB_DSN
- DB_HOST
- DB_NAME
- DB_PASS
- DB_TYPE
- DB_USER
- DEBUG
etc...
Any idea where to start troubleshooting?

kingramon0
Posts: 21
Joined: 28 Jun 2014 19:17

Re: Web interface not working after auto-update

Post by kingramon0 » 10 Nov 2017 17:46

So I ended up having two issues.

First one, as the error above indicates, my conf.php was missing required settings. I created a new conf.php based on conf.php.example. The main thing is to fix the DB_PASS with the MAILWATCHSQLPWD found in /etc/EFA-Config.

After that was fixed, I still had issues getting in. I could enter credentials into the login screen, but got a 500 error after. /var/log/httpd/ssl_error_log showed this:

Code: Select all

[Fri Nov 10 12:23:20 2017] [error] [client 123.456.789.123] PHP Fatal error:  Uncaught exception 'mysqli_s
ql_exception' with message 'Unknown column 'login_expiry' in 'field list'' in /var/www/html/mailscanner
/functions.php:975\nStack trace:\n#0 /var/www/html/mailscanner/functions.php(975): mysqli->query('SELECT login_ex...')\n#1 /var/www/html/mailscanner/functions.php(4628): dbquery('SELECT login_ex...')\n#2 /var/www/html/mailscanner/functions.php(306): checkLoginExpiry('admin')\n#3 /var/www/html/mailscanner/sf_version.php(38): html_start('MailWatch and M...', 0, false, false)\n#4 {main}\n  thrown in /var/www/html/mailscanner/functions.php on line 975
An unknown column in the database? Something must not have upgraded properly. I searched for "login_expiry" and found this problem already dealt with in this thread: viewtopic.php?f=13&t=2542&p=10037&hilit ... iry#p10037

I wget'ed and ran the script and that got me through the upgrade. It works now.

I did get the following warning at the end:

Code: Select all

*** ERROR/WARNING SUMMARY ***
Table Index: MySQL version unsupported for index `subject_idx` on table `maillog`, upgrade to version >= 50604 (you have version 50505)
It works despite this, but I'm guessing searches will run faster if that can be fixed.

User avatar
pdwalker
Posts: 849
Joined: 18 Mar 2015 09:16

Re: Web interface not working after auto-update

Post by pdwalker » 14 Nov 2017 07:32

It looks like the upgrade failed partially.

Can you find any logs from the autoupdate so we can see what may have gone wrong?

kingramon0
Posts: 21
Joined: 28 Jun 2014 19:17

Re: Web interface not working after auto-update

Post by kingramon0 » 14 Nov 2017 16:52

Log attached
Attachments
EFA-log.gz
(208.18 KiB) Downloaded 2 times

User avatar
pdwalker
Posts: 849
Joined: 18 Mar 2015 09:16

Re: Web interface not working after auto-update

Post by pdwalker » 15 Nov 2017 05:04

still looking at the logs, but you updated from 3.0.0.2 to 3.0.2.5 in one go. Wow.

[edit: first problem found] So at line 15865 is the first big error. It appears that the 3.0.1.7 to 3.0.1.8 upgrade didn't complete successfully, but the upgrade process continued on.

This appears to have caused a series of errors with the further updates.

At this point, I'd reinstall. There is no way I'd try to unentangle this mess unless I really, really needed to.

Reinstalling would be faster than trying to repair the damage, and even if I were knowledgeable enough to fix the system by hand, I'd always be concerned I would have missed something that would cause the next update to break.

My opinion only. Perhaps someone else has a better suggestion for you.

kingramon0
Posts: 21
Joined: 28 Jun 2014 19:17

Re: Web interface not working after auto-update

Post by kingramon0 » 15 Nov 2017 13:58

I didn't update it in one go. As I said, autoupdate was turned off, but it autoupdated anyway. This is for a friend's small company that is winding down operations, and I basically am just helping them out for free. So, I don't have much time to dedicate to it, so I don't do updates as long as it keeps working.

It seems to be working fine currently, so I'm not going to do anything else with it. The two issues I fixed seem to have made it usable again.

kingramon0
Posts: 21
Joined: 28 Jun 2014 19:17

Re: Web interface not working after auto-update

Post by kingramon0 » 15 Nov 2017 14:00

Thanks for taking the time to look over the logs.

User avatar
pdwalker
Posts: 849
Joined: 18 Mar 2015 09:16

Re: Web interface not working after auto-update

Post by pdwalker » 15 Nov 2017 14:13

Apologies. I did't look at the timestamps, I just assumed.

(and I often update through several versions in a row)

User avatar
shawniverson
Posts: 2432
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Web interface not working after auto-update

Post by shawniverson » 15 Nov 2017 23:49

This blowup from 3.0.1.7-3.0.1.8 in your log actually mostly corrects itself on the 3.0.1.8-3.0.1.9 update, when another mailwatch update comes along and installs. The conf.php, of course, didn't make it, and rebuilding the conf.php was the right corrective action.

Amazing! This is a gem of an install. 3.0.0.2 all the way to now?

Seeing issues like this helps us to improve the error handling, so thank you for sharing :)
Version 3.0.2.5 released! Update now to keep your eFa secure!

kingramon0
Posts: 21
Joined: 28 Jun 2014 19:17

Re: Web interface not working after auto-update

Post by kingramon0 » 16 Nov 2017 00:30

You're welcome.

I discovered today after a power outage that the mailscanner service was chkconfig'ed off.

It took an embarrassingly long time to figure that out. I thought it was an issue with clamd at first, so I removed it to reinstall and discovered it wasn't in the repos. I had to find an rpm and install it manually. Then I noticed mailscanner wasn't even running.

Post Reply