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.

Comments

vibrasphere created an issue. See original summary.

greg boggs’s picture

The 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.

fluxsauce’s picture

Title: readdir() error » Drush 9 - readdir() error
Status: Active » Postponed

Thanks for the bug report and the context, I'll hold off making changes until Drush 9 is stable.

hussainweb’s picture

Version: 7.x-1.15 » 7.x-1.x-dev
Status: Postponed » Needs review
StatusFileSize
new6.83 KB

I 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?

ccjjmartin’s picture

I 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.

    if (empty($drupal_root)) {
      return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
    }

I was using Drupal 7.44, DrupalVM Running 4.2.0-42-generic GNU/Linux, Drush 9.0-dev

jrglasgow’s picture

Now that Drush 9 is stable what is the status of getting this to work?

greg.1.anderson’s picture

Drush 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.

greg.1.anderson’s picture

Looks like this is being discussed in https://www.drupal.org/project/site_audit/issues/2968983.