Problem/Motivation

Enabling Webform on a site that has webform tables, but the module disabled throws the following error:
Table 'webform' already exists.

Attempting to then enable a custom module that contains basic Webform config in config/install results in the following:

In Connection.php line 896:
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'webform_id' in 'fie
  ld list': INSERT INTO {webform} ("webform_id", "next_serial") VALUES (:db_i
  nsert_placeholder_0, :db_insert_placeholder_1); Array
  (
      [:db_insert_placeholder_0] => form_machine_name
      [:db_insert_placeholder_1] => 1
  )

In StatementWrapper.php line 116:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'webform_id' in 'fie
  ld list'

Steps to reproduce

  1. Webform must be disabled
  2. webform table exists in database
  3. run `drush pm:enable webform`

Drupal version 9.1.9
Updating Webform to 6.0.3 did not solve this issue.

Going into the database and manually deleting all Webform related tables resolves this issue. Webform installs fine and the custom module can be enabled and creates the custom form from config without issue.

Comments

jpieper created an issue. See original summary.

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)

It sounds like the webform module was not fully uninstalled. I am not sure who we can address this, because it is not a reproducible issue.

Does the custom module include webform as a dependency?

jpieper’s picture

Status: Postponed (maintainer needs more info) » Active

Yep, the custom module includes Webform as a dependency.

As long as I've worked with this site I don't believe Webform has ever been used or installed but I'm seeing these tables on prod as well.

I did some more investigating in the related tables and the data in the webform_submissions table is timestamped between 6 and 8 years ago and nothing since.

I think I'll manually clean these up and go from there.

jrockowitz’s picture

Was the website migrated from Drupal 6/7?

jrockowitz’s picture

jrockowitz’s picture

Status: Active » Closed (cannot reproduce)