So a simple site (less than 300 nodes), running modules Views, CCK, Wysiwyg, Vertical Tabs, jQuery update, Image, Token, Pathauto and Poormanscron besides the Core modules was to be updated. The site has been updated since 6.5 (I think) and never had an issue, it has been running smoothly and no hickups at all the last few versions… Another site with about 500 nodes and many more modules on the same web server made the update without any problems.

Now I get this error when I am trying to access update.php:
Fatal error: Call to undefined function user_access() in /users/home/[removed]/domains/[removed]/web/public/includes/theme.inc on line 980

I immediately returned my backup files from version 6.16 but the error is still there! I tried editing the database tables to disable non-core modules but without luck. I tried setting chmod 755 to all files in the directory but alas, no solution in sight.

What should I try next?

Comments

NiklasBr’s picture

Trying 6.x-dev changes nothing.

Why isn't the Drupal reverting to it's correct state when I never even got the chance to run the update script and then returned any old files?

NiklasBr’s picture

I found the solution, turns out the user module got disabled for some reason, reaching into the {system} table and setting status to 1, this is the query from phpmyadmin for anyone curious (replace "your_database" and "prefix" with appropriate names):

UPDATE  `your_database`.`prefix_system` SET  `status` =  '1' WHERE
CONVERT(  `prefix_system`.`filename` USING utf8 ) =
'modules/user/user.module' LIMIT 1

I feel dumbfounded on how this could have happened in the first place. Error and database logs tell no story and the User module ought to have been active all the time, the whole site is very user-profile centric and relies heavily on CCK/views on user profile values to populate the site with content.

tom-knox’s picture

Thank you Niklas, why is this not better documented by the higher ups? That's what i don't understand

jadvies’s picture

I had already been looking around for a couple of days what could be the fault I couldn't update Drupal 6.10 to 6.17. And your post gave a lot of insight.
It seems that Drupal makes backups of the modules in the sites/all/ directory. I wasn't aware of this. Now I had all kinds of modules all over the place. I have to reorganize the system table to let the modules be found in the correct directory; system table indicates that the custom modules are in the core module directory, while that is not the case.
Anyway, it's a mess I have to clean up. I will prolly empty the system table and fill it with an sql statement with the data I backed up. Good thing I always backup before updates.

BlueIrisNina’s picture

I'm having this problem as well since updating to Drupal 6.17. I have deleted the duplcate sites backup files that were produced when I upgraded.

When I try to run the database update script and put the site in Maintenance mode I get this error:Fatal error: Call to undefined function user_access() in /home/content/.... /sites/all/modules/admin_menu/admin_menu.module on line 82.

Additionally, when I get this error the database file in the system table and user.module resets it's status to 0 and I have to go into phpmyadmin and reset it to 1.

Any thoughts on how to get my database update script to function again?

Thanks.

NiklasBr’s picture

Just a guess, but have you tried this repairing your database tables, then updating the table like I did followed by running update.php?