Daily Mailcleaner Report send twice

Problems/questions regarding MailCleaner installation

Moderators: FlorianB, Pascal, bourgeois, mentor

Studi
Posts: 5
Joined: Mon Jan 15, 2018 12:25 pm
How did you hear about Mailcleaner: Internet

Daily Mailcleaner Report send twice

Postby Studi » Mon Jan 15, 2018 1:15 pm

I am using Mailcleaner 2017.09. Since update from January 6th 2018 (Updater4MC) daily Mailcleaner Reports seem to be send twice to each recpient.

summaries_20180115.log:

Sending daily summaries:
Sending daily summaries:
WARNING, CANNOT EXECUTE (INSERT INTO digest_access VALUES('2196564dbfd5e871d6addf80c956e20af9f478a4', DATE(NOW()), DATE_SUB(NOW(), INTERVAL 1 DAY), DATE(DATE_ADD(NOW(), INTERVAL 30 DAY)), 'example@example.com'); => Duplicate entry '2196564dbfd5e871d6addf80c956e20af9f478a4' for key 'PRIMARY')
COULDNOTSAVEDIGESTID INSERT INTO digest_access VALUES('2196564dbfd5e871d6addf80c956e20af9f478a4', DATE(NOW()), DATE_SUB(NOW(), INTERVAL 1 DAY), DATE(DATE_ADD(NOW(), INTERVAL 30 DAY)), 'example@example.com');
2018-01-15 00:03:55 SUMSENT to example@example.com for example@example.com (days: 1, spams: 1, id: 1earJj-0000GQ-BI)
2018-01-15 00:03:55 SUMSENT to example@example.com for example@example.com (days: 1, spams: 1, id: 1earJj-0000Gh-CS)

Maybe a bug in mailcleaner_cron.pl or script is started twice. Could not find any duplicate cron entry so far!
Anybody here with a similar problem?

Many thx in advance.
jeongl
Posts: 3
Joined: Fri Jan 12, 2018 5:52 pm
How did you hear about Mailcleaner: Google

Re: Daily Mailcleaner Report send twice

Postby jeongl » Mon Jan 15, 2018 6:20 pm

I too have the same issue with duplicate daily Quarantine summaries being sent on two Mailcleaner 2017 installations. Any ideas?
Studi
Posts: 5
Joined: Mon Jan 15, 2018 12:25 pm
How did you hear about Mailcleaner: Internet

Re: Daily Mailcleaner Report send twice

Postby Studi » Tue Jan 16, 2018 8:55 am

Status of my investigation:

I disabled the send_summary.pl call in /usr/mailcleaner/scripts/cron/mailcleaner_cron.pl. No report was generated. So it really seems that mailcleaner_cron.pl is startet twice at 00:00, somehow.

This morning I startet manually with

/usr/mailcleaner/bin/send_summary.pl -a 0 1 >> /var/mailcleaner/log/mailcleaner/summaries.log

One server sent single reports without a problem. Another server had a few errors (WARNING, CANNOT EXECUTE (INSERT INTO digest_access VALUES...), but most reports were sent. I will keep an eye on the next run and will continue investigation.

Any help would be greatly appreciated!
Studi
Posts: 5
Joined: Mon Jan 15, 2018 12:25 pm
How did you hear about Mailcleaner: Internet

Re: Daily Mailcleaner Report send twice

Postby Studi » Fri Jan 19, 2018 8:43 am

OK, now I am using own cronjobs for sending reports, while disabled system calls for send_summary.pl in mailcleaner_cron.pl. Working good so far.

I kept an eye on mailcleaner_cron.pl writing empty summary logs and played with the periodic task configuration.
Look what I have found out:

With daily tasks run at 01:00:00:

cat summaries_20180118.log
Sending daily summaries:

Correct single call!

With daily tasks run at 00:00:00:

cat summaries_20180119.log
Sending daily summaries:
Sending daily summaries:

Called twice! So there seems to be a bug somewhere in the periodic task process running at 00:00:00.
famaia
Posts: 2
Joined: Tue Jan 23, 2018 10:46 am
How did you hear about Mailcleaner: Google

Re: Daily Mailcleaner Report send twice

Postby famaia » Tue Jan 23, 2018 4:12 pm

Hi,

This is also happening to me.

Changed the line
my $sth = $slave_dbh->prepare("SELECT hostid FROM system_conf WHERE (0=HOUR(NOW())) AND ((MINUTE(NOW()) >= $ (...)
to
my $sth = $slave_dbh->prepare("SELECT hostid FROM system_conf WHERE (1=HOUR(NOW())) AND ((MINUTE(NOW()) >= $ (...)
on
/usr/mailcleaner/scripts/cron/mailcleaner_cron.pl

Will check tomorrow if it gets fixed with this.

Any official solution?


Regards,
Francisco Maia
jeongl
Posts: 3
Joined: Fri Jan 12, 2018 5:52 pm
How did you hear about Mailcleaner: Google

Re: Daily Mailcleaner Report send twice

Postby jeongl » Wed Jan 24, 2018 7:25 pm

Any luck finding the issue?
jeongl
Posts: 3
Joined: Fri Jan 12, 2018 5:52 pm
How did you hear about Mailcleaner: Google

Re: Daily Mailcleaner Report send twice

Postby jeongl » Thu Jan 25, 2018 5:38 pm

famaia wrote:Hi,

This is also happening to me.

Changed the line
my $sth = $slave_dbh->prepare("SELECT hostid FROM system_conf WHERE (0=HOUR(NOW())) AND ((MINUTE(NOW()) >= $ (...)
to
my $sth = $slave_dbh->prepare("SELECT hostid FROM system_conf WHERE (1=HOUR(NOW())) AND ((MINUTE(NOW()) >= $ (...)
on
/usr/mailcleaner/scripts/cron/mailcleaner_cron.pl

Will check tomorrow if it gets fixed with this.

Any official solution?


Regards,
Francisco Maia


This fix worked for me. Thanks!

Jeong

Return to “Installation”

Who is online

Users browsing this forum: No registered users and 3 guests