Today I updated my Drupal installation from version 7.28 to version 7.31. I followed the same procedure I used for any other update. After I copied all the necessary files I visited my website to run the update script but all I could see is a blank page. I checked the apache2 log and I found this error which keeps repeating over and over:

[Sat Aug 23 00:22:18 2014] [warn] mod_fcgid: stderr: PHP Fatal error:  Cannot redeclare class InsertQuery in /path/to/drupal/includes/database/query.inc on line 728
[Sat Aug 23 00:22:18 2014] [warn] mod_fcgid: stderr: PHP Fatal error:  Class 'SelectQuery_mysql' not found in /path/to/drupal/includes/database/database.inc on line 813
[Sat Aug 23 00:22:18 2014] [warn] mod_fcgid: stderr: PHP Fatal error:  Cannot redeclare class InsertQuery in /path/to/drupal/includes/database/query.inc on line 728
[Sat Aug 23 00:22:18 2014] [warn] mod_fcgid: stderr: PHP Fatal error:  Class 'SelectQuery_mysql' not found in /path/to/drupal/includes/database/database.inc on line 813
[Sat Aug 23 00:23:47 2014] [warn] mod_fcgid: stderr: PHP Fatal error:  Cannot redeclare class InsertQuery in /path/to/drupal/includes/database/query.inc on line 728

If I empty the Drupal cache (using mysql shell) I can visit my website but as soon as I switch page the same error appears again (I guess because the cache is rebuilt)

Comments

danielepantaleone’s picture

Issue summary: View changes
dcam’s picture

Normally I advise people to try disabling contributed modules to attempt to find the source of the problem, but it sounds like that may not be possible in your case. That is, unless reverting the code to the earlier version fixes the errors or you can use Drush to disable them. Though I imagine if you could use Drush then you would just run drush updb to perform the database updates.

So, I think I would advise trying to downgrade back to 7.28. Then retry the update on a test server with contrib or custom modules disabled.

danielepantaleone’s picture

I tried both solution and they didn't work. I downgraded back to 7.28 but still I wasn't able to access the website.
So I re-updated to 7.31, installed drush and run the command you described above: this is the output:

root@zulu1170:~# drush -r /var/www/goreclan updb
No database updates required                                                                                                 [success]
require_once(/var/www/goreclan/includes/includes/entity.inc): failed to open stream: No such file or directory               [warning]
bootstrap.inc:3146
Drush command terminated abnormally due to an unrecoverable error.                                                           [error]
Error: require_once(): Failed opening required '/var/www/goreclan/includes/includes/entity.inc'
(include_path='.:/usr/share/php:/usr/share/pear') in /var/www/goreclan/includes/bootstrap.inc, line 3146
PHP Fatal error:  require_once(): Failed opening required '/var/www/goreclan/includes/includes/entity.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/goreclan/includes/bootstrap.inc on line 3146
Fatal error: require_once(): Failed opening required '/var/www/goreclan/includes/includes/entity.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/goreclan/includes/bootstrap.inc on line 3146
The external command could not be executed due to an application error.                                                      [error]
Finished performing updates.                                                                                                 [ok]

which is actually the very same error being shown in the browser (after enabling error display:

Fatal error: require_once(): Failed opening required '/var/www/goreclan/includes/includes/database/select.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/goreclan/includes/bootstrap.inc on line 3168

what is weird is that /var/www/goreclan/includes/includes/entity.in includes/includes is appended automatically to the root directory I specified. Any other solution?

dcam’s picture

The double includes directory is strange. When you updated did you accidentally overwrite any customizations to you .htaccess file?

This is starting to sound more like a server configuration issue which isn't really my area of expertise. I think I'll have to direct you elsewhere. The core issue queue isn't really meant for providing people with support. That issue category is intended more for contrib modules. I do what I can for people who come here, but sometimes I can't help. I advise clicking on the Support link at the top of the page to find other ways of getting support for this issue. The support forum or IRC would be better.

danielepantaleone’s picture

Alright, I will go in IRC and try to speak with someone there.
Anyway I was using the .htaccess file provided by Drupal without any customization.
Also core files have never been touched.
It's not possible that it's a server configuration issue since I run other 4 Drupal websites on the same machine (using the very same web server). They work because I didn't update them after the first failure.

My guess is that the update process broke something in the database thus now everything fails.

It's kinda weird tho...

danielepantaleone’s picture

Status: Active » Fixed

I managed to fix the problem. I will post here my solution just in case someone need it:

  • Make a new Drupal installation (using a separarate database)
  • Export from the new database the tables registry and registry_file
  • On the "corrupted" database, truncate the very same tables and import the ones just exported from the new Drupal database
  • Visit your website and clear the cache

Status: Fixed » Closed (fixed)

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

tondeuse’s picture

Thank you, this piece of advice has saved me tons of time (Drupal 7.37, lots of modules).

Only detail, it is requierd that you rebuild the registry of your site after replacing the content of the registry and registry_file tables with those from a brand new site of the same version. Look this way for a solution, you will need to have drush installed on your server. https://www.drupal.org/project/registry_rebuild

giorgio79’s picture