Under certain very specific circumstances, search_api_system_info_alter() can trigger the "module is missing from the file system" error message (new in Drupal 7.50 and newer) which will cause Drush to register an error.

In short, the circumstances are when Drush is using Apps to install a module that wasn't previously in the codebase, which is something Panopoly and some Panopoly-based distributions do during install, which means 'drush si' will fail which breaks many people's automation, including that of some hosting providers.

This is caused by circular dependency where Apps calls system_rebuild_module_data() in order to get the new modules represented on the 'system' table, but before it writes to the system table it invokes hook_system_info_alter() including search_api_system_info_alter(), which (via module_hook()) will call drupal_get_filename('module', 'MODULE') which is what triggers the error because there is no entry on the 'system' table. Of course, once system_rebuild_module_data() finishes, it will exist on the 'system' table so subsequent calls would work, but the error is already registered, causing an error in Drush.

I'll post a patch in a little bit which simply checks if the module is enabled before trying to alter the info data, which has fixed this issue in my testing.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek created an issue. See original summary.

dsnopek’s picture

Status: Active » Needs review
FileSize
516 bytes

Patch is attached!

drunken monkey’s picture

Status: Needs review » Fixed

Seems innocent enough. Committed, thanks!

However, doesn't field_system_info_alter() trigger the same error? It seems it would.

Status: Fixed » Closed (fixed)

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

David_Rothstein’s picture

However, doesn't field_system_info_alter() trigger the same error? It seems it would.

I think not, since it invokes hook_field_info() which does not use the hook "groups" feature and so doesn't reach the problematic code in module_hook().

By the way, note that #1948702: module_hook is broken for disabled modules and included hooks is a core patch that would fix this within module_hook() itself.