drush entity:save ModuleUsageCommands: Too few arguments to function

Created on 13 April 2024, 11 months ago
Updated 23 April 2024, 11 months ago

Problem/Motivation

D10.2.5.
When executing drush entity:save (https://www.drush.org/12.x/commands/entity_save/)

drush entity:save node 7100 -vvv

you get a message:

[debug] Could not instantiate Drupal\module_usage\Drush\Commands\ModuleUsageCommands: Too few arguments to function Drupal\module_usage\Drush\Commands\ModuleUsageCommands::__construct(), 0 passed in /.../vendor/drush/drush/src/Runtime/ServiceManager.php on line 334 and exactly 2 expected [0.4 sec, 40.69 MB]

the entire debug output is:

$ drush entity:save node 7100 -vvv
 [preflight] Config paths: /.../vendor/drush/drush/drush.yml
 [preflight] Alias paths: /.../web/drush/sites,/var/www/drush/sites
 [preflight] Commandfile search paths: /var/www/vendor/drush/drush/src
 [debug] Bootstrap further to find entity:save [0.28 sec, 12.12 MB]
 [debug] Trying to bootstrap as far as we can [0.28 sec, 12.12 MB]
 [info] Drush bootstrap phase: bootstrapDrupalRoot() [0.28 sec, 12.12 MB]
 [info] Change working directory to /var/www/web [0.28 sec, 12.12 MB]
 [info] Initialized Drupal 10.2.5 root directory at /var/www/web [0.28 sec, 12.17 MB]
 [info] Drush bootstrap phase: bootstrapDrupalSite() [0.28 sec, 12.61 MB]
 [debug] Could not find a Drush config file at sites/default/drush.yml. [0.28 sec, 12.78 MB]
 [info] Initialized Drupal site default at sites/default [0.28 sec, 12.78 MB]
 [info] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.28 sec, 12.78 MB]
 [info] Drush bootstrap phase: bootstrapDrupalDatabase() [0.29 sec, 14.23 MB]
 [info] Successfully connected to the Drupal database. [0.29 sec, 14.23 MB]
 [info] Drush bootstrap phase: bootstrapDrupalFull() [0.29 sec, 14.23 MB]
 [debug] Start bootstrap of the Drupal Kernel. [0.29 sec, 14.23 MB]
 [debug] Finished bootstrap of the Drupal Kernel. [0.32 sec, 23.14 MB]
 [debug] Loading drupal module drush commands & etc. [0.32 sec, 23.14 MB]
 [debug] Found drush.services.yml for feeds Drush commands [0.32 sec, 23.32 MB]
 [debug] Found drush.services.yml for search_api_solr Drush commands [0.32 sec, 23.32 MB]
 [debug] Found drush.services.yml for search_api_solr_admin Drush commands [0.32 sec, 23.32 MB]
 [debug] Found drush.services.yml for token Drush commands [0.32 sec, 23.32 MB]
 [debug] Add a command: twig-tweak:validate [0.38 sec, 37.88 MB]
 [debug] Add a command: twig-tweak:debug [0.38 sec, 37.88 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommands [0.38 sec, 37.88 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommentsCommands [0.38 sec, 37.89 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeSessionsCommands [0.38 sec, 37.89 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserFieldsCommands [0.38 sec, 37.89 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserTableCommands [0.38 sec, 37.9 MB]
 [debug] Add a commandfile class: Drupal\entity_reference_revisions\Commands\EntityReferenceRevisionsCommands [0.38 sec, 37.9 MB]
 [debug] Add a commandfile class: Drupal\entity_usage\Commands\EntityUsageCommands [0.38 sec, 37.9 MB]
 [debug] Add a commandfile class: Drupal\feeds\Commands\FeedsDrushCommands [0.38 sec, 37.91 MB]
 [debug] Add a commandfile class: Drupal\fontawesome\Commands\FontawesomeCommands [0.38 sec, 37.94 MB]
 [debug] Add a commandfile class: Drupal\module_usage\Drush\Commands\ModuleUsageCommands [0.38 sec, 37.94 MB]
 [debug] Add a commandfile class: Drupal\queue_ui\Commands\QueueUiCommands [0.39 sec, 37.95 MB]
 [debug] Add a commandfile class: Drupal\search_api\Commands\SearchApiCommands [0.39 sec, 37.96 MB]
 [debug] Add a commandfile class: Drupal\search_api_solr\Commands\SearchApiSolrCommands [0.39 sec, 38.05 MB]
 [debug] Add a commandfile class: Drupal\search_api_solr_admin\Commands\SearchApiSolrAdminCommands [0.39 sec, 38.08 MB]
 [debug] Add a commandfile class: Drupal\smart_date\Commands\SmartDateDrushCommands [0.39 sec, 38.1 MB]
 [debug] Add a commandfile class: Drupal\token\Commands\TokenCommands [0.39 sec, 38.1 MB]
 [debug] Add a commandfile class: Drupal\ultimate_cron\Commands\UltimateCronCommands [0.39 sec, 38.1 MB]
 [debug] Add a commandfile class: Drupal\upgrade_status\Drush\Commands\UpgradeStatusCommands [0.39 sec, 38.13 MB]
 [debug] Add a commandfile class: Drupal\views_bulk_operations\Commands\ViewsBulkOperationsCommands [0.39 sec, 38.14 MB]
 [debug] Add a commandfile class: Drupal\pathauto\Commands\PathautoCommands [0.39 sec, 38.15 MB]
 [debug] Could not instantiate Drupal\module_usage\Drush\Commands\ModuleUsageCommands: Too few arguments to function Drupal\module_usage\Drush\Commands\ModuleUsageCommands::__construct(), 0 passed in /var/www/vendor/drush/drush/src/Runtime/ServiceManager.php on line 334 and exactly 2 expected [0.4 sec, 40.69 MB]
 [debug] Done with bootstrap max in Application::bootstrapAndFind(): trying to find entity:save again. [0.41 sec, 41.48 MB]
 [info] Starting bootstrap to none [0.42 sec, 41.55 MB]
 [info] Drush bootstrap phase 0 [0.42 sec, 41.55 MB]
 [info] Try to validate bootstrap phase 0 [0.42 sec, 41.55 MB]
 0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0% < 1 sec/< 1 sec 50.5 MiB [debug] Calling Drush\Commands\core\EntityCommands::doSave(node, array) [0.43 sec, 49.71 MB]
 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% < 1 sec/< 1 sec 86.5 MiB

 [success] Saved node entity ids: 7100 [0.57 sec, 81.56 MB]

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

🇦🇹Austria maxilein

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

Comments & Activities

  • Issue created by @maxilein
  • Status changed to Needs review 11 months ago
  • 🇺🇸United States cobblestone.consulting

    Hi @maxilein,
    I am not able to reproduce this issue locally on a minimal install. However, I created a service definition for the drush command and pushed it to the 1.0.0-dev branch. Please let me know if this fixes the issue.

  • Status changed to Closed: cannot reproduce 11 months ago
  • 🇺🇸United States cobblestone.consulting

    Hi @maxilein,
    I have re-reviewed this issue and realized that there is already a drush.services.yml file so I have reverted the update to services.yml. As I mentioned, I am not able to reproduce this issue on a couple of different sites/installs so I am closing this issue.

    Please try: drush cc drush and see if that helps.

    If you are still seeing this issue, please re-open if you are able to provide any additional details.

  • 🇦🇹Austria maxilein

    Thank you. I would, but it says the dev branch Last updated: 29 Feb 2024 ... so where is that push?

  • 🇺🇸United States cobblestone.consulting

    @maxilein, please see #3

Production build 0.71.5 2024