I had first updated to 7.x-2.26 (from 7.x-2.23) and I was no longer able to configure my products or add items to the cart. When I updated from 7.x-2.26 to 7.x-2.27 the error remained. So I reset the codebase and the database to the 7.x-2.23 setup and updated directly to 7.x-2.27.

I can't get update.php to complete successfully. I can't clear the caches successfully.

I'm getting errors like Warning: Invalid argument supplied for foreach() in _registry_update() (line 54 of . . . and a variety of errors like DatabaseSchemaObjectExistsException: Table field_data_commerce_percent_off_shipping already exists. in DatabaseSchema->createTable() (line 657 of . . . where the table in question varies. For instance, if I attempt to navigate to admin/modules I get the error DatabaseSchemaObjectExistsException: Table field_data_field_headline already exists. in DatabaseSchema->createTable() (line 657 of . . .

(I am able to configure the product and add it to the cart, though. I was not able to do this when I updated to 2.26.)

Comments

vegantriathlete created an issue. See original summary.

vegantriathlete’s picture

Issue summary: View changes
vegantriathlete’s picture

Title: Errors when updating from 7.x-2.23 -> 7.x-2.27 » Errors when updating from 7.x-2.23 -> 7.x-2.28
Version: 7.x-2.27 » 7.x-2.28

I am still getting the same types of errors when I update from 2.23 -> 2.28 as when I updated from 2.23 -> 2.27

Here is what I get when I run update.php after updating the codebase:

Warning: Invalid argument supplied for foreach() in _registry_update() (line 54 of /home/XXXXXXXXX/dev_html/includes/registry.inc).
DatabaseSchemaObjectExistsException: Table field_data_commerce_percent_off_shipping already exists. in DatabaseSchema->createTable() (line 657 of /home/XXXXXXXXX/dev_html/includes/database/schema.inc).

Below the errors I see the message that the website encountered an unexpected error.

Cron completes successfully.

If I navigate to admin/modules I get: DatabaseSchemaObjectExistsException: Table field_data_field_headline already exists. in DatabaseSchema->createTable() (line 657 of /home/XXXXXXXXX/dev_html/includes/database/schema.inc).

If I clear cache, it fails to complete and I get:

Warning: Invalid argument supplied for foreach() in _registry_update() (line 54 of /home/XXXXXXXXX/dev_html/includes/registry.inc).
DatabaseSchemaObjectExistsException: Table field_data_commerce_percent_off_shipping already exists. in DatabaseSchema->createTable() (line 657 of /home/XXXXXXXXX/dev_html/includes/database/schema.inc).

The website encountered an unexpected error. Please try again later.

vegantriathlete’s picture

ping.

Can I get some type of response on this?

howdytom’s picture

Can I get some type of response on this?

I am sorry to say that but I can’t confirm this error. It looks like some a issue with your field field_data_commerce_percent_off_shipping.

Did you overwrite/update any commerce modules?

vegantriathlete’s picture

As I mentioned the table mentioned in the error message varies. It's not just field_data_commerce_percent_off_shipping. For example, I also get messages about field_data_field_headline.

None of the modules have been overwritten. In fact, I have done previous CK updates without a problem, including updating to 7.x-2.26. But, 2.26 causes a problem in which it's not possible to place orders any more. It seems that 2.26 introduced some bug with the features module. I can update from 2.26 to 2.27, but the problem with not being able to place an order still remains when I do that.

So, one possible workaround is to first update to 2.26. But, then I need to figure out how to fix the problem of not being able to place an order.

vegantriathlete’s picture

Looking through the issue queue more, I see that there are many posts about problems with 2.24 and 2.25 that stem from the switch to Features 2.0. It seems clear that updates became a real problem after 2.23 and I think I am still being bitten by them. At the moment I've got the live site running 2.23 and need a path forward to bring things up to date as there are many security patches that need to be applied.

Apparently, it's a bad idea to update to 2.24 (#2486659: error on database update after updating to 2.24) - see comment #8 by @bojanz. According to comment #15 @Jawi, there are also problems updating to 2.25.

vegantriathlete’s picture

Issue summary: View changes
mglaman’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +sprint

Based on message in #3 it looks like the upgrade issue is from Commerce Discount - not Kickstart. That field isn't part of the custom features. We have automated tests running the upgrade path - albeit it isn't perfect.

What module is providing that field, and trying to create it?

vegantriathlete’s picture

Status: Postponed (maintainer needs more info) » Needs work

I'm confused about what you are saying. Commerce Discount is one of the contrib modules that is wrapped up in the Commerce Kickstart profile and Commerce Discount has not been modified.

If I go to the Drupal root and run grep -r commerce_percent_off_shipping it does not return any results.

If I run grep -r headline I get results in
* profiles/commerce_kickstart/modules/commerce_kickstart/commerce_kickstart_merchandising/commerce_kickstart_merchandising.views_default.inc
* profiles/commerce_kickstart/modules/commerce_kickstart/commerce_kickstart_slideshow/commerce_kickstart_slideshow.views_default.inc
* profiles/commerce_kickstart/modules/commerce_kickstart/commerce_kickstart_slideshow/commerce_kickstart_slideshow.migrate.inc
* profiles/commerce_kickstart/modules/commerce_kickstart/commerce_kickstart_slideshow/commerce_kickstart_slideshow.info:features[field][]
* profiles/commerce_kickstart/modules/commerce_kickstart/commerce_kickstart_slideshow/commerce_kickstart_slideshow.features.field.inc

When I run admin/reports/fields and search on percent, the only thing I turn up is commerce_percentage (Locked) Decimal (module: Number) % off. If I search on headline I come up with field_paragraph_headline Text (module: Text) Field collection field_paragraph for Field Name, Field Type and Used in respectively.

lsolesen’s picture

@vegantriathlete Can you go into the database itself to see whether the table is created. If it is then maybe an incomplete upgrade has run which successfully created the field, but did not finish. Causing the schema version not to update. Now the update hook tries to create the same table again, and that is not possible. You can either alter the update hook to wrap the creating of the table in a "if table exist" or you can make a backup of the database and delete the table in question if it is empty (this is not an official advice but probably what I would do myself and it will be on your own risk, but you got the backup).

petergus’s picture

@lsolesen
Thanks for that idea. (I am taking on this issue now from vegantriathlete .
I had a look and the table did exsist and was empty, so i removed it. Then it asked for a few others that were also empty which i removed. When the several tables it warned about were removed it was able to perform dbupdate.
This error seems to point to line 657 of includes/database/schema.inc, somehow an improper check, but i cannot tell forsure.

mglaman’s picture

Status: Needs work » Active

Putting to active as no patch.

mglaman’s picture

Status: Active » Closed (cannot reproduce)