Here is the full log from Travis-CI:

https://travis-ci.org/lsolesen/panopoly/jobs/16105934

And here is the important error:

WD menu: PDOException: SQLSTATE[42S02]: Base table or view not found:[error]
1146 Table 'drupal.pathauto_state' doesn't exist: SELECT entity_id,
pathauto FROM {pathauto_state} WHERE entity_type = :entity_type AND
entity_id IN (:entity_ids_0, :entity_ids_1); Array
(
    [:entity_type] => search_api_index
    [:entity_ids_0] => 1
    [:entity_ids_1] => 2
)
 in pathauto_entity_state_load_multiple() (line 436 of
/home/travis/build/lsolesen/drupal/profiles/panopoly/modules/contrib/pathauto/pathauto.module).

This may be related to: #1979558: Update pathauto patch

Comments

dsnopek’s picture

Status: Active » Fixed

Implemented hook_update_dependencies() in panopoly_core and panopoly_user to make sure update functions happen in the correct order.

dsnopek’s picture

Title: Upgrade from 1.0-rc3 or 1.0-rc2 fails: Table 'pathauto_state' doesn't exist » Upgrade from 1.0-rc3 fails: Table 'pathauto_state' doesn't exist
Status: Fixed » Active

Ugh, this appears to still happen on Travis-CI for 1.0-rc3 (but strangely not 1.0-rc2) and I can't recreate it locally - works fine for me locally. :-/

Here is the Travis-CI log:

https://travis-ci.org/lsolesen/panopoly/jobs/16833273

dsnopek’s picture

Status: Active » Fixed

Added a hook_update_dependencies() hack to panopoly_widgets and now it's getting past the update functions finally! :-) Marking as Fixed again.

Status: Fixed » Closed (fixed)

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

mducharme’s picture

Title: Upgrade from 1.0-rc3 fails: Table 'pathauto_state' doesn't exist » Upgrade from 1.0-rc5 fails: Table 'pathauto_state' doesn't exist
Component: Code » Admin
Status: Closed (fixed) » Active

Sorry to have to reopen this. This is still happening for my upgrade from rc5 to 7.x-1.1+23-dev

WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'example.pathauto_state' doesn't exist: SELECT entity_id, pathauto FROM {pathauto_state} WHERE entity_type = :entity_type AND entity_id IN (:entity_ids_0); Array
(
    [:entity_type] => user
    [:entity_ids_0] => 0
)
 in pathauto_entity_state_load_multiple() (line 436 of /data/www/panopoly/profiles/panopoly/modules/contrib/pathauto/pathauto.module).
dsnopek’s picture

Hrm. We have tests that attempt to upgrade from 1.0-rc5 on every commit and they're running fine:

https://travis-ci.org/lsolesen/panopoly/jobs/19265484

Are you running straight Panopoly or is a distribution built on Panopoly? Can you give some more information about your site? Are you using any patches to Panopoly or Pathauto (beyond what Panopoly includes)?

mducharme’s picture

It's a straight panopoly installation without any other distributions, profiles and the only patched panopoly module is entityreference (to fix a field_collection issue). I do have a lot of additional contrib in sites/all/modules/contrib that are enabled on my site but this pathauto_state problem is the only error I get when running updates.

I don't mind trying something drastic if you have any ideas. I have lots of backups.

mducharme’s picture

OK, I got this working but it did require the following workaround:

  1. Download a fresh copy of pathauto (1.2) into sites/all/modules/contrib/pathauto
  2. Run a registry rebuild to update module path to use the sites/all/modules/contrib/ version of pathauto
  3. Run updates. All of the other module updates (around 20) run successfully and the pathauto update is not triggered.
  4. Delete pathauto from sites/all/modules/contrib/pathauto
  5. Run another registry rebuild
  6. Run updates. This time, the only update left was pathauto, which runs successfully

I'll let you decide whether the issue should be closed again or if you'd like to further review the issue based on this result.

bojanz’s picture

dsnopek’s picture

Status: Active » Closed (fixed)

Since @mducharme found a solution to their problem and we can't reproduce this in our tests (well, not anymore, since we fixed the issue originally), I'm setting this back to fixed.

lunazoid’s picture

I just wanted to post my experience with this issue. We are updating from Panopoly rc4 to 1.2, and encountered this problem (it appears as though rc5 is when the table name changed from 'pathauto' to 'pathauto_state'.) The workaround used by @mducharme in #8 didn't work for me, as the table still wasn't created. What I wound up doing was hacking the code a bit to add a conditional statement to the 3 functions that access the database table. If the 'pathauto_state' table existed, it would use it, otherwise, it would use 'pathauto.' This was only necessary to keep the site alive so I could run drush updb. Once the database updates ran, the table was created, and the conditionals could be removed.

I could post a patch if anyone needs it, but this is really just a simple hack to allow the database updates to run and probably won't affect many users.

electrokate’s picture

#8 worked for me, thanks for posting, mducharme!

dsnopek’s picture

Wow, this is more delicate than I thought! Appearantly, adding an update function to a completly unrelated module can reorder the update functions in such a way that this error happens. Here's an example from our upgrade tests on Travis-CI:

https://travis-ci.org/panopoly/panopoly/jobs/23551978

This commit added panopoly_images_update_7102(), and now upgrades from 1.0-rc4 to latest -dev break.

So, basically, having any contrib modules beyond what's bundled in Panopoly could break upgrade.

The only real fix would be a change to Drupal core to make update order predictable per @bojanz's issue: #2230419: Distribution updates run in an unpredictable order

For now, I'll probably add another hook_update_dependencies() hack...

  • Commit 8607a41 on 7.x-1.x by dsnopek:
    Issue #2164193: Upgrade from 1.0-rc5 fails: Table 'pathauto_state' doesn...
liza’s picture

ugh... i just got this message while trying to finish an update. how can i tell the order of the updates? i have a quite a number of modules outside of the Panopoly bundle :P

dsnopek’s picture

@liza: If you run the updates via drush (ie. drush updb) then it'll print out each update function as it runs them. You can copy and paste that output and that'll tell us the order that the update functions are running in.

It's unfortunate that this issue is still happening. I was kinda hoping that the latest updates to the pathauto patch would prevent this, but it looks like no. :-/

liza’s picture

*sigh* still have this problem with 1.4.
here's the print out to the update order

Block 7009 Increase {block}.title length to 255 characters.
Panopoly_core 7102 Disable Panopoly layouts and enable Radix ones.
Panopoly_theme 7002 Enable radix_layouts and clear layouttheme caches.
Panopoly_theme 7003 Switch all Panels in the database to use Radix layouts.

Initialized Drupal site default at sites/default

Executing panopoly_theme_update_7002

Performed update: panopoly_theme_update_7002

Executing panopoly_theme_update_7003

Performed update: panopoly_theme_update_7003

Executing panopoly_core_update_7102

Performed update: panopoly_core_update_7102

Executing block_update_7009

Performed update: block_update_7009

Command dispatch complete

will try out #8 and report back
*siiiiiiiiiiiiiiiihg*

liza’s picture

tried a few variations of #8 and nothing works. suggestions?

liza’s picture

not solved for me wit 1.4

dsnopek’s picture

not solved for me wit 1.4

Just to be clear, this means you're updating from Panopoly 1.4 to 1.14? Or from 1.0-rc5 to 1.14 (and "1.4" was a type-o)?

manishs’s picture

Running /update.php fixed this error for me.