I just upgraded Drupal core from 8.3.7 to 8.4.0. This was a simple overwrite via git repository on our service provider's servers.

But now, every page (including update.php) on the site gives just a blank page and from the server logs I got the reason for this:

PHP Fatal error: Declaration of Drupal\Component\DependencyInjection\Container::set() must be compatible with Symfony\Component\DependencyInjection\ContainerInterface::set($id, $service, $scope = self::SCOPE_CONTAINER) in /srv/data/web/vhosts/www.nlpapi.com/htdocs/core/lib/Drupal/Component/DependencyInjection/Cont... on line 47

So, this is apparently something related to the changes in Symfony version requirements, but somehow this puzzles me since all the affected should be directly from the distribution package unless I somehow fumbled with the upgrade...

Comments

Hezu created an issue. See original summary.

cilefen’s picture

What was the upgrade process performed on this site?

cilefen’s picture

Title: Upgrade from 8.3.7 to 8.4.0 resulted non-working site » Upgrade from 8.3.7 to 8.4.0 results in fatal "Drupal\Component\DependencyInjection\Container::set() must be compatible with Symfony\Component\DependencyInjection\ContainerInterface::set()"
oleg90990’s picture

I'm getting the same problem ..

My actions:

- updated drupal core up to 8.4
- composer update

root@ubuntu /var/www/html (master *=) $ drupal cache:rebuild all
PHP Fatal error:  Declaration of Drupal\Component\DependencyInjection\Container::set() must be compatible with Symfony\Component\DependencyInjection\ContainerInterface::set($id, $service, $scope = self::SCOPE_CONTAINER) in /var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 47


cilefen’s picture

Issue tags: +8.4.0 update
Hezu’s picture

What was the upgrade process performed on this site?

1. Turn on maintenance mode on the site
2. On local computer: unpack the Drupal distribution, copy files to a local git repository, commit the changes to the remote git repository
3. Deploy the new version from the remote git repository to the webserver
4. Try to run update.php (and get the error)

cilefen’s picture

Can you examine and compare the referenced function signatures on the file system?

cilefen’s picture

Did you do the following as per UPDATE.txt?

Remove the 'core' and 'vendor' directories. Also remove all of the files
in the top-level directory, except any that you added manually.

xjm’s picture

Status: Active » Postponed (maintainer needs more info)

@Hezu: If your site is built from a git checkout, you should run composer install again after the update, and then try running update.php through the UI only after you've done the composer install.

To @oleg90990 in #4, can you clarify what steps you took to update core to 8.4?

Hezu’s picture

Didn't yet venture into composer usage, but I can report that removal and reinstall of core and vendor directories did get the site back in working condition.

cilefen’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I'm glad to hear it.

shasha821110’s picture

it do help me solve the problem as well :)