Score:0

Site error on Drupal 9 on Acquia Dev Desktop

nl flag
[Sat Sep 04 15:52:46.939952 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:49930] mod_fcgid: stderr: #21 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))
[Sat Sep 04 15:52:46.939952 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:49930] mod_fcgid: stderr: #22 {main}
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: ArgumentCountError: Too few arguments to function Drupal\\hello_world\\Logger\\MailLogger::__construct(), 0 passed in C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php on line 257 and exactly 2 expected in C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\modules\\custom\\hello_world\\src\\Logger\\MailLogger.php on line 41 #0 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(257): Drupal\\hello_world\\Logger\\MailLogger->__construct()
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #1 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(171): Drupal\\Component\\DependencyInjection\\Container->createService(Array, 'hello_world.log...')
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #2 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(432): Drupal\\Component\\DependencyInjection\\Container->get('hello_world.log...', 1)
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #3 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(271): Drupal\\Component\\DependencyInjection\\Container->resolveServicesAndParameters(Array)
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #4 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(171): Drupal\\Component\\DependencyInjection\\Container->createService(Array, 'logger.factory')
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #5 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(432): Drupal\\Component\\DependencyInjection\\Container->get('logger.factory', 1)
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #6 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(247): Drupal\\Component\\DependencyInjection\\Container->resolveServicesAndParameters(Array)
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #7 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(171): Drupal\\Component\\DependencyInjection\\Container->createService(Array, 'logger.channel....')
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #8 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(432): Drupal\\Component\\DependencyInjection\\Container->get('logger.channel....', 1)
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #9 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(235): Drupal\\Component\\DependencyInjection\\Container->resolveServicesAndParameters(Array)
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #10 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(171): Drupal\\Component\\DependencyInjection\\Container->createService(Array, 'form_validator')
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #11 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(432): Drupal\\Component\\DependencyInjection\\Container->get('form_validator', 1)
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #12 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(235): Drupal\\Component\\DependencyInjection\\Container->resolveServicesAndParameters(Array)
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #13 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php(171): Drupal\\Component\\DependencyInjection\\Container->createService(Array, 'form_builder')
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #14 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\lib\\Drupal.php(599): Drupal\\Component\\DependencyInjection\\Container->get('form_builder')
[Sat Sep 04 15:54:08.049773 2021] [fcgid:warn] [pid 8276:tid 4] [client 127.0.0.1:50615] mod_fcgid: stderr: #15 C:\\Users\\jeanp\\Sites\\devdesktop\\drupal-9-project-9.0.3\\core\\modules\\views\\src\\Plugin\\views\\exposed_form\\ExposedFormPluginBase.php(134): Drupal::formBuilder()
  • The class MailLogger has two parameters that are fed in the module's services.yml file:
hello_world.logger.mail_logger:
    class: Drupal\hello_world\Logger\MailLogger
    arguments: ['@logger.log_message_parser', '@config.factory']
    tags:
      - { name: logger }
  • I don't understand why the 2 parameters of MailLogger are considered missing ?
Jaypan avatar
de flag
You didn't show us the code where you are calling the controller.
leymannx avatar
ne flag
I’m voting to close this question because it's a bug report to a third-party project hosted on drupal.org or elsewhere. Please file a bug report [there](https://github.com/PacktPublishing/Drupal-9-Module-Development-Third-Edition/issues), not here on Drupal Answers. Many thanks
Score:1
fr flag
  1. Your first point of contact should be the author of that code, who got paid to write that code. That is the person who should be providing the support.
  2. Search the internet. If that code is faulty, then there will certainly be a bug report somewhere that reports the same error as you. If you can't find a similar report, chances are the problem is on your end and not with the code.
  3. That code seems to be written for Drupal 9.0. That is not the current version of Drupal. If you are using as more current version of Drupal, it's entirely possible that changes to Drupal have caused that code to stop working. Use the version of Drupal that the code was designed for and see if it works there. If it does, then the code needs to be updated.
  4. If you have changed the code in any way, like changing the name of the module, then again chances are you've done something wrong. Don't make any changes at all, no matter how trivial, until after you get the code running.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.