same notifications being sent every time cron runs
| Project: | Notifications |
| Version: | 6.x-2.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
I recently upgraded a client website, migrating MySQL from running on the same server as Apache to running on a dedicated server. After this migration, users of the website have started receiving the same notifications over and over every time cron runs. Mails are still being sent from the same server as they were before the migration, the only difference is that now Drupal is talking to a remote database server. Everything else seems to work correctly.
As far as I understand it so far, notifications_process_queue() is being called from notifications_process_run() which is getting called by notifications_cron(), and it is sending out the notification emails without problem. However, notifications_queue_done($batch); is not getting called and so the next time cron runs the same batch is processed again. This suggests that if ($processed && !$test && !$update) is evaluating to FALSE.
My above statement may be incorrect, however, as each time cron runs I do see the number of notifications in the queue decreasing. Regardless, the same notifications are sent to the same users repeatedly each time cron runs.
I'm looking for any tips on how to best debug this? Due to the steadily growing number of repeat notifications being sent out we have had to temporarily disable notifications completely, making debugging even more difficult.

#1
I should add, we are using the following notifications modules:
We're also using the 6.x-2.1 Messaging modules.
#2
Updating title. Old title may not have been correct.
#3
In addition to the same notifications being sent repeatedly each time cron runs (though only for a few hours per notification), the same notification is also being sent multiple times during each cron run. So the same notification will be sent 8-15 times for 1-3 hours each time cron runs. Any hints or suggestions as to what may be causing this simply from migrating the database server would be greatly appreciated.
#4
I have the same problem, some users get duplicate messages
SELECT COUNT( * ) , body, uid, FROM_UNIXTIME( sent )
FROM messaging_store
GROUP BY body
HAVING count( * ) >1
Gives me several duplicate messages to a user.
Same setup as Jeremy (remote db, same versions)
#5
subscribe. Just updating from Notifications 1.x.
#6
I believe I have finally tracked this down, in our case. Calls to update the 'variables' cache in the variable table were failing as the max_allowed_packet on the new server was set to a default of 1M. We have increased this variable on the MySQL server, though a cleanup of unnecessary variables is also in order.
#7
ahh interesting. another funny Drupal quirk. Thanks for sharing.
#8
I'm just posting confirmation now that there's been more testing that increasing max_allowed_packet on the remote MySQL server did indeed solve this issue.
For example, to increase to 32M you can add the following to my.cnf:
max_allowed_packet = 32MAnd to make the change on the running server without restarting MySQL you can use the following command:
mysql> SET GLOBAL max_allowed_packet=33554432;#9
Hi Jeremy,
Thanks for sharing.
I think this is a very interesting issue, extremely difficult to track down and may be affecting other sites too, so it would be great if you could post a summary of this to the Drupal core issue tracker as a generic task, like 'Keep the variables table clean/small'
#10
Automatically closed -- issue fixed for 2 weeks with no activity.