ArgumentCountError: Too few arguments on local copy

Created on 14 November 2024, 1 day ago

Problem/Motivation

Website is online and running with spammaster.
When I make a dump of database to run local, I get this error :

The website encountered an unexpected error. Please try again later.
ArgumentCountError: Too few arguments to function Drupal\spammaster\SpamMasterCollectService::__construct(), 1 passed in /Users/****/***/****/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 2 expected in Drupal\spammaster\SpamMasterCollectService->__construct() (line 39 of modules/contrib/spammaster/src/SpamMasterCollectService.php).
💬 Support request
Status

Active

Version

2.41

Component

Code

Created by

🇧🇪Belgium pascalmortier

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @pascalmortier
  • 🇵🇹Portugal pedro-alves

    Hi pascalmortier,
    Thanks for posting.
    Please upgrade the module to latest stable 2.51 and clear cache. Afterwards retry the database dump.

  • 🇧🇪Belgium pascalmortier

    Thank you for your quick response!
    Not working after login... now I have WSOD after login.
    No apache or php errors...

  • 🇵🇹Portugal pedro-alves

    You need to clean your cache. If you are not able via frontend you can do it from backend composer or drush.
    You may also do it with phpmyadmin, quick google search
    https://www.zymphonies.com/blog/clear-or-rebuild-drupal-cache

  • 🇧🇪Belgium pascalmortier

    @pedro-alves, i did it. Cache cleared by truncating all cache tables.

  • 🇵🇹Portugal pedro-alves

    Great... and the database dump?

  • 🇧🇪Belgium pascalmortier

    @pedro-alves : i make also a dump, not working
    (and I cleared cache before making dump)

  • 🇵🇹Portugal pedro-alves

    I see, let me take a look. I will post back.

  • 🇵🇹Portugal pedro-alves

    Is the error exactly the same? Can you post here the error log.
    Thanks

  • 🇧🇪Belgium pascalmortier

    No I have a white screen, no errors. I make a dump with module backup_migrate and import local with sequel ace

  • 🇵🇹Portugal pedro-alves

    I recommend updating those modules to latest versions also.
    Because the spammaster version 2.51 fixed issues of older 2.xx and what you are reporting is not present anymore in 2.51.

    Really make sure you clean the cache. The file spammaster.services.yml in spammaster module root folder should look like this on line 31,32,33

      spammaster.collect_service:
        class: Drupal\spammaster\SpamMasterCollectService
        arguments: ['@request_stack', '@config.factory']

    I recommend these steps:
    1. Upgrade those backup modules
    2. If problem persists, check the server error logs to trace the error.

  • 🇧🇪Belgium pascalmortier

    I updated to that version and spammaster.services.yml contains the spammaster.collect.service lines.
    Maybe it has something to do with another module?
    It is not the first time I get this error. Also on other projects.
    I guess it is because spammaster tries to connect with the spammaster service but the domain name is not the same on my localhost.
    I look further and if I find a solution, I will let it know.
    Thanks a lot for your time and investigation!

  • 🇵🇹Portugal pedro-alves

    No problem. Closing the issue.
    Feel free to open another one if you discover something else.

Production build 0.71.5 2024