Answers.Body: <p>A contractor had added a directory called "webform" to modules/custom to add some custom configurations to webform. Which worked fine after updating webform module, until you cleared cache. Then Drupal blew up with the above error (similar from drush side) and I got puzzled silence on the call with them.</p>
  
  <p>Turns out Drupal looks in custom first, for module directories, and ignores directories of the same name in contrib. When other stuff tried to reference services in the contrib module, drupal stopped looking for stuff in "webform" at the custom directory of the same name and died.</p>
  
  <p>Hopefully this saves someone some time. Learn from our folly!</p>
  
  <p>Changing the name custom/webform to custom/SITE_NAME_webform (with .info.yml etc name changes) fixed issue.</p>
  
  <p>They're killing me.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-07T21:35:18.443Z
Answers.Text: ok. something to 'quiz' future contractors about perhaps ... "when creating a module to customise an existing module, what would you name the directory, and where would you put it, and why?"
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-07T16:59:19.950Z
Answers.LastActivityDate: 2020-05-07T16:59:19.950Z
Answers.UserDisplayName: Neil Davis
Body: <p>In this case it was webform. Webform services wouldn't load, I couldn't clear cache, clearing db caches manually wouldn't work. All I got was:</p>
  
  <pre><code>[Thu May 07 14:37:33.174757 2020] [php7:notice] [pid 2795] [client x.x.x.x:25119] Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: The service "webform_scheduled_email.manager" has a dependency on a non-existent service "webform.token_manager". in /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 31 #0 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(60): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass-&gt;processValue(Object(Symfony\\Component\\DependencyInjection\\Reference), false)\n#1 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass-&gt;processValue(Array, false)\n#2 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(67): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass-&gt;processValue(Array)\n#3 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass-&gt;processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\n#4 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(60): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass-&gt;processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\n#5 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass-&gt;processValue(Array, true)\n#6 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(39): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass-&gt;processValue(Array, true)\n#7 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/Compiler.php(140): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass-&gt;process(Object(Drupal\\Core\\DependencyInjection\\ContainerBuilder))\n#8 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/ContainerBuilder.php(789): Symfony\\Component\\DependencyInjection\\Compiler\\Compiler-&gt;compile(Object(Drupal\\Core\\DependencyInjection\\ContainerBuilder))\n#9 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(1321): Symfony\\Component\\DependencyInjection\\ContainerBuilder-&gt;compile()\n#10 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(902): Drupal\\Core\\DrupalKernel-&gt;compileContainer()\n#11 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(477): Drupal\\Core\\DrupalKernel-&gt;initializeContainer()\n#12 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(693): Drupal\\Core\\DrupalKernel-&gt;boot()\n#13 /var/www/html/www.actionfund.org/web/index.php(19): Drupal\\Core\\DrupalKernel-&gt;handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#14 {main}
  </code></pre>
  
  <p>Reinstall drupal wouldn't fix it (once custom modules were in).
  Deleting vendor and composer install wouldn't fix it.
  Reloading DB had no effect.
  None of the usual tricks worked.
  I was pulling my hair out.</p>
  
Tags: <modules><missing><custom>
Title: Services from core contrib modules missing!!!! "The service xxxx has a dependency on a non-existent service xxx. " (with solution)
ThreadText: # Services from core contrib modules missing!!!! "The service xxxx has a dependency on a non-existent service xxx. " (with solution)
  
  (Asked by: username_0 on 2020-05-07)
  
  In this case it was webform. Webform services wouldn't load, I couldn't clear cache, clearing db caches manually wouldn't work. All I got was:
  
  ```
  [Thu May 07 14:37:33.174757 2020] [php7:notice] [pid 2795] [client x.x.x.x:25119] Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: The service "webform_scheduled_email.manager" has a dependency on a non-existent service "webform.token_manager". in /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 31 #0 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(60): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object(Symfony\\Component\\DependencyInjection\\Reference), false)\n#1 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Array, false)\n#2 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(67): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Array)\n#3 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\n#4 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(60): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\n#5 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(28): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Array, true)\n#6 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(39): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Array, true)\n#7 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/Compiler/Compiler.php(140): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->process(Object(Drupal\\Core\\DependencyInjection\\ContainerBuilder))\n#8 /var/www/html/www.actionfund.org/vendor/symfony/dependency-injection/ContainerBuilder.php(789): Symfony\\Component\\DependencyInjection\\Compiler\\Compiler->compile(Object(Drupal\\Core\\DependencyInjection\\ContainerBuilder))\n#9 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(1321): Symfony\\Component\\DependencyInjection\\ContainerBuilder->compile()\n#10 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(902): Drupal\\Core\\DrupalKernel->compileContainer()\n#11 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(477): Drupal\\Core\\DrupalKernel->initializeContainer()\n#12 /var/www/html/www.actionfund.org/web/core/lib/Drupal/Core/DrupalKernel.php(693): Drupal\\Core\\DrupalKernel->boot()\n#13 /var/www/html/www.actionfund.org/web/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#14 {main}
  
  ```
  
  Reinstall drupal wouldn't fix it (once custom modules were in).
  Deleting vendor and composer install wouldn't fix it.
  Reloading DB had no effect.
  None of the usual tricks worked.
  I was pulling my hair out.
  
  **Tags:** modules, missing, custom
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-05-07. Score: 2
  
  A contractor had added a directory called "webform" to modules/custom to add some custom configurations to webform. Which worked fine after updating webform module, until you cleared cache. Then Drupal blew up with the above error (similar from drush side) and I got puzzled silence on the call with them.
  
  Turns out Drupal looks in custom first, for module directories, and ignores directories of the same name in contrib. When other stuff tried to reference services in the contrib module, drupal stopped looking for stuff in "webform" at the custom directory of the same name and died.
  
  Hopefully this saves someone some time. Learn from our folly!
  
  Changing the name custom/webform to custom/SITE\_NAME\_webform (with .info.yml etc name changes) fixed issue.
  
  They're killing me.
  
  > **Comments:**
  > **username_1**: ok. something to 'quiz' future contractors about perhaps ... "when creating a module to customise an existing module, what would you name the directory, and where would you put it, and why?"  
  
  ---
  
  