drush pm-uninstall redirect
The following extensions will be uninstalled: redirect
Do you really want to continue? (y/n): y
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base_table.revision_id' in 'field list' in /htdocs/core/lib/Drupal/Core/Database/Statement.php:59                                             [error]
Stack trace:
#0 /htdocs/core/lib/Drupal/Core/Database/Statement.php(59): PDOStatement->execute(Array)
#1 /htdocs/core/lib/Drupal/Core/Database/Connection.php(610): Drupal\Core\Database\Statement->execute(Array, Array)
#2 /htdocs/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php(81): Drupal\Core\Database\Connection->query('SELECT base_tab...', Array, Array)
#3 /htdocs/core/lib/Drupal/Core/Database/Query/Select.php(508): Drupal\Core\Database\Driver\mysql\Connection->query('SELECT base_tab...', Array, Array)
#4 /htdocs/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(250): Drupal\Core\Database\Query\Select->execute()
#5 /htdocs/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(77): Drupal\Core\Entity\Query\Sql\Query->result()
#6 /htdocs/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(72): Drupal\Core\Entity\Query\Sql\Query->execute()
#7 /htdocs/core/lib/Drupal/Core/Entity/ContentUninstallValidator.php(43): Drupal\Core\Entity\ContentEntityStorageBase->hasData()
#8 /htdocs/core/lib/Drupal/Core/Extension/ModuleInstaller.php(554): Drupal\Core\Entity\ContentUninstallValidator->validate('redirect')
#9 /htdocs/core/lib/Drupal/Core/Extension/ModuleInstaller.php(350): Drupal\Core\Extension\ModuleInstaller->validateUninstall(Array)
#10 /htdocs/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(91): Drupal\Core\Extension\ModuleInstaller->uninstall(Array, true)
#11 /vendor/drush/drush/commands/core/drupal/environment.inc(227): Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall(Array)
#12 /vendor/drush/drush/commands/core/drupal/pm_8.inc(82): drush_module_uninstall(Array)
#13 /vendor/drush/drush/commands/pm/pm.drush.inc(1237): _drush_pm_uninstall(Array)
#14 /vendor/drush/drush/includes/command.inc(373): drush_pm_uninstall('redirect')
#15 /vendor/drush/drush/includes/command.inc(224): _drush_invoke_hooks(Array, Array)
#16 /vendor/drush/drush/includes/command.inc(192): drush_command('redirect')
#17 /vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#18 /vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#19 /vendor/drush/drush/drush.php(12): drush_main()
#20 {main}

Comments

vijaycs85 created an issue. See original summary.

vijaycs85’s picture

Since it was my development environment and I don't really need the data, I just simply did below steps to get the module uninstalled:

1. ALTER TABLE redirect ADD COLUMN revision_id INT(11);
2. TRUNCATE TABLE redirect;
3.

 drush pm-uninstall redirect -y
The following extensions will be uninstalled: redirect
Do you really want to continue? (y/n): y
redirect was successfully uninstalled.
Berdir’s picture

Sounds like some other module is messing with entity queries, redirect does not have a revision_id and never had. There's no reason that core would add that. Are you using content_moderation, workflow or any other similar module?

Try debugging what kind of query altering is gong on.

vijaycs85’s picture

Status: Active » Closed (works as designed)

Thanks for the quick update @Berdir. I have workflow enabled. I will see if I can find the root cause.I thought it was redirection missing something.

kenorb’s picture

Status: Closed (works as designed) » Closed (duplicate)
Related issues: +#2563515: Improperly deployed *missing* entity table breaks module uninstall