Uninstall after crashed install throws "No such table" with no way out; it should be graceful

Created on 19 January 2023, almost 2 years ago

Problem/Motivation

This is a quite rare thing, but if it happens, it leaves the system in a state where there's no way out without uber-technical intervention.

In this case, a webform installation threw (sth unrelated), und any attempt to uninstall webform again, threw too, because a content table is missing, that the uninstall validator checks.

Trace:

In Statement.php line 82:
                                                                       
  [PDOException (HY000)]                                               
  SQLSTATE[HY000]: General error: 1 no such table: webform_submission  
                                                                       

Exception trace:
  at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/modules/sqlite/src/Driver/Database/sqlite/Statement.php:82
 PDO->prepare() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/modules/sqlite/src/Driver/Database/sqlite/Statement.php:82
 Drupal\sqlite\Driver\Database\sqlite\Statement->getStatement() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/lib/Drupal/Core/Database/StatementPrefetch.php:181
 Drupal\Core\Database\StatementPrefetch->execute() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/modules/sqlite/src/Driver/Database/sqlite/Statement.php:90
 Drupal\sqlite\Driver\Database\sqlite\Statement->execute() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/lib/Drupal/Core/Database/Connection.php:763
 Drupal\Core\Database\Connection->query() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/lib/Drupal/Core/Database/Query/Select.php:525
 Drupal\Core\Database\Query\Select->execute() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php:271
 Drupal\Core\Entity\Query\Sql\Query->result() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php:84
 Drupal\Core\Entity\Query\Sql\Query->execute() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:617
 Drupal\Core\Entity\EntityStorageBase->hasData() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/lib/Drupal/Core/Entity/ContentUninstallValidator.php:43
 Drupal\Core\Entity\ContentUninstallValidator->validate() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php:616
 Drupal\Core\Extension\ModuleInstaller->validateUninstall() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php:99
 Drupal\Core\ProxyClass\Extension\ModuleInstaller->validateUninstall() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php:208
 Drush\Drupal\Commands\pm\PmCommands->validateUninstall() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:53
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->doValidator() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:42
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->callValidator() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:29
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->validate() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/consolidation/annotated-command/src/CommandProcessor.php:195
 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
 Consolidation\AnnotatedCommand\CommandProcessor->process() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:390
 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/symfony/console/Command/Command.php:312
 Symfony\Component\Console\Command\Command->run() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/symfony/console/Application.php:314
 Symfony\Component\Console\Application->doRun() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/symfony/console/Application.php:168
 Symfony\Component\Console\Application->run() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/drush/drush/src/Runtime/Runtime.php:124
 Drush\Runtime\Runtime->doRun() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/drush/drush/src/Runtime/Runtime.php:51
 Drush\Runtime\Runtime->run() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/drush/drush/drush.php:77
 require() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/drush/drush/drush:4
 include() at /home/merlin/Code-Incubator/bbnd/site-untrack-email/vendor/bin/drush:120


Steps to reproduce

- "Half-install" a module
- Try to un-install it

Proposed resolution

Catch all database exceptions for the tables that are to be deleted anyway.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.1

Component
Extension 

Last updated about 20 hours ago

No maintainer
Created by

🇩🇪Germany geek-merlin Freiburg, Germany

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024