Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.I am testing out upgrading devshop to the next release, which switches over to hosting_git for git URL and git_ref storage.
I am unable to run hostmaster-migrate because updb fails, because the code that loads the nodes for projects and environments looks for the hosting_git table. The nodes are being loaded after the update list is displayed, but before the updates take place.
Luckily I had xdebug installed and I could trace it back to this:
/**
* @file
* Drush include for the Hosting module.
*/
define('HOSTING_QUEUE_DEFAULT_LOCK_WAIT', 30);
define('HOSTING_QUEUE_LOCK_TIMEOUT', 3600.0);
/**
* Implements hook_drush_command().
*/
function hosting_drush_command() {
$items['hosting-dispatch'] = array(
'description' => dt('Centralized command for dispatching the various queue processors (hosting, cron, backup etc.)'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
'options' => array(
'lock-wait' => dt('Time to wait to acquire a lock on dispatched queues. Defaults to @wait seconds.', array('@wait' => HOSTING_QUEUE_DEFAULT_LOCK_WAIT)),
'force' => dt('Continue even if the task queue is still locked.'),
),
);
$items['hosting-setup'] = array(
'description' => dt('Set up initial configuration settings such as the cron entry for the queue dispatcher and more.'),
);
// If we're trying to get help, then try to bootstrap as much as possible.
$current_command = drush_get_command();
if (isset($current_command['command']) && ($current_command['command'] == 'help')) {
drush_bootstrap_max();
}
// If we've not bootstrapped fully, then this function may not be around.
if (function_exists('hosting_get_queues')) {
$queues = hosting_get_queues();
...
As you can see at the end, hosting_get_queues() is called, which does a few things.
This is done inside the function hosting_drush_command() which is for hook_drush_command(), which is for defining what commands are available.
This is so we can dynamically create drush commands based on the hosting queue meta data:
drush hosting-$queue
drush hosting-tasks
drush hosting-cron
The problem is that hook_hosting_queues() implementations use dynamic lookups for the "total_items" property, when this hook should be metadata only.
So, on hostmaster-migrate, the new platform is verified, and it attempts the update_db, then immediately fails when it tries to lookup the nodes with the table that doesn't exist yet.
I can read from the stack trace, that drush_core_updatedb() eventually calls drush_get_commands() which calls hosting_drush_command() which calls hosting_get_queues() which calls my devshop queue which tries to load nodes using hosting_git, which doesn't exist until the database updates occur.
:O
I would rather not check for hosting_git before doing my hook_entity_load() code, but I guess I might not have a choice!










Comments
Comment #2
Jon PughComment #3
Jon PughComment #4
Jon PughComment #5
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedCan't we exit early from hosting_drush_command() in this condition?
I assume that we have no need for these queue commands during the hosting-migrate execution... The trick will be to find the best indicator.
Comment #6
Jon PughThis is rearing it's ugly head again: the files_public_path field is being added in the patch over at #3016995: Make file directories first class context properties.
See https://travis-ci.org/opendevshop/devmaster/jobs/596765778#L5011