Installing Tax Module Throws 1146 Error

Created on 15 June 2018, over 6 years ago
Updated 17 February 2023, almost 2 years ago

I see this has happened with others, and it is also happening on the Shipping Module. Essentially, I have been working on a Drupal Commerce store and finally enabled the tax module today. The result was a completely crashed website that required a restore. Further investigation yields people are manually creating these tables in the database, which is what I ended up doing.

But how is simply enabling a module causing so many problems?

This is the error:

[error] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'XXXXXX.commerce_store__tax_registrations' doesn't exist: SELECT t.*
FROM
{commerce_store__tax_registrations} t
WHERE (entity_id IN (:db_condition_placeholder_0)) AND (deleted = :db_condition_placeholder_1) AND (langcode IN (:db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4))
ORDER BY delta ASC; Array
(
[:db_condition_placeholder_0] => 1
[:db_condition_placeholder_1] => 0
[:db_condition_placeholder_2] => en
[:db_condition_placeholder_3] => und
[:db_condition_placeholder_4] => zxx
)

🐛 Bug report
Status

Active

Version

2.7

Component

Tax

Created by

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.

  • 🇮🇳India shashikanth171

    I have resolved the issue by creating the missing tables. I got the create query by exporting database of a new drupal 9 site with the commerce installed.

    
    --
    -- Table structure for table `commerce_store__tax_registrations`
    --
    
    DROP TABLE IF EXISTS `commerce_store__tax_registrations`;
    /*!40101 SET @saved_cs_client     = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `commerce_store__tax_registrations` (
      `bundle` varchar(128) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
      `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'A boolean indicating whether this data item has been deleted',
      `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
      `revision_id` int(10) unsigned NOT NULL COMMENT 'The entity revision id this data is attached to, which for an unversioned entity type is the same as the entity id',
      `langcode` varchar(32) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'The language code for this data item.',
      `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
      `tax_registrations_value` varchar(255) NOT NULL,
      PRIMARY KEY (`entity_id`,`deleted`,`delta`,`langcode`),
      KEY `bundle` (`bundle`),
      KEY `revision_id` (`revision_id`),
      KEY `tax_registrations_value` (`tax_registrations_value`(191))
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Data storage for commerce_store field tax_registrations.';
    /*!40101 SET character_set_client = @saved_cs_client */;
    
    
  • Status changed to Closed: cannot reproduce about 1 month ago
  • 🇩🇪Germany Anybody Porta Westfalica

    As of #2

Production build 0.71.5 2024