phpbb cron job keeps sending notification emails

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

phpbb cron job keeps sending notification emails

Post by Erpenator »

I am using phpbb 3.3.0 and I am running into a problem where some users report that they are keep getting the same notification messages sent by the forum via the /bin/phpbbcli.php cron:run cronjob. To debug the issue I tried to send a CC of every email being sent by the forum to our development address so we could monitor the issue.

I can resolve the issue temporarily by deleting the /cache/production/ folder or more specifically to remove queue.php and queue.php.lock until it happens again. These two files can't be deleted via the default 'clear cache' function that the forum provides in the admin or via the terminal /ssh with normal "www-data" (apache) user rights. But once the files are removed everything works normal again.

Some things I don't understand and I hope someone can help me with:
  • Despite I added myself as a CC for every email that the forum sends out I am not experiencing the same issue, even for the specific messages that people say they get every x minutes send by the cronjob. I am only getting the the notification message once. Any idea why?
  • Is queue.php.lock part of / created by phpbb? If not this could mean another server process is causing issues which prevents phpbb from updating the que?
  • Should the queue.php file be removed when you use the clear cache option in the admin?
User avatar
janus_zonstraal
Registered User
Posts: 4854
Joined: Sat Aug 30, 2014 1:30 pm

Re: phpbb cron job keeps sending notification emails

Post by janus_zonstraal »

I can resolve the issue temporarily by deleting the /cache/production/ folder or more specifically to remove queue.php and queue.php.lock until it happens again.
If you delete the queue files nobody gets a notification, so that is not the way to do it.

Are you 100% sure that the members get the same mail twice?
Sorry! My English is bat ;) !!!
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Re: phpbb cron job keeps sending notification emails

Post by Erpenator »

janus_zonstraal wrote:
Thu Feb 13, 2020 11:52 am
If you delete the queue files nobody gets a notification, so that is not the way to do it.
I understand, but it's the only way to let the forum/cronjob stop sending emails.
janus_zonstraal wrote:
Thu Feb 13, 2020 11:52 am
Are you 100% sure that the members get the same mail twice?
The users mail me in absolute despair to please stop sending the notifications, but that is the only reference I have (and enough for me to believe something is wrong). That's why I added my email to the CC of every email that the forum sends out to be able to double check if the problem did not return. The weird thing is that it worked well for quite a few days. That's why I think something is happening on the server level.

I have been in contact with one of the users getting all the mails and deleting the queue.php files was the only way to stop the mails. At the moment I am not able to send any notifications at all, but I don't want to spam some of my users every 5 minutes.
User avatar
janus_zonstraal
Registered User
Posts: 4854
Joined: Sat Aug 30, 2014 1:30 pm

Re: phpbb cron job keeps sending notification emails

Post by janus_zonstraal »

If the don't want mails the can switch it of in there UCP, assuming that is working?
Sorry! My English is bat ;) !!!
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Re: phpbb cron job keeps sending notification emails

Post by Erpenator »

janus_zonstraal wrote:
Thu Feb 13, 2020 12:19 pm
If the don't want mails the can switch it of in there UCP, assuming that is working?
Yes, but it would only work afterwards. If they enabled to get the emails for specific topics / or notifications and this bug pops up they have no way of stopping the emails. One user even tried to change the email address in their profile when it received an email every 5 minutes and even while the email was updated in our database the forum was still sending emails to the "old" email address and didn't take the new email address into account.
User avatar
janus_zonstraal
Registered User
Posts: 4854
Joined: Sat Aug 30, 2014 1:30 pm

Re: phpbb cron job keeps sending notification emails

Post by janus_zonstraal »

Did you try to open the queue.php file with notepad or similar program and look into the mails?
Sorry! My English is bat ;) !!!
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Re: phpbb cron job keeps sending notification emails

Post by Erpenator »

The queue.php.lock is empty and the queue.php shows the data / messages to be send. But at the moment I can't find the email address or username of the latest person who notified me about the issue. But the queue file is obviously constantly updated so maybe the data is already gone? That the file is updated is also visible at the latest timestamp. I am pretty sure that if I enable the cron this user will get the emails again, at least the last time I did that the user kept receiving emails. But no idea why or where the info is coming from or even how to debug it?
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Re: phpbb cron job keeps sending notification emails

Post by Erpenator »

I stopped the /bin/phpbbcli.php for about a week and then enabled it again. Now a different user is getting all the emails but it stopped sending emails to the first one. Nothing else has changed.

I would still appreciate some help about my initial questions how the system should work. This to help the debugging.
User avatar
EA117
Registered User
Posts: 1817
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: phpbb cron job keeps sending notification emails

Post by EA117 »

Sounds like something you might have already checked for, but if runs of the cron kept trying to send the same messages again, one suspicion I would have is that the cron is actually crashing / hitting a PHP execution error. Such that the "this queued notification has been processed" is never removed / updated from the list, and is ready to notify again when the cron runs again.

Doesn't explain why you wouldn't get the same duplicates on your CC, though. But I would at least be checking the PHP error log (where ever that is -- stand alone file, or in the web server error log, or in the system log) to see if there were any warnings or outright failures being logged when this happens.
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Re: phpbb cron job keeps sending notification emails

Post by Erpenator »

I hadn't checked the error logs yet. So thank you for reminding me. After a close look at the error logs and I can't find anything related to /bin/phpbbcli.php . I've also started to run the cron job from the command line to see if it shows any error but it didn't.

I did notice that in the queue.php file some messages had the same private message id while the message was sent to different users :
https://www.aroundtheglobe.nl/messagebo ... ew&p=33516 So this url for example was used 4 times in emails to 4 different users (all coming from the same sender).

You did get me thinking with your comment about the process never removed / updated. So I ran the /bin/phpbbcli.php once, downloaded queue.php ran /bin/phpbbcli.php again and also downloaded the queue.php. When I compared the files they are exactly the same. The date stamp of the file queue.php does change when I run /bin/phpbbcli.php. So that rules out permission issues.

I will now try to disable all caching on the forum and see if that is the issue.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 22835
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket probably.

Re: phpbb cron job keeps sending notification emails

Post by Mick »

janus_zonstraal wrote:
Thu Feb 13, 2020 12:45 pm
notepad
Presumably you meant Notepad++?
"The more connected we get the more alone we become" - Kyle Broflovski©
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Re: phpbb cron job keeps sending notification emails

Post by Erpenator »

Mick wrote:
Tue Feb 25, 2020 7:59 am
janus_zonstraal wrote:
Thu Feb 13, 2020 12:45 pm
notepad
Presumably you meant Notepad++?
Or notepad on Windows ;) .
User avatar
Mick
Support Team Member
Support Team Member
Posts: 22835
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket probably.

Re: phpbb cron job keeps sending notification emails

Post by Mick »

Notepad is a killer of code.
"The more connected we get the more alone we become" - Kyle Broflovski©
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Re: phpbb cron job keeps sending notification emails

Post by Erpenator »

Mick wrote:
Tue Feb 25, 2020 9:18 am
Notepad is a killer of code.
I know, I am not using it. I am using phpStorm for editing the files.
Erpenator
Registered User
Posts: 40
Joined: Tue Nov 03, 2009 6:45 pm

Re: phpbb cron job keeps sending notification emails

Post by Erpenator »

An update with some new findings. I've disabled the Redis full page caching that our server provides. This seems to have helped since the problem didn't come back for over a week. The full page caching is only for people who are not logged in and seems to provide a huge speed gain (90 ms vs 630ms) that can't be ignored.

The question that remains is which urls / pages / processes should not be cached to prevent the forum to keep sending those notification emails? I thought I already was caching only the topic and forum pages.
Post Reply

Return to “[3.3.x] Support Forum”