"Call to a member function setProcessor() on null" when running drush updb

Created on 28 July 2023, over 1 year ago
Updated 5 September 2023, over 1 year ago

Problem/Motivation

When I run "drush updb" I get this error:

Call to a member function setProcessor() on null in /var/www/myproject.local/releases/local/docroot/modules/contrib/vgwort/vgwort.post_update.php on line 61 #0 /var/www/myproject.local/releases/local/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(288): vgwort_post_update_daemon_queue(Array)

It appears that there is no 'advancedqueue_queue' instance named 'vgwort'.

Proposed resolution

The fix, at least for me, was to ensure that the 'advancedqueue_queue' was in place when running vgwort_post_update_daemon_queue()

All I did here was copy the code from vgwort_post_update_create_queue()

 function vgwort_post_update_daemon_queue() {
+  $queue = Queue::load('vgwort');
+  if (!$queue instanceof Queue) {
+    // Read the file from the module's config.
+    $config = (new FileStorage(\Drupal::service('extension.list.module')->getPath('vgwort') . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY))->read('advancedqueue.advancedqueue_queue.vgwort');
+    $queue = Queue::create($config);
+    $queue->save();
+  }
+  $config = \Drupal::service('config.factory')->getEditable('vgwort.settings');
+  $config->set('queue_retry_time', 86400)->save();
   Queue::load('vgwort')->setProcessor('daemon')->save();
 }
πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany michaellenahan

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

Comments & Activities

Production build 0.71.5 2024