I've just tried to upgrade a site from 6.16 to the latest 7.x-dev and I'm just getting a white screen when visiting update.php.
I've followed the instructions in upgrade.txt, I'm logged in as the admin user, the site is in maintenance mode, I've disabled all contrib modules etc., and I've checked that this server meets all the requirements for 7.x. (I'm already running several installations of various versions of 7.x-dev just fine, but I've not tried upgrade before).
The browser redirects to http://localhost/drupal-6.16/update.php?op=info, but that's it... there's nothing in the apache error logs, and it doesn't appear that any changes have been made to the database.
I'm running XAMPP under windows, PHP 5.3.0 with 256Mb memory.
I'm sorry that this is a pretty poor error report - please let me know how I can gather more information that would help debugging this. PHP on this server is not compiled with debugging support so I can't easily step through the functions in install.php to find out where it's failing...
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | 766100-list-themes-d7.patch | 1.38 KB | andypost |
| #12 | 766100-list-themes-d7.patch | 2.1 KB | andypost |
| #11 | 766100-list-themes-d7.patch | 2.06 KB | andypost |
| #6 | 766100-list-themes-d7.patch | 1.37 KB | andypost |
Comments
Comment #1
David_Rothstein commentedDo you have PHP error logging turned on for this server, or the ability to turn it on? For example, you can put something like this near the top of the update.php script I think:
(You mentioned that there's nothing in the Apache error logs, but just wanted to make sure it's definitely configured to write errors somewhere, since a whitescreen is so often due to a PHP fatal error.)
Anyway, I'm guessing this could be an issue that only shows up in PHP 5.3, so will be useful to track down...
Thanks!
Comment #2
tanoshimi commentedThanks for the reply David. Turning on PHP logs reveals, as you correctly guessed, that there is a fatal PHP error occurring.
The offending line is an attempt to call _system_rebuild_theme_data(), as below:
I thought I'd start by checking the obvious things... _system_rebuild_theme_data() is defined in my /modules/system/system.module, so it's not that I failed to copy the D7 files across correctly!
Trying to manually step back through update.php, I'm guessing that the call to drupal_load('module', 'system'); in line 358 of update.php should have made _system_rebuild_theme_data available, so for some reason that load hasn't happened at the point that list_themes() is being called... I'm way out of my depth here - this is like wading through treacle for me!
Still, I'm very happy to provide any more information if it would help someone with more brains than me figure this out! Thanks.
Comment #3
tanoshimi commented....and, having found the error message, it seems like this (might be) a duplicate of http://drupal.org/node/757214 - at least, from about comment #8 onwards, it is...
Comment #4
aspilicious commentedI guess they are going to stop the support of upgrading versions <6.17. See #760014: Stop supporting direct updates from Drupal < 6.17.
So I guess if that one goes through we have to close this!
Comment #5
andypostThere was a patch to catch this error #719850-16: errors in update.php during bootstrap yield a blank page
Comment #6
andypostThis hunk was lost in #688294: Switch from db_is_active() to proper exception catching
EDIT: This code is critical required because theming a maintenance page could probably happen before system.module is loaded!!!
Comment #7
Crell commentedRelated: #679112: Time for system.module and most of includes to commit seppuku
The fix in #6 is an ugly spaghetti hack. We may not be able to do better in Drupal 7, but we should be aware that it's an ugly piece of spaghetti. :-( system.module needs to be gutted and refactored for Drupal 8, no question.
Comment #8
David_Rothstein commentedNot sure about that patch - the current code looks fine in the case where the database is not active, so why move it out of there?
I think it's rather the responsibility of update.php to load system.module earlier in the page request if that's what's needed to make this work.
Or alternatively, remove the weird behavior where list_themes() insists on scanning the filesystem every single time update.php is being visited (rather than reading from a perfectly good database), i.e. here:
However, having tried to loosen that MAINTENANCE_MODE check previously (and failed), I know it's not so trivial to do :(
Comment #9
David_Rothstein commentedAh, I see, I am a bit out of date - the intention of that other issue is that db_is_active() won't even exist anymore :)
So why not just put a single call to drupal_load() inside list_themes()? We are using system.module's API, so we need to make sure it is loaded. Not that pretty, but simple and effective. It ought to catch the update.php problem, as well as other obscure situations where we might hit this issue as well.
Comment #10
andypost@David_Rothstein because this could probably happen when some troubles before system.module is loaded - for example issue from #5
This depends not only on database, core should have ability to theme maintenance page even if the system.module is not loaded
@Crell I see no other ability to handle this. But agreed exactly that theme listing should be moved out from system.module
Comment #11
andypostPatch with improved comment and doc-block should be changed to standard. Need help to improve comment.
There are 3 cases when drupal_maintenance_theme() is called.
This piece of code execute from _drupal_log_error() so it's a right place to init database class and load system.module
Comment #12
andypostBecause db_is_active() lives in database.inc it's wrong to call this function to check that DB initialized
As #719850-16: errors in update.php during bootstrap yield a blank page
And upcoming #688294: Switch from db_is_active() to proper exception catching
Comment #13
catch#12: 766100-list-themes-d7.patch queued for re-testing.
Comment #14
catchPatch still applies, agreed it's ugly but I don't think there's a way around that, we'll need to deal with it as part of #679112: Time for system.module and most of includes to commit seppuku. This should ideally go in before #688294: Switch from db_is_active() to proper exception catching, otherwise the patches need to be merged more or less.
Comment #15
webchickOk. Committed to HEAD. We'll see what we can do in D8.
Comment #16
Cheek commentedStill getting
[Fri Apr 23 20:00:43 2010] [error] [client ::1] PHP Fatal error: Call to undefined function _system_rebuild_theme_data() in C:\\xampp\\htdocs\\includes\\theme.inc on line 591with latest 7.x-dev when upgrading. Tried different options, but I'm not sure what the problem is..
Comment #17
andypost@Cheek could you provide more info?
- Are you running update.php? which step
- do you disable all contrib modules?
- do you override $conf['maintenance_theme'] ?
I cant reproduce this error...
Means that site in maintenance mode but system.module is not loaded
Comment #18
Cheek commented- update.php after replacing d6 files with d7 files
- all modules are disabled
- overriding $conf['maintenance_theme'] or not doesn't matter
- having the site in maintenance mode or not during upgrade doesn't matter
Comment #19
Cheek commentedTried several other possibilities. None of them worked except upgrading from a fresh d6 to d7.
My site is high on CCK fields, including nodereferences.
Also did:
- export these tables only from d6 using backup and migrate:
- clean d6 install
- import using backup and migrate
- test content
- replace d6 files with d7
- upgrade.php
Same error.. If you could tell me which are the necessary tables to only export the nodes with all the cck fields, I could try that as well.
Comment #20
andypostbad news... I have no more ideas why update does not load system.module if all contrib are disabled
I think it's time to debug update.php
Comment #21
Cheek commentedThis is where the error takes place:
Comment #22
Cheek commentedSorry, it's actually at the end of that if() (in upgrade.php):
It errors on "return $extra_requirements;"
update_extra_requirements() is called by update_check_requirements() which is called after drupal_maintenance_theme();
Comment #23
andypostI think your update fail in update_prepare_d7_bootstrap() on drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
Because system is not loaded and you could have wrong database definition in settings.php - $db_url or $databases?
Comment #24
Cheek commentedUgh, stupid of me. I'm new, so I thought I could just put a bunch of 'echo "error ...";' in the update.php en track the bug. This caused the update.php to stop before going to update.php?op=info and not putting any errors in my apache logs.
When using a clean update.php it does go to update.php?op=info with the WSOD + _system_rebuild_theme_data() error.
Is there any way I can track the bug in update.php?
I'm using the same $databases I created with a fresh d7 install and the same db.
Comment #25
andypostIf you have no debugger (xdebug, zend) the only possible solution is write to a file NOT echoing!!!
Comment #26
Cheek commentedOk, so it seems to error on
update_fix_d7_requirements();from update.inc called by update.php (calling theme.inc)
This is after running through update.php once and calling update.php?op=info
I'll see if I can install a debugger to find out more..
Comment #27
Cheek commentedIt seems to be triggered by
db_add_index('system', 'system_list', array('weight', 'name'));in function update_fix_d7_requirements() in update.inc, line 329.
That's about as far as my knowledge goes. What I don't get is this involves themes, while I'm upgrading with only the standard d7 themes. Is any theme info stored in the db? Else, I could try to delete the d6 theme info. All I want is to get my d6 node data into d7 anyway.
Comment #28
mfbI got this error when trying to load update.php on what is already a D7 site, and in my case it went away if I disabled apc.include_once_override
Comment #29
catchIf this only shows up with include_once_override then it's not critical. Is it possible you tried update.php without there being an apache restart since the patch was committed?
Comment #30
Cheek commentedI tried upgrading like 30 times now. With different options, different releases (including alpha4). The only time I got it working is with a clean, empty d6 install. Just tried today's release with an apache restart and got the same errors I stated above.
I guess my drupal 6 db is too complex or whatever. I'll try upgrading again when we're closer to a final release..
Comment #31
catch@Cheek - do you have APC and include_once_override enabled?
Comment #32
Cheek commentedDon't think so. It doesn't show up in the phpinfo() and setting 'apc.include_once_override = 0' in the php.ini didn't do anything. I'm using xampp.
Comment #33
catchSo a clean D6 install upgrades, but not your real database with actual data in it? Either way this is no longer 'needs more info'.
Comment #34
Cheek commentedYes, just did another clean d6 upgrade to d7 and it works fine. Same d6 and d7 files that don't work when I try to upgrade d6 with my sites data.
Comment #35
chx commentedI have seen this error message. The chain is the following... I think at least (it's 1am) ... you get an error... drupal_log_error calls maintenance theme.. but system is not yet loaded. Kaboom!
Comment #36
andypost@chx system could not be 'not loaded yet' because a last commited patch #12.
@Cheek could you try this patch? This moves loading system.modules out of condition
Comment #37
Cheek commentedI'm now getting a drupal error when running update.php (tried alpha4 and today's release).
Comment #38
mikey_p commentedCheek, I've got a patch for the timezone notice in #805052: Notice in update.php in drupal_session_initialize().
We may need to see a scrubbed copy of your DB if no one else can recreate the problem, but I strongly suspect that it may have been the exception not being caught properly, which was causing the theme system to go into a tizzy. I've see the undefined function error with _system_rebuild_theme_data() in relation to other issues but I could never pin point the cause. It may or may not be related to #805222: PDO exception when installing with $update_free_access = TRUE.
Comment #39
Cheek commentedThanks for the timezone fix mikey_p!
I'm now don't to the second line:
DatabaseSchemaObjectExistsException: Table <em class="placeholder">date_formats</em> already exists. in DatabaseSchema->createTable() (line 605 of C:\xampp\htdocs\includes\database\schema.inc).Seems related to drupal_install_schema() ?
#761740: On enabling 2 or more modules: DatabaseSchemaObjectExistsException
#780296: Error cache_coder already exists in DatabaseSchema on installation
#790310: PHP warning - install fails
#762910: Unnecessary call to drupal_install_schema()
Comment #40
Cheek commentedWhen I try setting $update_free_access to true, I get the same error as #805222: PDO exception when installing with $update_free_access = TRUE
First getting denied and then setting it to true doesn't help, since I get the DatabaseSchemaObjectExistsException error when $update_free_access is set to false.
I'm going to try to uninstall some modules before upgrading d6->d7 now. Maybe it's some old table from an even older module..
Comment #41
Cheek commentedOk, so after a couple of tries I found out uninstalling the Date API in D6 before upgrading did the trick.
So that's:
Thanks so much guys! I'm finally able to upgrade to Drupal 7! :)
Comment #42
catchPatch looks good and it's been tested successfully.
Comment #43
dries commentedLooks good to me. Committed to CVS HEAD. Thanks.