Not able to uninstall

Created on 23 August 2023, 10 months ago
Updated 5 September 2023, 10 months ago

Problem/Motivation

When attempting to uninstall the Ckeditor 5 Realtime Collaboration module it apparently is searching for a table by the name of ckeditor5_channel, which does not exist.

As a result of the error the module remains installed.

In ExceptionHandler.php line 46:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal9_dev.cked
  itor5_channel' doesn't exist: SELECT "base_table"."id" AS "id", "base_table
  "."id" AS "base_table_id"
  FROM
  "ckeditor5_channel" "base_table"
  LIMIT 1 OFFSET 0; Array
  (
  )
In StatementWrapperIterator.php line 110:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal9_dev.cked
  itor5_channel' doesn't exist

Steps to reproduce

1. Install module
2. Uninstall module

Proposed resolution

Add code to create table on installation

πŸ› Bug report
Status

Active

Version

1.2

Component

Installation issues

Created by

πŸ‡ΊπŸ‡ΈUnited States bajah1701

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

Comments & Activities

  • Issue created by @bajah1701
  • πŸ‡ΊπŸ‡ΈUnited States bajah1701
  • πŸ‡ΊπŸ‡ΈUnited States bajah1701
  • πŸ‡΅πŸ‡±Poland salmonek

    Hi @bajah1701
    Sorry for long response on your error.
    There is a "Channel" entity definition within our module, so Drupal handles database table creation and deletion automatically.
    During module development we switch between RTC and Non-RTC quite often which requires uninstallation of currently used collaboration module, and we never had such problem before.

    I would like to reproduce this issue and would need some information:

    1. Did the SQL error appear on a first attempt of uninstallation? Most reasonable explanation for me would be that on first attempt something went wrong after entity was deleted from system and then on subsequent attempts lack of table is an issue.
    2. Which core version was used?
    3. How was unistallation attempt done - via UI or using Drush?

    Do you need help with some quick workaround solution to uninstall the module right now?

  • πŸ‡ΊπŸ‡ΈUnited States bajah1701

    Hi @salmonek,

    1. Yes the error did appear on my first attempt to uninstall the module. The error also shows up when navigating to the edit page of a page that uses the template feature (I only tested this). Hence, there is no way to edit that page. I also experience that error on the page that allows you to add the different ckeditor features, it occurred upon saving that page. However, it only happen on my first attempt, once I narrowed down the number of features the error went away.

    2. I tested it on Drupal Core 10.1.2

    3. I tried to uninstall via both methods and got the same error.

    Because we can't go back to the edit page of the node, to test more templates this is a bit of a setback, so a quick workaround would be appreciated.

  • πŸ‡΅πŸ‡±Poland salmonek

    I found a core issue related to the error thrown when entity table doesn't already exist: https://www.drupal.org/project/drupal/issues/2563515 πŸ› Improperly deployed *missing* entity table breaks module uninstall Needs work
    I've tested https://www.drupal.org/files/issues/2023-01-16/2563515-57.patch β†’ patch on Drupal 10.1.2 - it successfully applies and allows to uninstall module.
    I wasn't actually able to reproduce your issue with regular module uninstall, however when manually removed the table I got same error and was able to uninstall with patch installed.

    I've also verified that using Entity API doesn't require hook_install() nor hook_uninstall()
    Entity API database operations are handled in Drupal\Core\Extension\ModuleInstaller class

  • πŸ‡΅πŸ‡±Poland salmonek

    I have another question to clarify your situation.
    Did errors on other mentioned pages appeared just after module was installed and you didn't actually had a working realtime collaboration at any time? In such case - are you able to locate a "ckeditor5_premium_features_realtime_collaboration module installed." message in a watchdog log and check if there is any message that might be related to the installation process that precedes installation notification?

  • πŸ‡ΊπŸ‡ΈUnited States bajah1701

    I was able to successfully uninstall the module after applying the patch.

    In response to the question, Yes! Real Time Collaboration was enabled but not yet configured. Unfortunately we couldn't find any errors with that message in watchdog.

Production build 0.69.0 2024