Digests

Digests sending identical digests to members every hour - Digests

Digests sending identical digests to members every hour

by sbloomer » Mon Jul 22, 2019 7:00 pm

I have had an incident where the identical digests were sent to the users every hour for over 24 hours.

Looking at the logs, for one user, you can see it's sending the same digest every hour for the previous day
Annotation 2019-07-22 205240.png
It's doing this to all members who are subscribed to digests and my members are going nuts. It only started yesterday, and I don't know where to look.

I did notice the cron was locked but not related to the digests.
sbloomer
Registered User
Posts: 87
Joined: Fri Jun 12, 2009 8:18 pm

Re: Digests sending identical digests to members every hour

by MarkDHamill » Mon Jul 22, 2019 7:36 pm

Are you using a phpBB cron or a system cron?
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: Digests sending identical digests to members every hour

by sbloomer » Tue Jul 23, 2019 6:21 am

It,s the phpBB cron. It's generally been working until now.
sbloomer
Registered User
Posts: 87
Joined: Fri Jun 12, 2009 8:18 pm

Re: Digests sending identical digests to members every hour

by MarkDHamill » Tue Jul 23, 2019 12:22 pm

Make sure you don't have a real cron job using curl or something too.

I assume you did not update the version of the extension and that's when the problem was introduced. It is possible that the username is not distinct in the phpbb_users tables?

This code should prevent duplicate digests from going out. But I am wondering if your maintenance log has any log entries where this condition is recorded. The string to look for is:

Code: Select all

	'LOG_CONFIG_DIGESTS_DUPLICATE_PREVENTED'				=> '<strong>A digests was NOT sent to %1$s (%2$s) for date %3$s and hour %4$02d UTC because one was sent to this subscriber earlier this hour.</strong>',
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: Digests sending identical digests to members every hour

by sbloomer » Tue Jul 23, 2019 3:06 pm

MarkDHamill wrote:Make sure you don't have a real cron job using curl or something too
It's a shared host but there is nothing in the cPanel cron that I can see. I have never configured a cron for the 10 years the board has been running
I assume you did not update the version of the extension and that's when the problem was introduced. It is possible that the username is not distinct in the phpbb_users tables?
I did have a problem that seemed to look the same in April. I was on 3.2.12 at the time. I then upgraded to 14 and ran the manual SQL. This seemed to be Ok for a while.

No duplicates. I have just checked.
This code should prevent duplicate digests from going out. But I am wondering if your maintenance log has any log entries where this condition is recorded. The string to look for is:

Code: Select all

	'LOG_CONFIG_DIGESTS_DUPLICATE_PREVENTED'				=> '<strong>A digests was NOT sent to %1$s (%2$s) for date %3$s and hour %4$02d UTC because one was sent to this subscriber earlier this hour.</strong>',
No, nothing like that.

Shall I add that piece of code you referred to?
sbloomer
Registered User
Posts: 87
Joined: Fri Jun 12, 2009 8:18 pm

Re: Digests sending identical digests to members every hour

by MarkDHamill » Tue Jul 23, 2019 4:50 pm

That line of code is already in the extension.

When a digest is sent out, the time is recorded in phpbb_users.user_digest_last_sent. Try adding this code before line 567 in /cron/task/digests.php:

Code: Select all

				// Skip sending digests for this user if it's been less than an hour since the last one was sent.
				if (((int) $row['user_digest_last_sent']) + 3600 > $now)
				{
					continue;
				}

and let me know the results.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA