I'm testing 6-7 updates and I've done the following:

- made a simple D6 site and used devel generate to creates nodes, taxos, users.
- disabled non-core modules
- dumped the database
- re-imported it as a new database
- pointed a fresh CVS copy of D7 at it by editing settings.php (basing the database connection settings on a working D7 I already have locally)

I get this:

Fatal error: Class 'MergeQuery_mysql' not found in /Users/joachim/Sites/drupal-7-upgrade/includes/database/database.inc on line 731

Debugging shows that the function was called for table 'cache_bootstrap' with options:

Array ( [target] => default )

CommentFileSizeAuthor
#20 757214_20_semaphore_upgrade.patch1.63 KBscor
#16 nosemaphoreupdate.patch2.98 KBAnonymous (not verified)
#10 nosemaphoreupdate.patch1.79 KBAnonymous (not verified)

Comments

catch’s picture

Did you visit update.php?

joachim’s picture

I hadn't.

But now I have, that's a WSOD.

I had a thought: should I have copied over the D6 settings.php rather than put the DB details into the D7 one?

catch’s picture

Please follow the same steps again, but visit update.php first without visiting anything else. If it's a wsod, is there an error? If not is there something in error log?

Crell’s picture

We need to get this issue resolved, as it will likely help here: #688704: Give DB its own autoload function (At least that's why that issue was created in the first place.)

joachim’s picture

It's a WSOD with no message.

Error log says:

[30-Mar-2010 15:09:11] PHP Fatal error: Class 'MergeQuery_mysql' not found in /Users/joachim/Sites/drupal-7-upgrade/includes/database/database.inc on line 731
[30-Mar-2010 15:09:37] PHP Fatal error: Call to undefined function _system_rebuild_theme_data() in /Users/joachim/Sites/drupal-7-upgrade/includes/theme.inc on line 585

Anonymous’s picture

subscribe.

catch’s picture

Issue tags: +D7 upgrade path
Anonymous’s picture

just confirming, using joachim's step from the initial description, then hitting update.php, i get:

Fatal error: Call to undefined function _system_rebuild_theme_data() in /var/www/drupal/core/7/testupdate/includes/theme.inc on line 585

Anonymous’s picture

i put some debug in before the _system_rebuild_theme_data() call, and it seems this is the original error:

Logs for request drupal7.testupdate/update.php
_drupal_log_error --> Zivtech_Debug::ffs
Array
(
    [%type] => DatabaseSchemaObjectExistsException
    [%message] => Table <em class="placeholder">semaphore</em> already exists.
    [%function] => DatabaseSchema->createTable()
    [%file] => /var/www/drupal/core/7/testupdate/includes/database/schema.inc
    [%line] => 558
    [severity_level] => 3
)

_drupal_log_error --> drupal_maintenance_theme --> _drupal_maintenance_theme --> list_themes --> Zivtech_Debug::ffs
just before death

so, we have a schema issue, then we hit #742246: Handle uncaught exceptions when the error handler tries to log the error.

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.79 KB

seems the semaphore table landed in D6, so the fix is to take out the create and do an update on that table instead.

Anonymous’s picture

D6 version of {semaphore} has an index on expire, D7 has an index on value. both cols are used in queries in D6, so index should probably be on both expire and value. leaving that for another issue.

catch’s picture

Status: Needs review » Needs work

At the moment we support upgrades from all versions of 6.0 onwards - this is a policy I strongly disagree with, but we need a dedicated issue to change that. So this will first need to check if the table exists, then do the update/create as necessary.

Anonymous’s picture

right, good point, i'll reroll shortly.

rfay’s picture

Title: Fatal error: Class 'MergeQuery_mysql' not found with D6 database » D6->D7 update.php failure: Fatal error: Class 'MergeQuery_mysql'
joachim’s picture

I think the "Fatal error: Call to undefined function _system_rebuild_theme_data()" message itself needs fixing -- I get it if the DB has been wiped, and we should fail more gracefully.

Anonymous’s picture

StatusFileSize
new2.98 KB

attached patch checks for the existence of semaphore before creating it as per #12.

@joachim - that error comes from the error handling code, and is being addressed here - #742246: Handle uncaught exceptions

Anonymous’s picture

Status: Needs work » Needs review

fix status.

moshe weitzman’s picture

FWIW, I also disagree with supporting upgrade from any version of d6. We can barely test one upgrade path, lets not add 15 more.

catch’s picture

scor’s picture

StatusFileSize
new1.63 KB

I also agree supporting all the flavors of 6.x is a nightmare for fixing the upgrade path. Let's just assume the semaphore table exists, all we need to do is fix its index according to D7 schema.

andypost’s picture

Status: Needs review » Needs work

@scor this assumption valid only for d5->d6 upgraded installs.

About _system_theme_data #766100-10: Undefined function _system_rebuild_theme_data when trying to run update.php from D6 -> D7

bshort’s picture

Subscribe

catch’s picture

Status: Needs work » Reviewed & tested by the community

@andypost: webchick agreed to #760014: Stop supporting direct updates from Drupal < 6.17, so we should proceed on that basis. Patch looks good.

Anonymous’s picture

yep, patch looks good. probably a separate issue, but i don't see why we don't include 'name' in the index? looking at the queries in includes/lock.inc, we seem to use that column in where conditions a lot.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD!

Cheek’s picture

I'm still getting this error with the latest 7.x-dev.

[Fri Apr 23 09:17:47 2010] [error] [client ::1] PHP Fatal error: Call to undefined function _system_rebuild_theme_data() in C:\\xampp\\htdocs\\includes\\theme.inc on line 585

Not sure about the 6.17 talk. I'm trying to update from 6.16. Should I update to the latest 6.x-dev first?

andypost’s picture

Cheek’s picture

Seems like 766100-list-themes-d7.patch is included in the latest 7.x-dev I have.

After applying 688294-die-dba-d7.patch I only get a different line:

[Fri Apr 23 10:44:47 2010] [error] [client ::1] PHP Fatal error: Call to undefined function _system_rebuild_theme_data() in C:\\xampp\\htdocs\\includes\\theme.inc on line 591

andypost’s picture

andypost’s picture

I've tested d6-d7, it works fine

Cheek’s picture

Yeah, this is probably not related to the OP's problem. I'll try the other thread..

Status: Fixed » Closed (fixed)

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

yoroy’s picture

Status: Closed (fixed) » Active

Trying to upgrade a simple D6.19 site to D7 beta 1, same scenario as in the original post here. Getting the same error of "Fatal error: Class 'MergeQuery_mysql' not found in /Users/yoroy/Sites/yoroy/includes/database/database.inc on line 718"

This is using MAMP locally, MySQL 5.1.37, PHP 5.2.11. I'll need help/instructions on what to do to debug this because I don't how to do that. Find me on IRC to discuss or point out the user error :)

steinmb’s picture

Hi
Is this a clean install of D6.19 or is this an existing site that have been installed on an older 6.x and upgraded at some point to 6.19?

chx’s picture

I got the dump from yoroy and I could not reproduce. Ubuntu 10.04.1, PHP 5.3.2-1ubuntu4.2, MySQL 5.1.41-3ubuntu12.6

yoroy’s picture

Existing site, upgraded to 6.19 just before trying the upgrade to d7. I'll try to reproduce this later today. One more note: the hosting environment is not the same as my local env. I did get the d6 version of the live site running fine locally though.

damien tournoud’s picture

Just to confirm, are you visiting update.php or pointing directly at the front page?

yoroy’s picture

Interesting, visiting both the frontpage and update.php I get different errors now (using the same untouched installation)

http://skitch.com/yoroy/d4apb/access-denied-yoroy
http://skitch.com/yoroy/d4apf/error-drupal
and
http://skitch.com/yoroy/d4ape/error-yoroy for hitting /user

This is getting messy no? I'm offline for the next couple of hours. Will try from scratch again then and report back.

berdir’s picture

The notices on update.php are because the locale cache has changed. These only happen once.

I remember trying to handle that automatically once but it is tricker than it looks :)

Anyway, you should be update to run update.php once you set $update_free_access to TRUE.

No idea about the MergeQuery error, you could try to debug http://api.drupal.org/api/function/drupal_autoload_class/7 and figure out who is trying to do that Merge query.

carlos8f’s picture

Do try $update_free_access to TRUE, that could be all there is to it. The frontpage is totally not meant to be accessed during an upgrade, so if the MergeQuery error happens on the frontpage only (@yoroy, please confirm this), it's more an issue that we don't enforce maintenance mode when the upgrade is started, leading to irrelevant error messages.

yoroy’s picture

Status: Active » Closed (fixed)

Yes, I managed to get further into the upgrade process (but now running into #934246: An AJAX HTTP error occurred during upgrade). Setting $update_free_access to TRUE did the trick. Back to fixed, sorry for your time!