Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal 7.43 / Windows 8.0 x64 XAMPP / Git Bash / Drush 9.0-dev
Trying to run command:
drush aa --html --bootstrap --detail --skip=insights > ~/Desktop/report.html
Infinite spam in console:
readdir() expects parameter 1 to be resource, boolean given Multisite.php:66
E.g. drush ac --html --detail > ~/Desktop/report.html
works and generates the report.
Comment | File | Size | Author |
---|---|---|---|
#4 | drush_9_readdir_error-2691719-4.patch | 6.83 KB | hussainweb |
Comments
Comment #2
Greg BoggsThe issue is that this:
$drupal_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT');
returns an array.
So, I suspect a likely fix is to downgrade your version of drush until site_audit supports the latest drush.
Comment #3
FluxSauce CreditAttribution: FluxSauce commentedThanks for the bug report and the context, I'll hold off making changes until Drush 9 is stable.
Comment #4
hussainwebI understand this happened with Drush 9 but we can handle this for lower Drush versions as well. I tested this since Drush 7 and the constant 'DRUSH_DRUPAL_ROOT' returns the same thing. The attached patch changes the constant in all the locations I found this used. I tested this on a site with Drush 9 and Drush 8.1.2 and both generate the same report.
In any case, I think the error should be handled in a better way. If you want to support previous versions of Drush (which may be supported by this patch but I couldn't test), then we can just test for both constants and check if
$handle
is valid (we should be doing that anyway). Thoughts please?Comment #5
ccjjmartin CreditAttribution: ccjjmartin as a volunteer commentedI can confirm that this patch applied to the latest D7 branch fixed the error. I also agree that an infinite loop isn't the best way to handle this. It appears that $drupal_root is empty when it fails. We could try adding something like this right after the declaration of $drupal_root. I haven't dug into the site audit code too much so returning the info constant might not be the best way to handle this.
I was using Drupal 7.44, DrupalVM Running 4.2.0-42-generic GNU/Linux, Drush 9.0-dev
Comment #6
jrglasgow CreditAttribution: jrglasgow commentedNow that Drush 9 is stable what is the status of getting this to work?
Comment #7
greg.1.anderson CreditAttribution: greg.1.anderson at Pantheon commentedDrush 9 has a new extension API that is not compatible with the Drush 8 extension API. The extension must be ported to the new API to be used with Drush 9.
Comment #8
greg.1.anderson CreditAttribution: greg.1.anderson at Pantheon commentedLooks like this is being discussed in https://www.drupal.org/project/site_audit/issues/2968983.