type error on drush cr

Created on 25 June 2023, about 1 year ago
Updated 22 August 2023, about 1 year ago

Setup

  • Solr version: 8.11.1
  • Drupal Core version: 9.5.9
  • Search API version: 8.x-1.29
  • Search API Solr version: 4.2.12
  • Configured Solr Connector: standard

Issue

When executing drush cr, I get the following issue, causing docker container to then crash.

TypeError: Drupal\search_api_solr\Utility\SolrCommandHelper::__construct(): Argument #4 ($configset_controller) must be of type Drupal\search_api_solr\Controller\SolrConfigSetController, Drupal\Core\Extension\ModuleExtensionList given, called in /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in /opt/drupal/web/modules/contrib/search_api_solr/src/Utility/SolrCommandHelper.php on line 45 #0 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\search_api_solr\Utility\SolrCommandHelper->__construct(Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\Core\Extension\ModuleHandler), Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher), Object(Drupal\Core\Extension\ModuleExtensionList))

πŸ’¬ Support request
Status

Fixed

Version

4.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kwfinken Lansing, MI

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

Comments & Activities

  • Issue created by @kwfinken
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    This change is correct. Try to clear your caches.

  • πŸ‡ΊπŸ‡ΈUnited States kwfinken Lansing, MI

    It is when I clear caches (drush cr) that I get the error.

  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    I don't know how you performed your update.

    I just updated another installation and drush cr worked fine. The command helpers are services. It seems that you have overwritten the module's service definition.

  • Status changed to Fixed about 1 year ago
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    I can't reproduce the issue in any production environment I maintain. Maybe you use some custom code or third party module that needs to apply these constructor changes.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed about 1 year ago
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    It looks like it's a permission issue. I also got this error after updating. Everything worked fine in DDEV after the update, but after pushing the update to the server, I got the error after running drush updatedb, drush uli and drush cache:rebuild.

    I also saw an odd error about assets:

    $ drush updatedb
     [success] No pending updates.
     [warning] unlink(/var/www/html/website/public_html/web/sites/default/files/css/css_Dd8YCdHfaQEgt3dWdSVw94rP7EmTUdfBCOWw7Z_fzr8.css): Permission denied FileSystem.php:124
     [error]  Failed to unlink file 'assets://css/css_Dd8YCdHfaQEgt3dWdSVw94rP7EmTUdfBCOWw7Z_fzr8.css'. 
    In FileSystem.php line 326:
    Failed to unlink file 'assets://css/css_Dd8YCdHfaQEgt3dWdSVw94rP7EmTUdfBCOWw7Z_fzr8.css'.
    

    It looks like Drupal updated the permissions for css and js folders after the update, from the original webuser:www-data to www-data:www-data:

    $ ls /public_html/web/sites/default/files/
    [...]
    drwxrwxr-x 2 www-data www-data 4,0K Aug 10 13:34 css
    drwxrwxr-x 2 www-data www-data 4,0K Aug 10 14:13 js
    drwxrwx--- 3 webuser  www-data 4,0K Aug 10 12:46 php

    I restored the permissions β†’ , and all Drush commands now work again, without errors:

    $ cd /public_html/web
    $ chown -R webuser:www-data .
    
Production build 0.71.5 2024