First problem:

[Fri Aug 26 02:57:34.233211 2016] [:error] [pid 15379] [client ~:51805] Uncaught PHP Exception Drupal\\Core\\Entity\\EntityStorageException: "Exception thrown while performing a schema update. Cannot rename commerce_payment_method__paypal_mail to field_deleted_data_a143de618a: table field_deleted_data_a143de618a already exists." at ~/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php line 1470, referer: http://example.com/admin/modules/uninstall/confirm
Probably affect by the user manually attempting to create the table. But needs investigation anyway.

Second problem:
commerce_remote_id field on users blocks uninstall

Comments

1kenthomas created an issue. See original summary.

1kenthomas’s picture

Title: Difficulties uninstalling / reinstalling » Paypal mail fields appear to block uninstall / reinstall
Issue summary: View changes
bojanz’s picture

Title: Paypal mail fields appear to block uninstall / reinstall » Unable to uninstall
Issue summary: View changes

Let's track both uninstall issues here. Marked #2790413: commerce_remote_id field on users blocks uninstall as a duplicate.

We have an Uninstall test that is passing, it's obviously missing something.

1kenthomas, you appear to be using Drupal without error reporting enabled? Would help to know the actual messages behind those WSoDs.

1kenthomas’s picture

Priority: Normal » Minor

Installing from scratch: Drupal 8.1.8, followed by commerce-dev via Composer, enabling Commerce and dependencies, then enabling Commerce Payment, then attempting to disable Commerce Payment:

WSODs @/admin/modules/uninstall/confirm with the following in PHP log:

[28-Aug-2016 11:35:45 Australia/Melbourne] Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42S02]: Base table or view not found: 1146 Table '~.commerce_payment_method__paypal_mail' doesn't exist: UPDATE {commerce_payment_method__paypal_mail} SET deleted=:db_update_placeholder_0
WHERE  (bundle = :db_condition_placeholder_0); Array
(
    [:db_update_placeholder_0] => 1
    [:db_condition_placeholder_0] => paypal
)
" at ~/core/lib/Drupal/Core/Database/Connection.php line 671

(Creating the table etc does not seem to resolve-- creates another loop of errors).

Note the country and timezone are AFAICT the only unique aspects fo the site at this point.

1kenthomas’s picture

Priority: Minor » Normal

Installing everything via Composer (new site), Commerce Payment is the only Commerce module not installed. Install. Attempt uninstall via GUI, appears to be same result:

[28-Aug-2016 12:39:15 Australia/Melbourne] Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42S02]: Base table or view not found: 1146 Table '~_db.commerce_payment_method__paypal_mail' doesn't exist: UPDATE {commerce_payment_method__paypal_mail} SET deleted=:db_update_placeholder_0
WHERE  (bundle = :db_condition_placeholder_0); Array
(
    [:db_update_placeholder_0] => 1
    [:db_condition_placeholder_0] => paypal
)
" at ~/example.com/mystore/web/core/lib/Drupal/Core/Database/Connection.php line 671

(Also setting Australia, Australia/Melbourne as country and timezone FWIW, I can try default if you think it might affect, else I may try this again on another server to make sure anything environmental is unlikely. Thanks).

1kenthomas’s picture

The problem appears to be that the table 'paypal_mail' is not created. (commerce_payment_method__paypal_mail).

If I change the definition function as follows:

    $fields['paypal_mail'] = BundleFieldDefinition::create('string')
      ->setLabel(t('PayPal Email'))
      ->setDescription(t('The email address associated with the PayPal account.'))
      ->setRequired(TRUE);


The table is created; however on uninstall we still have a fail:

[29-Aug-2016 08:33:37 Australia/Melbourne] Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42S02]: Base table or view not found: 1146 Table '~_db.commerce_payment_method__paypal_mail' doesn't exist: UPDATE {commerce_payment_method__paypal_mail} SET deleted=:db_update_placeholder_0
WHERE  (bundle = :db_condition_placeholder_0); Array
(
    [:db_update_placeholder_0] => 1
    [:db_condition_placeholder_0] => paypal
)
" at /example.com/mystore/web/core/lib/Drupal/Core/Database/Connection.php line 671

  • bojanz committed 5479815 on 8.x-2.x
    Issue #2790387 by 1kenthomas, bojanz: Unable to uninstall
    
bojanz’s picture

Status: Active » Fixed

Pushed a commit:
1) Fixed the base table error. We were deleting the storage before deleting the field, instead of the other way around.
2) Added Payment and Checkout to the Uninstall tests. Still passing (but only with the previous fix).
3) Updated the Uninstall tests to account for the new uninstall process: The Commerce base module can't be uninstalled together with the other modules anymore, because it now provides a field type. This is a known Drupal limitation. Instead, the flow is:
- Uninstall all other Commerce modules
- Run cron to delete the field in question
- Uninstall the Commerce base module.

Opened #2791303: Document uninstalling Commerce to document #3.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

krupa’s picture

Version: 8.x-2.x-dev » 8.x-2.7

I am having same error - [07-Jun-2018 10:59:22 Australia/Darwin] Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'commerce_payment_method__paypal_mail' doesn't exist: UPDATE {commerce_payment_method__paypal_mail} SET deleted=:db_update_placeholder_0
WHERE bundle = :db_condition_placeholder_0; Array
(
[:db_update_placeholder_0] => 1
[:db_condition_placeholder_0] => paypal
)
" at /core/lib/Drupal/Core/Database/Connection.php line 686

How do I resolve it? Thank you.

joe huggans’s picture

@krupa - did you find a solution? I am unable to uninstall commerce

vselivanov’s picture

Issue summary: View changes

Have the same problem with uninstall commerce payment. The table can be 'commerce_payment_method__paypal_mail' or 'commerce_payment_method__card_type'.
Has anyone solved this problem?

vselivanov’s picture

Issue summary: View changes

The problem with uninstall commerce_payment. My steps to fix:
1. Check Status report /admin/reports/status
In my case I had an error “Mismatched entity and/or field definitions”.
I suppose this happen because of other commerce modules uninstall. Most likely commerce_braintree.
2. To fix it you have to install devel_entity_updates module and
update entity with drush entup command.
3. After that you can continue to uninstall Commerce with this order:
- commerce_payment
- commerce_order
- profile & commerce_number_pattern
- commerce_store
- commerce_price
- commerce
If you’ll see an error with “Fields pending deletion” - create update with
DELETE FROM key_value WHERE name = 'field.field.deleted' OR name = 'field.storage.deleted'

nofue’s picture

Still an unresolved issue?
It's quite a pain to get stuck by such a minor issue … Here's the output:

drush pmu commerce_payment -ry

In Connection.php line 805:
                                                                                                                                                                                             
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'webjm.commerce_payment_method__paypal_mail' doesn't exist: UPDATE {commerce_payment_method__paypal_mail} SET "deleted"=  
  :db_update_placeholder_0                                                                                                                                                                   
  WHERE "bundle" = :db_condition_placeholder_0; Array                                                                                                                                        
  (                                                                                                                                                                                          
      [:db_update_placeholder_0] => 1                                                                                                                                                        
      [:db_condition_placeholder_0] => paypal                                                                                                                                                
  )                                                                                                                                                                                          
                                                                                                                                                                                             

In Statement.php line 59:
                                                                                                                               
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'webjm.commerce_payment_method__paypal_mail' doesn't exist  
                                                                                                                               

As one is forced to uninstall PayPal BEFORE Payment, it's quite clear (to me :)) that the paypal* tables won't exist when Payment has to be uninstalled. Appears like a CATCH 22 to me.

gweigert’s picture

Procedure from #13 worked for me! It was the only way to move forward and get commerce uninstalled. Thanks vselivanov.

carlbowles100’s picture

For me, the solution was:

  1. Export tables from phpMyAdmin: commerce_payment_method__card_type, commerce_payment_method__card_number, commerce_payment_method__card_expiry_year, commerce_payment_method__card_expiry_month
  2. Uninstall Commerce PayPal module
  3. Import the MySQL file we just exported to recreate those tables
  4. Carry on and uninstall Commerce Payment module
pastamp’s picture

and will finaly throw

You have requested a non-existent service "plugin.manager.commerce_payment_type". Did you mean one of these: "plugin.manager.link_relation_type", "plugin.manager.commerce_condition", "plugin.manager.commerce_entity_trait",
"plugin.manager.commerce_inline_form", "plugin.manager.commerce_number_pattern", "plugin.manager.commerce_adjustment_type", "plugin.manager.schema_property_type"?
trickfun’s picture

I have same error.
Workaround is fine but is there the possibility to fix the uninstall process?

Is a paypal module problem or a payment module one?

Thank you in advance

arlingtonvoicellc’s picture

This issue is still unresolved. Solution #13 does not work.

afagioli’s picture