Problem/Motivation
Since a few updates ago (sorry, do not know which update), Status Update gives me the following error:
"Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Maestro Queue
The Token field needs to be updated."
My website seems to work as if there was no problem. However, to prevent future problems, I want to resolve this issue.
I have tried to update the enity using "drush entity-updates". This resulted in a simular message:
"The following updates are pending:
maestro_queue entity type :
The Token field needs to be updated.
Do you wish to run all pending updates? (yes/no)"
I selected "yes". This resulted in the following error message:
"In SqlContentEntityStorageSchema.php line 1843:
The SQL storage cannot change the schema for an existing field (token in maestro_queue entity) with data."
Note: in the database, for each maestro_queue entity, the value of token is NULL
Does anyone recognize this problem? Any idea how to resolve this problem?
Drupal version 10.2.0
Maestro version 3.1.0
Php 8.1.24
Web Server Apache/2
Database Version 10.4.27-MariaDB-cll-lve
Comments
Comment #2
_randy commentedGenerally you'll only get that message when there is data in the column. However, you've noted that there isn't any data.
Before you do anything, always start by taking a full backup.
Then, on a non-production development system, try setting the maestro_queue token column to blanks and re-running the update.
Warning, this will update each row in the maestro_queue table:
UPDATE maestro_queue SET token=''
Then try running the update again. But again, only do this on a non production development system.
Comment #3
basby commentedThanks _randy, for your help!
After reading your comment, I double checked the token column. It appears that they are not all empty.
Any idea on what I can do in that case?
Comment #4
_randy commentedThe task console detects if there is a queue token or not.
If no queue token exists for the task, it reverts back to the original mechanism for launching/executing tasks. Otherwise it will use a token.
I'm not sure if you've set the Maestro URL Tokens (https://www.drupal.org/docs/contributed-modules/maestro/maestro-api#s-ma...)
If you've not set the token, Maestro will fall back on the older queueIDs-in-URLs for things like the task console and task URL generation.
There are a couple places where established tasks will save/cache their URLs in the database. This is why I would do what I suggest later on in this note.
Technically, you can remove the token in the setting listed above, and the site should generate URLs with the queueID instead. This way you can work on clearing the tokens in the maestro_queue table and then running the updates.
You can also do something a bit more crafty, like
Comment #5
basby commentedThanks! I will try this tomorrow.
Comment #6
basby commentedI have done the more crafty work you suggested. The token field is now updated and the error has disappeared. Thank you, maestro _randy!
If anyone else comes across the same issue, this is what I did in detail.
CREATE TABLE maestro_queue_copy AS SELECT * FROM maestro_queuedrush entity-updatesDROP TABLE maestro_queue_copyComment #7
jsweetack commentedI have the same issue, however I'm not using 'drush entity-updates' because it doesn't exist on my system. I see you can download and enable the devel_entity_updates module for TEST environments but not production. Many warnings about how you should NOT use it in a production environment, and how "maintainers of the module should fix the entity issue." So, unsure of what to do next, and whether this is breaking anything currently.
Edit: Also to add, this happened before upgrading to 10, it happened after upgrading the Maestro module on D9. Still persists after upgrade to D10 as well.
Comment #8
basby commentedjsweetack, you can install drush following the steps in https://drupalize.me/tutorial/install-drush-using-composer.
Summary:
* Go to the root directory of your project and install drush using
composer require --dev drush/drush* Check if drush is installed correctly:
./vendor/bin/drush --versionNow you can use './vendor/bin/drush entity-updates'.
Comment #9
keshavv commentedPlease look into this comment.
https://www.drupal.org/project/address/issues/3412241#comment-15408612
Comment #10
jsweetack commented@basby - I have drush, you need to install the devel_entity_updates module for that to work on current versions of drush, and as I stated, it appears that's not the right way to go for production servers, hence why I'm not installing that module.
@keshavv - thank you, I will look into that.