Skip to content

Fix Ensure-site-install failure during User deletion

Francisco Borges Aurindo Barros requested to merge hot-fix-maybe into master

ensure-site-install is facing some temporary errors that require multiple runs.

Usual behavior was "1st run fail, 2nd run fail, 3rd run success".

Logs of the errors for the first run

[error]  Error: Class 'Drupal\image\Plugin\Field\FieldType\ImageItem' not found in Drupal\Core\Field\FieldConfigStorageBase->mapFromStorageRecords() (line 33 of /app/web/core/lib/Drupal/Core/Field/FieldConfigStorageBase.php) #0 /app/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(193): Drupal\Core\Field\FieldConfigStorageBase->mapFromStorageRecords(Array, Array)
#1 /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(300): Drupal\Core\Config\Entity\ConfigEntityStorage->doLoadMultiple(Array)
#2 /app/web/core/lib/Drupal/Core/Entity/EntityBase.php(554): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
#3 /app/web/core/modules/field/field.module(204): Drupal\Core\Entity\EntityBase::loadMultiple(Array)
#4 [internal function]: field_entity_bundle_field_info(Object(Drupal\Core\Entity\ContentEntityType), 'user', Array)
#5 /app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(392): call_user_func_array('field_entity_bu...', Array)
(...)
Error: Class 'Drupal\image\Plugin\Field\FieldType\ImageItem' not found in Drupal\Core\Field\FieldConfigStorageBase->mapFromStorageRecords() (line 33 of /app/web/core/lib/Drupal/Core/Field/FieldConfigStorageBase.php).
 [warning] Drush command terminated abnormally.

Logs of the errors for the second run:

In EntityTypeManager.php line 150:
                                                               
  [Drupal\Component\Plugin\Exception\PluginNotFoundException]  
  The "view" entity type does not exist.                       
                                                               

Exception trace:
  at /app/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php:150
 Drupal\Core\Entity\EntityTypeManager->getDefinition() at /app/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php:269
 Drupal\Core\Entity\EntityTypeManager->getHandler() at /app/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php:208
 Drupal\Core\Entity\EntityTypeManager->getStorage() at /app/web/core/modules/views/src/EventSubscriber/RouteSubscriber.php:63
 Drupal\views\EventSubscriber\RouteSubscriber->__construct() at n/a:n/a
 ReflectionClass->newInstanceArgs() at /app/vendor/symfony/dependency-injection/ContainerBuilder.php:1176
 Symfony\Component\DependencyInjection\ContainerBuilder->createService() at /app/vendor/symfony/dependency-injection/ContainerBuilder.php:634
(...)
 Drush\Runtime\Runtime->run() at /app/vendor/drush/drush/drush.php:72
 require() at /app/vendor/drush/drush/drush:4

As seen on the first error, the command that makes the job fail is drush user-cancel admin -y, meaning it can be cache related. As such I've added drush cr two avoid caching issues to create this failure.

Has been tested locally and validated that if fixes the first error.

Second error (And third ommited where on other runs instead of view missing, was search or users) seems to have been around, and since the job self-recovers whenever these case happens, we will ignore for now.

Edited by Francisco Borges Aurindo Barros

Merge request reports