1

I have a site in development that is currently running Drupal 8 beta 15. As it is on shared hosting without shell access, I'm planning on moving it to a VPS. Updating Drupal 8 via FTP is just far too annoying.

But when I tried to move the site to a new server I encountered a problem. The new server is running Ubuntu 14.04 with PHP 7 on it.

I installed the final Drupal 8 on the server, and then copied the sites, themes and modules folder from my beta site and restored the beta database on the new server.

But now I get the following error when trying to access the site:

PHP message: Uncaught PHP Exception InvalidArgumentException: "$max_age must be an integer" at /var/www/html/drupal/core/lib/Drupal/Core/Cache/CacheableMetadata.php line 81"

I tried drush cr, but that didn't do anything. I also can't execute an updatedb, I get the following error then:

Error: Call to undefined function drupal_get_installed_schema_version() in /var/www/html/drupal/core/includes/install.inc on line 80 Error: Call to undefined function drupal_get_installed_schema_version() in drupal_load_updates() (line 80 of /var/www/html/drupal/core/includes/install.inc).

Any ideas on how to fix this particular error? Or alternatively, a better way to migrate my beta site that doesn't rely on shell access on the server?

  • I once had a similar error with drush updatedb, but update.php in the webbrowser did work, which is now in the root directory. You did not mention it, if you tried this? And you can try to clear the cache tables in the database. – 4k4 Dec 4 '15 at 7:37
  • @4k4 The web version also didn't work. The drush cr should have cleared the cache tables as far as I understand – Mad Scientist Dec 4 '15 at 7:38
  • The drush cr probably did nothing, because of the schema mismatch. When you want to clear the cache, you have to use the old core. – 4k4 Dec 4 '15 at 7:40
  • @4k4 Okay, I'll try to clear the cache manually – Mad Scientist Dec 4 '15 at 7:41
  • 1
    Try smaller steps, not all at once. First move to the new server. Check if everything is OK. Then do the update. Try to update to versions in between, so that you can narrow down the problem and perhaps find something in the issues. – 4k4 Dec 4 '15 at 10:17
3

This particular error comes, when your services.yml file is outdated. It contains the default cache max-age:

The relevant portion looks like this.

parameters:
  renderer.config:
    auto_placeholder_conditions:
      max-age: 0
      contexts: ['session', 'user']
      tags: []

This was added after beta 15, which is why you are seeing that error. Since some portions depend on the default max-age being defined, it will gives error when it isn't.

When updating your site, pre 8.0.0 you need to verify that your services.yml contains the required info.

0

I just had this problem (with 8.0.x HEAD) it was solved by doing a drush updb.

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.