I installed Drupal 8.5.6 and Drupal Commerce with Composer. They installed fine, but after I cleared the cache, I got this exception in a WSOD.

Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: "You have requested a non-existent service "extension.list.module"." at C:\wamp\www\drupal-8.5.6\core\lib\Drupal\Component\DependencyInjection\Container.php line 151

I searched for extension.list.module and I found this.

function system_rebuild_module_data() {
  return \Drupal::service('extension.list.module')->reset()->getList();

What did I do wrong to cause this problem?
What is my next step to solve this dilemma?

  • Welcome to Drupal Answers! Are you sure you installed Drupal 8.5.6? Because the code you are showing is used from Drupal 8.6.0.
    – apaderno
    Commented Sep 12, 2018 at 9:11
  • As I thrash my way through the weeds, I believe I must have used composer inappropriately and upgraded drupal core rather than updated the console and commerce. I'll do more thorough research on the lock and json files. Thank you for the observation. I'll look in a different direction for my problem and report back.
    – J W
    Commented Sep 12, 2018 at 13:38
  • The problem is the nut sitting between the chair and the keyboard - me. My drupal was not originally built with composer ergo the code base is not in the subdirectory /web. My composer command to install drupal/commerce was following a script from online and it was overly broad. Drupal commerce was installed in the /web subdirectory. Searching back through my composer listings I found I had invoked a global update command with -dev on it. My solution is to save my theme/module/htaccess/site code: blow away the code base: reinstall drupal with composer and begin my journey again. JW
    – J W
    Commented Sep 12, 2018 at 15:53
  • We all did silly mistakes. You have been able to understand what was wrong, and that is positive. Since you are talking of finding the code base in /web, I guess you used drupal-composer/drupal-project as composer template to install Drupal. When you are allowed to add an answer, you could write it.
    – apaderno
    Commented Sep 12, 2018 at 16:23

1 Answer 1


When Drupal loads some 'foo.bar' service (e.g. \Drupal::service('extension.list.module')), it expects this service to be defined in one of the somemodule/somemodule.services.yml files. For example:

    class: Drupal\somewhere\SomeService

This particular service (extension.list.module) is defined in core/core.services.yml

    class: Drupal\Core\Extension\ModuleExtensionList

This should be available by default, so either the Drupal core files are missing or your lost some integrity of your data in your database. Try rebuilding cache (e.g. drush cache:rebuild), if it fails, manually clear all cache_* tables (especially cache_bootstrap). Otherwise restore your database from the backup.

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.