Mismatched entity and/or field definitions for Payment Gateway and Method

Created on 31 March 2023, over 1 year ago
Updated 7 April 2023, over 1 year ago

I installed Commerce 8.x.2.35 on my Drupal 10 site locally and configured everything how I wanted it and got everything working perfectly. I exported my config and added it to my repo. When I pushed my code and our dev server imported the config, everything seemed to be working ok except that sometimes I would get random white screens. The error logs had this:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'globalchangedev.commerce_payment' doesn't exist: SELECT "base_table"."payment_id" AS "payment_id", "base_table"."payment_id" AS "base_table_payment_id" FROM "commerce_payment" "base_table" INNER JOIN "commerce_payment" "commerce_payment" ON "commerce_payment"."payment_id" = "base_table"."payment_id" WHERE "commerce_payment"."type" LIKE :db_condition_placeholder_0 ESCAPE '\\' LIMIT 1 OFFSET 0; Array ( [:db_condition_placeholder_0] => payment\_default ) in Drupal\Core\Entity\Query\Sql\Query->result() (line 271 of /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

I looked at our status report page and also saw this:

Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Order
  The Payment gateway field needs to be installed.
  The Payment method field needs to be installed.
Payment
  The Payment entity type needs to be installed.
Payment gateway
  The Payment gateway entity type needs to be installed.
Payment method
  The Payment method entity type needs to be installed.

I tried reimporting config, clearing cache, running cron and doing database updates and nothing seems to make the mismatched entity error message go away. Not sure if this matters, but we are not using a payment gateway at all. We are actually using Commerce to offer free items that will be shipped to the user so everything is $0.00 and no payment is required. I'm not sure if that is what is causing this. That being said I do not get those errors locally. It was only on the dev server which imported config.

🐛 Bug report
Status

Closed: cannot reproduce

Version

2.35

Component

Payment

Created by

🇺🇸United States socalerich

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

Comments & Activities

  • Issue created by @socalerich
  • Status changed to Closed: cannot reproduce over 1 year ago
  • 🇮🇱Israel jsacksick

    How did you end up with missing tables? Looks like your installation is broken? Unfortunately there is not a lot we can do in this case. What you could do is reinstalling a clean site somewhere else and import the missing tables.

  • 🇺🇸United States socalerich

    Yeah after looking at this, I THINK this was the result of a failed dev deployment. I ended up just moving my known working local database up to dev and all was well. This is a new site with only a dev server at this point so it wasn't that big of a deal. Still don't know for sure what caused it but it's fine now. THANKS

Production build 0.71.5 2024