base table not found: Table 'drupal.commerce_payment_method__card_type' doesn't exist

Created on 12 October 2021, over 3 years ago
Updated 10 February 2025, 13 days ago

Problem/Motivation

Version: 8.x-2.27

I've uninstalled all payments.
I've uninstalled all payment methods.
I've uninstalled Commerce Paypal.
I've uninstalled Commerce Authorize.Net.

When trying to uninstall Commerce Payment, I received the following:

The website encountered an unexpected error. Please try again later.

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.commerce_payment_method__card_type' doesn't exist: UPDATE {commerce_payment_method__card_type} SET deleted=:db_update_placeholder_0 WHERE bundle = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => 1 [:db_condition_placeholder_0] => credit_card ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->onFieldDefinitionDelete() (line 1636 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Database\Statement->execute() (Line: 640)
Drupal\Core\Database\Connection->query() (Line: 357)
Drupal\Core\Database\Driver\mysql\Connection->query() (Line: 148)
Drupal\Core\Database\Query\Update->execute() (Line: 1636)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->onFieldDefinitionDelete() (Line: 122)
Drupal\Core\Field\FieldDefinitionListener->onFieldDefinitionDelete() (Line: 99)
Drupal\entity\BundlePlugin\BundlePluginInstaller->uninstallBundles() (Line: 140)
entity_module_preuninstall()
call_user_func_array() (Line: 403)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 429)
Drupal\Core\Extension\ModuleInstaller->uninstall() (Line: 91)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall() (Line: 183)
Drupal\system\Form\ModulesUninstallConfirmForm->submitForm()
call_user_func_array() (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 593)
Drupal\Core\Form\FormBuilder->processForm() (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 91)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 57)
Drupal\Core\StackMiddleware\Session->handle() (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 708)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rsnyd

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.

  • πŸ‡¦πŸ‡ΊAustralia jjwfcd

    never install paypal but also get this issue
    has no way to uninstall commerce

  • πŸ‡¦πŸ‡ΊAustralia jjwfcd

    In ExceptionHandler.php line 56:

    SQLSTATE[42S02]: Base table or view not found: 1146 Table 'commerce_payment_method__card_type' doesn't exist: UPDATE "commerc
    e_payment_method__card_type" SET "deleted"=:db_update_placeholder_0
    WHERE "bundle" = :db_condition_placeholder_0; Array
    (
    [:db_update_placeholder_0] => 1
    [:db_condition_placeholder_0] => credit_card
    )

    In StatementWrapperIterator.php line 113:

    SQLSTATE[42S02]: Base table or view not found: 1146 Table 'commerce_payment_method__card_type' doesn't exist

Production build 0.71.5 2024