google_analytics_counter_update_9002 causing updb failure

Created on 9 October 2023, about 1 year ago
Updated 12 October 2023, about 1 year ago

on D10.1 with module version 4.0.2, on drush updb, I get the following:

[notice] Update started: google_analytics_counter_update_9002
[error]  SQLSTATE[70100]: <<Unknown error>>: 1317 Query execution was interrupted: DELETE FROM "queue"
WHERE "name" = :db_condition_placeholder_0; Array
(
[:db_condition_placeholder_0] => google_analytics_counter_worker
)
[error]  Update failed: google_analytics_counter_update_9002
[error]  Update aborted by: google_analytics_counter_update_9002

I have this patch applied: https://git.drupalcode.org/project/google_analytics_counter/-/merge_requ...

but I got the same error without any patch.

This error blocks successful completion of the updb. I have been able to work around it by uninstalling the module via drush, running updb, then reinstalling the module.

πŸ› Bug report
Status

Closed: won't fix

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bhogue
  • Status changed to Postponed: needs info about 1 year ago
  • πŸ‡ΈπŸ‡°Slovakia kaszarobert

    Could you provide more info about how you reproduced this? Is this from a recent install or upgrade from older release?
    This update hook empties the queue, and that's all. It was needed because older versions by previous module maintainers did not complete proper queue management code and during cron runs it always appended all the nodes to the queue resulting thousands and thousands duplicate queue items on large sites. If I had to guess, you had a ginormous queue and it could not be emptied in one query and that timed out. If you still have the problematic database, could you please try how many queue items you have with this query select count(*) FROM queue WHERE name = 'google_analytics_counter_worker'; to ensure this is the root of your problem.

  • @kascarobert This is an upgrade from `4.0.0-alpha2` to `4.0` that was happening at the same time as many other module updates as directed by the Upgrade Status module in order to prepare for and get to D10.

    I believe that you are right that I had a "ginormous" queue because I remember at one point seeing that the config page was reporting a queue of something in the millions, although there was no feedback about the error or a possible timeout from drush. Once I completed my workaround, the module was reporting the queue was at 0.

  • Status changed to Closed: won't fix about 1 year ago
  • πŸ‡ΈπŸ‡°Slovakia kaszarobert

    By reading that I think we met an edge case where at least parts of the Drupal Queue API could not work anymore if there are that much items in the queue. The solution could be emptying the queue in multiple steps like DELETE FROM queue WHERE name = 'google_analytics_counter_worker' LIMIT 200000 until there are no more items.
    But if someone is using the following things for example, then we break the module for them if we're managing queue directly with SQL queries:
    - https://www.drupal.org/project/rabbitmq β†’
    - or https://www.drupal.org/project/mongodb β†’ ,
    - or maybe even https://www.drupal.org/project/redis β†’ if Redis is configured as a persistent storage
    - or something else that is replacing the Drupal's SQL database queue service to an external server integration somehow,
    I'm not sure if anyone who is using this module has that kind of a setup but I think we should continue using Drupal Queue API as it is right now.

Production build 0.71.5 2024