Page 1 of 2

Recent Messages Blank

Posted: 07 Sep 2017 22:29
by theEFAmenace
Hi All

Firstly, thanks to those who are maintaining this project, I gratefully appreciate your efforts.
If you were requiring any assistance I may be able to assist with PHP / Database programming.

(Appliance/VM) After this mornings upgrade to 3.0.2.4, Recent Messages and Search results are blank.

Any help or advice appreciated.

Thanks.

Re: Recent Messages Blank

Posted: 07 Sep 2017 22:42
by shawniverson
Hi :D

Any error messages during upgrade, by chance?

Re: Recent Messages Blank

Posted: 07 Sep 2017 23:09
by TheGr8Wonder
Also what version did you upgrade from?

Re: Recent Messages Blank

Posted: 08 Sep 2017 00:16
by theEFAmenace
Thanks for the replies
I was already on the most recent version, no errors during upgrade (that I saw).
Poking around now to see if there are any logs
Is there a specific log that you'd recommend should look at ?

Also tried disabling modsecurity via the EFA shell / menu

Re: Recent Messages Blank

Posted: 08 Sep 2017 01:05
by shawniverson
Restarted after updating?

Logs are in /var/log

/var/log/httpd

might be a good starting point.

Re: Recent Messages Blank

Posted: 08 Sep 2017 14:32
by tbuchanan
My upgrade from 3.0.2.3 to 3.0.2.4 did the same thing -- no messages shown in Recent Messages. I made a snapshot prior to the upgrade and immediately reverted thinking I had made a mistake so I can not go back and check the logs but I do remember as the mysql database upgrade screens flashed by something about a field not being able to be added or dropped in some table and in the ssl_error_log the same sort of message -- some field was not present and it caused a fatal php error. I'm sorry I didn't try to record the message or work through it. I may try the upgrade again tonight and see if the same error occurs and will try to document it.

Re: Recent Messages Blank

Posted: 08 Sep 2017 15:52
by shawniverson
tbuchanan wrote: 08 Sep 2017 14:32 My upgrade from 3.0.2.3 to 3.0.2.4 did the same thing -- no messages shown in Recent Messages. I made a snapshot prior to the upgrade and immediately reverted thinking I had made a mistake so I can not go back and check the logs but I do remember as the mysql database upgrade screens flashed by something about a field not being able to be added or dropped in some table and in the ssl_error_log the same sort of message -- some field was not present and it caused a fatal php error. I'm sorry I didn't try to record the message or work through it. I may try the upgrade again tonight and see if the same error occurs and will try to document it.
Please keep us posted. It sounds like an issue with the MailWatch database schema upgrade having trouble for some reason. I would like to find out what this is and see if we can add a fix to the update. It could be as simple as running the database upgrade.php a second time.

Re: Recent Messages Blank

Posted: 08 Sep 2017 16:38
by tbuchanan
I did a quick snapshot on our backup server and gathered this info: from the install routine toward the end of database table manipulation:
- Add rblspamreport field to `maillog` table......................... ALREADY DONE
- Add token field to `maillog` table................................. ALREADY DONE
- Add released field to `maillog` table.............................. ERROR
Database error: Got error 64 'Temp file write failure' from InnoDB - SQL = 'ALTER TABLE `maillog` ADD `released` TINYINT(1) DEFAULT '0''
Downloading file, please wait...

from the ssl_error_log:
[Fri Sep 08 12:34:56 2017] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'Unknown column 'released' 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? id AS ...')\n#1 /var/www/html/mailscanner/functions.php(1998): dbquery('?SELECT? id AS ...')\n#2 /var/www/html/mailscanner/status.php(81): db_colorised_table('?SELECT? id AS ...', 'Last 50 Message...')\n#3 {main}\n thrown in /var/www/html/mailscanner/functions.php on line 975, referer: https://vuesva2.vinu.edu/mailscanner/status.php

If there more info I can share, will be glad to. Will have to revert to snapshot before end of day. Currently blocked by firewall from accepting new mail.

Re: Recent Messages Blank

Posted: 08 Sep 2017 16:41
by tbuchanan
Forgot to mention, this is pretty much a stock CentOS 6 VM from image running on ESXi 5.5, installed several versions ago and updated normally.

Re: Recent Messages Blank

Posted: 08 Sep 2017 18:19
by shawniverson
- Add released field to `maillog` table.............................. ERROR
Database error: Got error 64 'Temp file write failure' from InnoDB - SQL = 'ALTER TABLE `maillog` ADD `released` TINYINT(1) DEFAULT '0''
This appears to an existing issue. How's your free space on your volumes? Specifically /var and /tmp?

Code: Select all

df -h

Re: Recent Messages Blank

Posted: 08 Sep 2017 19:09
by tbuchanan
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_00-lv_root
7.8G 4.6G 2.9G 62% /
tmpfs 7.8G 0 7.8G 0% /dev/shm
/dev/sda1 485M 136M 325M 30% /boot
/dev/mapper/vg_00-lv_tmp
976M 2.7M 923M 1% /tmp
/dev/mapper/vg_00-lv_var
125G 74G 45G 63% /var
none 7.8G 64M 7.8G 1% /var/spool/MailScanner/incoming

Re: Recent Messages Blank

Posted: 08 Sep 2017 19:17
by shawniverson
Ok, I see a possible reason for the issue.

Tell me how big this number is

Code: Select all

sudo du -h /var/lib/mysql/mailscanner

Re: Recent Messages Blank

Posted: 08 Sep 2017 19:19
by tbuchanan
du -h /var/lib/mysql/mailscanner
3.6G /var/lib/mysql/mailscanner

Re: Recent Messages Blank

Posted: 08 Sep 2017 19:31
by shawniverson
Bingo...

3.6 G > 923M (size of /tmp)

It is trying to alter this table using /tmp and is filling it up and causing upgrade.php to fail.

Simplest fix is to use a different place than /tmp...

Code: Select all

sudo mkdir /var/lib/mysql/temp
sudo chown mysql:mysql /var/lib/mysql/temp
sudo sed -i "/^\[mysqld\]/ a\tmpdir = /var/lib/mysql/temp" /etc/my.cnf.d/server.cnf
sudo service mysql reload
Attempt the upgrade again.

Re: Recent Messages Blank

Posted: 08 Sep 2017 19:35
by shawniverson

Re: Recent Messages Blank

Posted: 08 Sep 2017 19:36
by tbuchanan
do I run upgrade.php again or would it be best to roll back the snapshot, make the corrections, snapshot again and run the whole upgrade again? I'm sometimes rather a simpleton on these operations.

Re: Recent Messages Blank

Posted: 08 Sep 2017 19:41
by shawniverson
You can run just the upgrade.php again.

Code: Select all

wget https://raw.githubusercontent.com/mailwatch/MailWatch/master/upgrade.php
chmod u+x upgrade.php
./upgrade.php

Re: Recent Messages Blank

Posted: 08 Sep 2017 20:17
by tbuchanan
Excellent work Shawn! I just had to remember to stop MailScanner, etc before using the commands you provided. Thank you for sharing all your work, skills and knowledge. I am now up and running on 3.0.2.4

Re: Recent Messages Blank

Posted: 09 Sep 2017 01:31
by shawniverson
Issue fixed in 3.0.2.4 Update Release 2.

Re: Recent Messages Blank

Posted: 12 Sep 2017 03:00
by theEFAmenace
Thanks ! - fixed for me too

Re: Recent Messages Blank

Posted: 13 Sep 2017 12:25
by tjg88
I have the problem too, and I got the following error when I try to run the upgrade.php file (I stopped MailScanner as suggested too):

[admin@efa ~]$ sudo /etc/init.d/MailScanner stop
[sudo] password for admin:

MailScanner stopped
[admin@efa ~]$ ./upgrade.php
PHP Warning: file(/etc/EFA-Config): failed to open stream: Permission denied in /var/www/html/mailscanner/conf.php on line 53
PHP Warning: preg_grep() expects parameter 2 to be array, boolean given in /var/www/html/mailscanner/conf.php on line 53
PHP Warning: Invalid argument supplied for foreach() in /var/www/html/mailscanner/conf.php on line 54
PHP Notice: Undefined variable: db_pass_tmp in /var/www/html/mailscanner/conf.php on line 59
Error: Database connection failed: it is possible that the database is overloaded or otherwise not running properly; contact the system administrator if the problem persists
[admin@efa ~]$ sudo /etc/init.d/MailScanner start
MailScanner starting ...


MailScanner started with process id 20972
[admin@efa ~]$

Re: Recent Messages Blank

Posted: 13 Sep 2017 17:42
by TheGr8Wonder
You did not run the upgrade.php as sudo, you ran it as your admin user. You can either run the upgrade with sudo, or drop to the root user and run the same command again.

Code: Select all

sudo ./upgrade.php
It's odd since you specified sudo for the stopping and starting of MailScanner.

Re: Recent Messages Blank

Posted: 13 Sep 2017 18:41
by tjg88
That was it. Thanks. Thought I tried that too, guess I didn't. Everything is working now, I can see my recent messages and search results.

Re: Recent Messages Blank

Posted: 13 Sep 2017 20:12
by TheGr8Wonder
Glad to hear, and glad it worked this time around!! :D

Re: Recent Messages Blank

Posted: 02 Oct 2017 16:33
by peawet08
Hi,

I have just updated from 3.0.2.2 to 3.0.2.5 and it looks like this bug is still happening. Was the 3.0.2.4 update 2 bug included in the 3.0.2.5 update?

Thanks