No message listing in mailwatch on 3.0.2.6

Report bugs and workarounds
Post Reply
taurix
Posts: 6
Joined: 09 Nov 2016 15:13

No message listing in mailwatch on 3.0.2.6

Post by taurix »

I have this issue since the upgrade to 3.0.2.5, both recent messages and reports > message listing are empty. There is nothing there.
I can access the message view by ID so the data should be there, counts are also ok.

Did I hit a bug?
samigr
Posts: 5
Joined: 09 Sep 2014 10:42

Re: No message listing in mailwatch on 3.0.2.6

Post by samigr »

I have the same problem, upgraded from 3.0.2.4. And I can't find any errors from the logs.
kingramon0
Posts: 27
Joined: 28 Jun 2014 19:17

Re: No message listing in mailwatch on 3.0.2.6

Post by kingramon0 »

Did you check the update log to see if it had errors? (/var/log/EFA/update-[date])

I had a similar issue. My log showed this during the database upgrade section:

Code: Select all

MailWatch for MailScanner Database Upgrade to 1.2.7-dev

Testing connectivity to the database ................................. OK

Updating database schema:

 - Convert database to utf8........................................... ALREADY DONE

 - Drop `geoip_country` table......................................... ALREADY DROPPED
 - Drop `spamscores` table............................................ ALREADY DROPPED
 - Add autorelease table to `mailscanner` database.................... ALREADY EXIST
 - Add mtalog_ids table to `mailscanner` database..................... ALREADY EXIST
 - Add resetid, resetexpire and lastreset fields in `users` table..... ALREADY EXIST
 - Add login_expiry and login_timeout fields in `users` table......... ALREADY EXIST

 - Fix schema for username field in `audit_log` table................. OK
 - Fix schema for id field in `blacklist` table....................... ALREADY DONE
 - Fix schema for id field in `whitelist` table....................... ALREADY DONE
 - Fix schema for username field in `users` table..................... ALREADY DONE
 - Fix schema for username field in `user_filters` table.............. ALREADY DONE
 - Fix schema for spamscore field in `users` table.................... ALREADY DONE
 - Fix schema for highspamscore field in `users` table................ ALREADY DONE
 - Fix schema for timestamp field in `maillog` table.................. OK
 - Fix schema for password field in `users` table..................... ALREADY DONE
 - Fix schema for fullname field in `users` table..................... ALREADY DONE
 - Fix schema for rule_desc field in `mcp_rules` table................ ALREADY DONE

 - Cleanup orphaned user_filters...................................... OK
 - Add id field and primary key to `audit_log` table.................. ALREADY DONE
 - Add inq_id field and primary key to `inq` table.................... ALREADY DONE
 - Add maillog_id field and primary key to `maillog` table............ ALREADY DONE
 - 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: Incorrect key file for table 'maillog'; try to repair it - SQL = 'ALTER TABLE `maillog` ADD `released` TINYINT(1) DEFAULT '0''
I had to manually go in and add the 'released' column to the table. In a later update I ran into the same problem with the 'salearn' field. Fixing both of those fixed my problem.

You can also look in the http or https logs to see specifically if it is failing on a certain field. For example, my /var/log/httpd/ssl_error_log showed this:

Code: Select all

[Fri Jan 26 06:30:04 2018] [error] [client 172.16.32.105] 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://smtp.libertypumps.com/mailscanner/status.php
That's how I found that it was looking for a column called 'released' that wasn't there.
samigr
Posts: 5
Joined: 09 Sep 2014 10:42

Re: No message listing in mailwatch on 3.0.2.6

Post by samigr »

Found excatly the same error from ssl_error -log. How this coulumn is created and to where?
taurix
Posts: 6
Joined: 09 Nov 2016 15:13

Re: No message listing in mailwatch on 3.0.2.6

Post by taurix »

The release column is fine but the error log has this:
Mon Jan 29 13:13:34 2018] [error] [client 10.250.0.254] PHP Fatal error: Uncaught mysqli_sql_exception: Unknown column 'salearn' in 'field list' in /var/www/html/mailscanner/functions.php:975\nStack trace:\n#0 /var/www/html/mailscanner/functions.php(975): mysqli->query('\\nSELECT\\n id AS ...')\n#1 /var/www/html/mailscanner/functions.php(1998): dbquery('\\nSELECT\\n id AS ...')\n#2 /var/www/html/mailscanner/status.php(81): db_colorised_table('\\nSELECT\\n id AS ...', 'Last 50 Message...')\n#3 {main}\n thrown in /var/www/html/mailscanner/functions.php on line 975, referer: https://efa02.taurix.net/mailscanner/login.ph

That will be the cause. but how do I fix it?

Also, it is a bug that the Updater finishes without telling you of upgrade failures, will see to file a bugreport after I fix the install
taurix
Posts: 6
Joined: 09 Nov 2016 15:13

Re: No message listing in mailwatch on 3.0.2.6

Post by taurix »

I fixed it by adding the salearn to the maillog table in the mailscanner database:
ALTER TABLE `maillog` ADD `salearn` TINYINT(1) DEFAULT '0';
samigr
Posts: 5
Joined: 09 Sep 2014 10:42

Re: No message listing in mailwatch on 3.0.2.6

Post by samigr »

I got info from create.sql, both released and salearn were missing. Adding them fixed the problem for me, thanks kingramon0 .
iljac
Posts: 2
Joined: 07 Feb 2018 18:41

Re: No message listing in mailwatch on 3.0.2.6

Post by iljac »

I have the same problem But i am not sure How to add the tables in mysql.

Could someone help with detailed instructions about how to resolved this?
kingramon0
Posts: 27
Joined: 28 Jun 2014 19:17

Re: No message listing in mailwatch on 3.0.2.6

Post by kingramon0 »

iljac wrote: 07 Feb 2018 19:02 I have the same problem But i am not sure How to add the tables in mysql.

Could someone help with detailed instructions about how to resolved this?
In /etc/EFA-Config there is a line that says MYSQLROOTPWD: followed by some random characters. Copy everything after the colon for the next command.

Command:
mysql -u root -p

Hit enter and it will prompt you for the password. Enter what you copied above.

Command:
use mailscanner;

The prompt should change to indicate you are in the mailscanner database.
Example:
MariaDB [mailscanner]>

The next command(s) will depend on which columns you are missing.

Command:
ALTER TABLE `maillog` ADD `salearn` TINYINT(1) DEFAULT '0';
or
ALTER TABLE `maillog` ADD `released` TINYINT(1) DEFAULT '0';
or both.

Command:
quit


Note that in those commands, `maillog`, `salearn`, and `released` are surrounded by back-ticks (on the same key as the tilde ~), they are not quotes, but the 0 at the end is in single quotes.

Please make a backup of some kind before you log in to the database as root.
sebastian.savard
Posts: 6
Joined: 29 Jan 2018 13:34

Re: No message listing in mailwatch on 3.0.2.6

Post by sebastian.savard »

Just wanted to throw my two cents in. We had this issue as well, and running the two table alters cleared it up for us. We saw it on two separate boxes, so I'm not sure if it's an issue with the install process or just some weird config change issue that is common.
Post Reply