Steps to recreate:
Our modules exist here:
drush rr —no-cache-clear
drush cc all
I've attached an image of the result.
update.php also triggers this warning - writing an update hook and running the update from the browser will trigger this, as well.
This is where the exception is being caught, and it seems to only occur during the first cache clear: http://cgit.drupalcode.org/drupal/tree/includes/bootstrap.inc?h=7.x#n806
After debugging, it appears that modules from the profiles directory (i.e.
profiles/[distro-name]/modules) does not exist in the
system db table, so the exception is caught and the warnings appear. After that, the modules exist in the
system table and a cache clear runs cleanly.
For example, we have a module that exists called login_disable and this is what happens upon the first cache clear:
$file = profiles/[distro-name]/modules/contrib/login_disable/login_disable.module(http://cgit.drupalcode.org/drupal/tree/includes/bootstrap.inc?h=7.x#n874)
- The module does not exist in the
$files[$type]modules list (http://cgit.drupalcode.org/drupal/tree/includes/bootstrap.inc?h=7.x#n891)
- The module and supposedly missing file does exist in
profiles/[distro-name]/modules(according to our project folder and files)
I can’t imagine we’re the only ones who place distributions inside of the
profiles directory, and according to this it should be an acceptable practice: http://cgit.drupalcode.org/drupal/tree/includes/common.inc?h=7.x#n5506
Hoping for a solution!