Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Class 'Drupal\Core\ContentNegotiation' not found #1597

Closed
huijing opened this issue Sep 6, 2015 · 6 comments
Closed

PHP Fatal error: Class 'Drupal\Core\ContentNegotiation' not found #1597

huijing opened this issue Sep 6, 2015 · 6 comments

Comments

@huijing
Copy link

huijing commented Sep 6, 2015

The error occurred when I ran drush pm-update on Drupal 8 Beta 14 to upgrade to Beta 15. The terminal output is as follows. This issue does not appear to have any significant implications from a functionality perspective. Drush version used is 8.0-dev.

Project drupal was updated successfully. Installed version is now 8.0.0-beta15.
Backups were saved into the directory                                [ok]
/Users/huijing/drush-backups/drupal8/20150906061232/drupal.
The following updates are pending:

system module :
  8002 -   Removes the system.filter configuration.
  8003 -   Change the index on the {router} table.
  8004 -   Add a (id, default_langcode, langcode) composite index to entities.
  8005 -   Place local actions and tasks blocks in every theme.

block_content module :
  8001 -   Add 'revision_translation_affected' field to 'block_content' entities.

node module :
  8001 -   Add 'revision_translation_affected' field to 'node' entities.
  8002 -   Remove obsolete indexes from the node schema.
  8003 -   Promote 'status' and 'uid' fields to entity keys.

views module :
  8001 -   Update views field plugins.

Do you wish to run all pending updates? (y/n): y
Performing system_update_8002                                        [ok]
Performing node_update_8001                                          [ok]
Performing system_update_8003                                        [ok]
Performing system_update_8004                                        [ok]
Performing node_update_8002                                          [ok]
Performing views_update_8001                                         [ok]
Performing node_update_8003                                          [ok]
Performing block_content_update_8001                                 [ok]
Performing system_update_8005                                        [ok]
Cache rebuild complete.                                              [ok]
Finished performing updates.                                         [ok]
PHP Fatal error:  Class 'Drupal\Core\ContentNegotiation' not found in /Users/huijing/Sites/drupal8.dev/sites/default/files/php/service_container/service_container_prod_ea32c1db/23f1dc7affe14d8f38dc8fa6237453e184f2f1d6dcf062466ca1fc6f60ff10e6.php on line 4257

Fatal error: Class 'Drupal\Core\ContentNegotiation' not found in /Users/huijing/Sites/drupal8.dev/sites/default/files/php/service_container/service_container_prod_ea32c1db/23f1dc7affe14d8f38dc8fa6237453e184f2f1d6dcf062466ca1fc6f60ff10e6.php on line 4257
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: Class 'Drupal\Core\ContentNegotiation' not found in
/Users/huijing/Sites/drupal8.dev/sites/default/files/php/service_container/service_container_prod_ea32c1db/23f1dc7affe14d8f38dc8fa6237453e184f2f1d6dcf062466ca1fc6f60ff10e6.php,
line 4257
@jonhattan
Copy link
Member

This seems a spurious error, due to Remove ContentNegotiation and embed functionality in the middleware. The http_negotiation.format_negotiator service has been removed and the service container needs to be recompiled. I don't understand why the cache rebuild didn't do it though.

@sebastianwestberg
Copy link

Same thing happened to me. No visible errors on the site though, everything seems to work.

@jalama
Copy link

jalama commented Sep 9, 2015

+1 on getting the error updating beta14 -> beta15, I'm working on the CLI side on automation stuff so using sqlite.

git status and drush st, indicating the update happened as expected:

Drupal version : 8.0.0-beta15
Site URI : 127.0.0.1:8888
Database driver : sqlite
Database name : Users//.drupdates/builds/drupal/drupal.sqlite
Drupal bootstrap : Successful
Drupal user : Anonymous
Default theme : stark
Administration theme : seven
PHP executable : /usr/bin/php
PHP configuration :
PHP OS : Darwin
Drush script : /Users//.composer/vendor/drush/drush/drush.php
Drush version : 8.0-dev
Drush temp directory : /tmp
Drush configuration : /Users//.drupdates/builds/drupal/drush/drushrc.php
Drush alias files : /Users//.drush/pantheon.aliases.drushrc.php /Users//.drush/test.aliases.drushrc.php
Install profile : minimal
Drupal root : /Users/jdtaylor/.drupdates/builds/drupal
Site path : sites/default
File directory path : sites/default/files
Temporary file directory path : /tmp
Staging config path : sites/default/files/config_DPibyttQ9YXkz3hemrPD_X8mLXCpsNeHTQ4aom5MpRZGyEieJV73POTsOq6YE4yeXuZyqIjpTQ/staging

@christianmgrupp
Copy link

The error is also occurring going from beta 13 to beta 15. The site generally seems to be working otherwise.

@AndyLicht
Copy link

I get the same error, after that i can not create views, contenttypes or content.
I'm using postgres.

So, i tested to clear the cache, by step 5 i got this error:
Enter a number to choose which cache to clear.
[0] : Cancel
[1] : drush
[2] : theme-registry
[3] : menu
[4] : css-js
[5] : block
[6] : module-list
[7] : theme-list
[8] : render
[9] : views
5
exception 'Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException' with message 'You have requested a [error]
non-existent service "cache.block".' in
/var/www/html/hemcau/core/lib/Drupal/Component/DependencyInjection/Container.php:161
Stack trace:
#0 /var/www/html/hemcau/core/lib/Drupal.php(282): Drupal\Component\DependencyInjection\Container->get('cache.block')
#1 /root/.composer/vendor/drush/drush/commands/core/drupal/cache_8.inc(79): Drupal::cache('block')
#2 /root/.composer/vendor/drush/drush/includes/drush.inc(718): drush_cache_clear_block()
#3 /root/.composer/vendor/drush/drush/includes/drush.inc(705): drush_call_user_func_array('drush_cache_cle...', Array)
#4 /root/.composer/vendor/drush/drush/commands/core/cache.drush.inc(143): drush_op('drush_cache_cle...')
#5 [internal function]: drush_cache_command_clear()
#6 /root/.composer/vendor/drush/drush/includes/command.inc(368): call_user_func_array('drush_cache_com...', Array)
#7 /root/.composer/vendor/drush/drush/includes/command.inc(219): _drush_invoke_hooks(Array, Array)
#8 [internal function]: drush_command()
#9 /root/.composer/vendor/drush/drush/includes/command.inc(187): call_user_func_array('drush_command', Array)
#10 /root/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(62): drush_dispatch(Array)
#11 /root/.composer/vendor/drush/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12 /root/.composer/vendor/drush/drush/drush.php(11): drush_main()
#13 {main}

@weitzman
Copy link
Member

Not a Drush issue. These are the troubles one has to fix (sometimes by hand) when adopting a Drupal 8 beta. We have no resources to support it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants