0

Problem

I just tried to revert to a recent backup and got a very strange error.

  • Wiped database.
  • Deleted drupal base folder.
  • Copied in new Drupal folder (from backup).
  • Ran install.php

Re-installing was successful (except for the failure to send an email), but on loading the site I got the following error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite2.languages' doesn't exist: SELECT * FROM {languages} ORDER BY weight ASC, name ASC; Array ( ) in language_list() (line 2727 of /srv/www/mysite2/public/includes/bootstrap.inc).

Any idea what could've caused this?

My Thoughts

I've not restored the the database yet so I don't quite understand what could cause this? None of the modules that I have in my build should begin enabled after a basic install.

But it does seem as if some part of my folders or modules are interfering with a basic drupal install, calling something which doesn't exist yet and blocking me. Even though they shouldn't be enabled.

  • 2
    Are you using redis/memcache? – Clive Jan 6 '14 at 18:07
  • @Clive. You're too smart Clive now I feel like an idiot. Thanks once again! – Dominic Woodman Jan 6 '14 at 18:17
  • 1
    You don't have to run install when restoring a site. All you should need is to restore the site and configuration files, and restore your database snapshot. – keithm Jan 6 '14 at 21:46
  • @keithm Hmm that's interesting. Everytime I've tried to restore using BaM on an existing database I've found it throws some sort of row already exists error. I have to wipe the database, re-install drupal, re-enable BaM and restore then. Presumably I'm missing something? – Dominic Woodman Jan 6 '14 at 21:55
  • 1
    @DominicWoodman If you can, try to restore using external tools, like command line MySQL clients. Running restored site (to get BaM) on unrestored DB causes errors like that. Also, never backup data from {cache} and {cache_%} tables. – Mołot Jan 7 '14 at 8:01
2

Solved by Clive. I had memcached running. It had stored chunks of the code from my original site and tried to run them on the new version. Clearing or restarting memcached solved the problem.

Edit:

An overly simplified explanation of memcached for anyone who's unsure what I'm talking about.

Memcached caches chunks of code. It's best illustrated by a contrast. Varnish caches a static picture of a page and sends that to people when it's requested. It will bypass PHP processing completely.

Memcached won't stop the processing for the page happening each time, but it will remember chunks of the processing and deliver the result straight from the cache.

When I wiped my server and reverted to a backup I forgot to restart memcached. This means that memcached had still remembered chunks of my PHP code. This code didn't fit in with the older revert of my website so I got a horrible error. Restarting memcached or flushing the memcached cache will solve this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.