2

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?

7
  • 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.
    – 4uk4
    Dec 4, 2015 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 Dec 4, 2015 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.
    – 4uk4
    Dec 4, 2015 at 7:40
  • 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.
    – 4uk4
    Dec 4, 2015 at 10:17
  • 1
    It's possible that something is wrong with the upgrade path from Beta15 straight to 8.0.0; there were issues that addressed previous upgrade paths. You may want to try B15 -> RC1 and then RC1 -> 8.0.0 if you can.
    – mpdonadio
    Dec 8, 2015 at 15:22

2 Answers 2

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 and acknowledge you have read our privacy policy.

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