Upgraded to the latest dev from last night (6th Feb 2010, 1am CET) and pages were showing alright.
I then ran database update and that responded with a 500 error, nothing in the server logs though. Since I can't access the site anymore and only get a WSOD. In the server log there is this error: Call to undefined function user_access() in includes\menu.inc on line 580
When I remove the function call in line 580 and replace it with a TRUE then I get other errors where functions are undefined, e.g. node_load()
I deleted all cache and the session tables in the database manually, but still the same problem.
Then I tried the update on another D7 site and instead of running databse update I ran cron, but the result with all the errors is the same.
Can't figure what's going wrong and hope that someone else has a clue.
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | register-shutdown-cwd-706608.patch | 799 bytes | David_Rothstein |
Comments
Comment #1
catchRetitling.
Please confirm whether you can do a clean install with latest HEAD (and whether running update.php or cron.php causes the same error).
Also just a general note that HEAD-HEAD (or alpha to alpha) upgrades aren't supported yet.
Comment #2
jurgenhaasI was able to do a clean install.
In the end, the same error happens not only for update and cron, it also happens when just flushing all cache, so I guess that's the real cause of the issue as it is also called by the two other routines.
Comment #3
catchI can reproduce this with a relatively clean HEAD install.
Go to update.php
Run run updates (even if there aren't any), click the go back to your site button.
Error message
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1: SELECT * FROM {menu_router} WHERE path IN () ORDER BY fit DESC LIMIT 0, 1; Array ( ) in menu_get_item() (line 414 of /home/catch/www/7/includes/menu.inc).
Comment #4
jurgenhaasThis is really strange. I'm note getting the database error, I just get "call to undefined function" errors. This is how to reproduce this:
1) Do a fresh install with the latest dev release of D7
2) All seems OK
3) Then go to admin/config/development/performance and click on "Clear all caches"
4) After a while you get a WSOD with "PHP Fatal error: Class 'DrupalQueue' not found in \includes\common.inc on line 4658" in the PHP error log
5) Refreshing the page throws a "PHP Fatal error: Call to undefined function user_access() in \includes\menu.inc on line 580" in the error log
6) Disabling that lin 580 then throws the "PHP Fatal error: Call to undefined function node_load() in D:\Drupal7\includes\menu.inc on line 541" in the error log
In summary, it looks as if modules are not loaded and I have no idea why. How can I debug or fix that?
Comment #5
catchI have a bad feeling this might be the system_list() cache - try removing the caching code from system_list() and see if that helps. This has been working for ages, so something recent must have broken it (I vaguely remember a patch adding cache_boostrap() to drupal_flush_all_caches() / system_flush_caches() so could be that?)?
Comment #6
jurgenhaasI went to system_list() and disabled all cache with no luck. I then printed a var dump at the end of system_list() and was surprised that only one module (the profile) and one theme was active.
That made me check te´he system table and all records have status=0. So, it looks as if cache clear is setting all status values in system table to zero.
Comment #7
jurgenhaasI have now tried again with the latest dev from Dupal and the effect can *not* be reproduced anymore. I checked the the differences on the code and can't tell what's different now. Doesn't make me feel well but at least the issue seems to have disappeared.
Comment #8
berdirThis has to be related to the failing update.module tests, see http://qa.drupal.org/pifr/test/32. I can see the same there, only the profile and the themes are enabled. I tried to debug this for hours now, no luck so far.
Comment #9
berdirSee #566494-144: Running cron in a shutdown function breaks the site (and 145).
@ #7 If I had to guess, I would say you had update.module installed before and now you don't?
Comment #10
catchAdding the alpha blocker tag since this is proper site hosing stuff.
Comment #11
jurgenhaas@berdir, yes you're right. I wasn't aware of that difference but just checked and it's true.
Comment #12
catchMarking this as a duplicate of the cron bug.
Comment #13
frank ralf commentedI've been getting the same error for at least a week now:
Fatal error: Call to undefined function user_access() in J:\XAMPP\htdocs\drupal7-HEAD_unpatched\includes\menu.inc on line 580
This is on an unpatched clean HEAD installation. The strange thing is the installation did work all right yesterday but today I get the error message without any changes to the code.
I tried emptying the usual suspect tables in the database to no avail.
Comment #14
jdleonardSubscribing.
I can repro this with a Feb 8 build by deleting the system_list entry from the cache_bootstrap table. I don't follow why this is a dup of the cron bug, but I'll trust ya'll as I'm not qualified to debug this :)
Comment #15
frank ralf commentedProblem persists. Did a clean install yesterday after #566494: Running cron in a shutdown function breaks the site (#150) had been committed to CVS. Setting this to "active" again.
EDIT
The above mentioned patch seemed to have been rolled back. I don't think these issues are (directly) related.
EDIT 2
When calling the /authorize.php script I get the following error message:
EDIT 3
Problem persists. Some time triggered process (automatic cron run?) sets the whole status column in the system table to 0.
Comment #16
frank ralf commentedTry these steps to reproduce the error:
This is on XAMPP 1.7.1, Windows 2000 SP 4.
EDIT
Restoring the system table and emptying the cache_bootstrap table (especially the system_list entry) restores the system.
Any subsequent manual clearing of the cache after a cron run destroys the status column of the system table again.
EDIT 2
The status column is actually empty _before_ clearing the cache, so the culprit must be the cron run. The system works ok even with those status fields set to 0. Clearing the cache triggers the above mentioned error message and renders the system unusable.
Got a new error message for a change:
Fatal error: Class 'DrupalQueue' not found in J:\XAMPP\htdocs\drupal7-HEAD_unpatched\modules\update\update.fetch.inc on line 103See above and #708832: Fatal error: Class 'DrupalQueue' not found and #686196: Meta issue: Install failures on various hosting environments.
Comment #17
catchThis is almost certainly due to http://api.drupal.org/api/function/system_update_files_database/7 which is triggered by update_get_projects(). There's some static caching in update_get_projects() - it puts projects into an array, then sets $project['status'] to FALSE in certain circumstances, but that shouldn't in any way get saved back to the db, and if it did would have to be a bizarre race condition. So it's more likely that system_update_files_database() is broken. However I don't seem to be able to reproduce the bug now, so can't track it down further.
Comment #18
frank ralf commented@catch
Thanks for looking into this and pointing me to a probable suspect ;-) Will have a look.
Comment #19
catchComment #20
frank ralf commented@catch
See my second EDIT from #16:
The status column is actually empty _before_ clearing the cache, so the culprit must be the cron run. The system works ok even with those status fields set to 0. Clearing the cache triggers the above mentioned error message and renders the system unusable.
So I'm still not sure about the root cause for this isssue.
Comment #21
catchupdate_cron() also calls update_get_projects() - so it may well be setting the status to 0 within the cron job rather than a regular cache clear.
The system working fine afterwards will be down to system_list() caching and that not being cleared on the initial cron run which breaks the system table. Once it gets rebuilt the bug shows up.
Comment #22
frank ralf commentedI've been looking at the API documentation on queue operations and the six occurrences in the source code of update_fetch_tasks as this is the only entry in the queue table. $queue = DrupalQueue::get('update_fetch_tasks');
The related function is function _update_create_fetch_task($project) (update.fetch.inc, line 232).
Could the queue system be causing some race condition?
I can't find any reference to $queue->createQueue(); in that file. The queue seems only be registered and items added (line 239f):
Comment #23
catchI'm moving this to update.module - since it's clear the error is triggered from there, although that may not be the only possible way it could happen. Also marked #709386: Schema Version reset to -1 when update.module cache is cleared as duplicate.
Comment #24
frank ralf commentedGetting this error message when manually running the update script:
Fatal error: Class 'DrupalQueue' not found in J:\XAMPP\htdocs\drupal7-HEAD_unpatched\modules\update\update.fetch.inc on line 239Therefore linking this issue to #708832: Fatal error: Class 'DrupalQueue' not found (EDIT, was wrong link).
Comment #25
David_Rothstein commentedI believe this problem (at least as described in #16) is caused by #566494: Running cron in a shutdown function breaks the site and in particular the fact that cron is being called from a shutdown function.
See the notes at http://php.net/manual/en/function.register-shutdown-function.php about the effect of shutdown functions on the working directory of a script, in particular:
If I'm right, the attached patch is a workaround for the problem. But the real fix is probably at #566494: Running cron in a shutdown function breaks the site. I think we should probably mark this a duplicate of that one again, but I haven't read this issue closely enough to know if it encompasses other problems also.
Comment #26
catchThis looks like a duplicate. Let's concentrate efforts there, then re-open this if for some reason there's another issue.
#566494: Running cron in a shutdown function breaks the site
Comment #27
catchComment #28
frank ralf commentedThanks, will try the patch(es) and follow those other queue(s)!