Since #1081266: Avoid re-scanning module directory when a filename or a module is missing was committed, running a test locally on Ubuntu 14.10 with PHP5.6 (and on Travis with PHP 5.4/5.5/5.6), results in the following error:

PHP Warning:  The following module is missing from the file system: standard in core/includes/bootstrap.inc on line 254
PHP Stack trace:
PHP   1. {main}() core/scripts/run-tests.sh:0
PHP   2. Drupal\Core\DrupalKernel->prepareLegacyRequest() core/scripts/run-tests.sh:39
PHP   3. Drupal\Core\DrupalKernel->preHandle() core/lib/Drupal/Core/DrupalKernel.php:611
PHP   4. Drupal\Core\Config\ConfigFactory->get() core/lib/Drupal/Core/DrupalKernel.php:510
PHP   5. Drupal\Core\Config\ConfigFactory->doGet() core/lib/Drupal/Core/Config/ConfigFactory.php:94
PHP   6. Drupal\Core\Config\ConfigFactory->doLoadMultiple() core/lib/Drupal/Core/Config/ConfigFactory.php:109
PHP   7. Drupal\Core\Config\FileStorage->readMultiple() core/lib/Drupal/Core/Config/ConfigFactory.php:166
PHP   8. Drupal\Core\Config\FileStorage->read() core/lib/Drupal/Core/Config/FileStorage.php:118
PHP   9. Drupal\Core\Config\InstallStorage->exists() core/lib/Drupal/Core/Config/FileStorage.php:96
PHP  10. Drupal\Core\Config\InstallStorage->getAllFolders() core/lib/Drupal/Core/Config/InstallStorage.php:103
PHP  11. Drupal\Core\Extension\ExtensionDiscovery->scan() core/lib/Drupal/Core/Config/InstallStorage.php:173
PHP  12. Drupal\Core\Extension\ExtensionDiscovery->setProfileDirectoriesFromSettings() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:140
PHP  13. drupal_get_path() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:219
PHP  14. drupal_get_filename() core/includes/bootstrap.inc:277
PHP  15. trigger_error() core/includes/bootstrap.inc:254

Warning: The following module is missing from the file system: standard in core/includes/bootstrap.inc on line 254

Call Stack:
    0.0013     443784   1. {main}() core/scripts/run-tests.sh:0
    0.0098    2021424   2. Drupal\Core\DrupalKernel->prepareLegacyRequest() core/scripts/run-tests.sh:39
    0.4680   15314288   3. Drupal\Core\DrupalKernel->preHandle() core/lib/Drupal/Core/DrupalKernel.php:611
    0.4885   15220720   4. Drupal\Core\Config\ConfigFactory->get() core/lib/Drupal/Core/DrupalKernel.php:510
    0.4885   15220896   5. Drupal\Core\Config\ConfigFactory->doGet() core/lib/Drupal/Core/Config/ConfigFactory.php:94
    0.4885   15221520   6. Drupal\Core\Config\ConfigFactory->doLoadMultiple() core/lib/Drupal/Core/Config/ConfigFactory.php:109
    0.4885   15222056   7. Drupal\Core\Config\FileStorage->readMultiple() core/lib/Drupal/Core/Config/ConfigFactory.php:166
    0.4885   15222624   8. Drupal\Core\Config\FileStorage->read() core/lib/Drupal/Core/Config/FileStorage.php:118
    0.4885   15222664   9. Drupal\Core\Config\InstallStorage->exists() core/lib/Drupal/Core/Config/FileStorage.php:96
    0.4885   15222936  10. Drupal\Core\Config\InstallStorage->getAllFolders() core/lib/Drupal/Core/Config/InstallStorage.php:103
    0.5070   15247960  11. Drupal\Core\Extension\ExtensionDiscovery->scan() core/lib/Drupal/Core/Config/InstallStorage.php:173
    0.5070   15248144  12. Drupal\Core\Extension\ExtensionDiscovery->setProfileDirectoriesFromSettings() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:140
    0.5070   15248328  13. drupal_get_path() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:219
    0.5070   15248328  14. drupal_get_filename() core/includes/bootstrap.inc:277
    0.5082   15367016  15. trigger_error() core/includes/bootstrap.inc:254

PHP Warning:  strpos(): Empty needle in core/lib/Drupal/Core/Extension/ExtensionDiscovery.php on line 270
PHP Stack trace:
PHP   1. {main}() core/scripts/run-tests.sh:0
PHP   2. Drupal\Core\DrupalKernel->prepareLegacyRequest() core/scripts/run-tests.sh:39
PHP   3. Drupal\Core\DrupalKernel->preHandle() core/lib/Drupal/Core/DrupalKernel.php:611
PHP   4. Drupal\Core\Config\ConfigFactory->get() core/lib/Drupal/Core/DrupalKernel.php:510
PHP   5. Drupal\Core\Config\ConfigFactory->doGet() core/lib/Drupal/Core/Config/ConfigFactory.php:94
PHP   6. Drupal\Core\Config\ConfigFactory->doLoadMultiple() core/lib/Drupal/Core/Config/ConfigFactory.php:109
PHP   7. Drupal\Core\Config\FileStorage->readMultiple() core/lib/Drupal/Core/Config/ConfigFactory.php:166
PHP   8. Drupal\Core\Config\FileStorage->read() core/lib/Drupal/Core/Config/FileStorage.php:118
PHP   9. Drupal\Core\Config\InstallStorage->exists() core/lib/Drupal/Core/Config/FileStorage.php:96
PHP  10. Drupal\Core\Config\InstallStorage->getAllFolders() core/lib/Drupal/Core/Config/InstallStorage.php:103
PHP  11. Drupal\Core\Extension\ExtensionDiscovery->scan() core/lib/Drupal/Core/Config/InstallStorage.php:173
PHP  12. Drupal\Core\Extension\ExtensionDiscovery->filterByProfileDirectories() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:190
PHP  13. array_filter() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:277
PHP  14. Drupal\Core\Extension\ExtensionDiscovery->Drupal\Core\Extension\{closure}() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:277
PHP  15. strpos() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:270

Warning: strpos(): Empty needle in core/lib/Drupal/Core/Extension/ExtensionDiscovery.php on line 270

Call Stack:
    0.0013     443784   1. {main}() core/scripts/run-tests.sh:0
    0.0098    2021424   2. Drupal\Core\DrupalKernel->prepareLegacyRequest() core/scripts/run-tests.sh:39
    0.4680   15314288   3. Drupal\Core\DrupalKernel->preHandle() core/lib/Drupal/Core/DrupalKernel.php:611
    0.4885   15220720   4. Drupal\Core\Config\ConfigFactory->get() core/lib/Drupal/Core/DrupalKernel.php:510
    0.4885   15220896   5. Drupal\Core\Config\ConfigFactory->doGet() core/lib/Drupal/Core/Config/ConfigFactory.php:94
    0.4885   15221520   6. Drupal\Core\Config\ConfigFactory->doLoadMultiple() core/lib/Drupal/Core/Config/ConfigFactory.php:109
    0.4885   15222056   7. Drupal\Core\Config\FileStorage->readMultiple() core/lib/Drupal/Core/Config/ConfigFactory.php:166
    0.4885   15222624   8. Drupal\Core\Config\FileStorage->read() core/lib/Drupal/Core/Config/FileStorage.php:118
    0.4885   15222664   9. Drupal\Core\Config\InstallStorage->exists() core/lib/Drupal/Core/Config/FileStorage.php:96
    0.4885   15222936  10. Drupal\Core\Config\InstallStorage->getAllFolders() core/lib/Drupal/Core/Config/InstallStorage.php:103
    0.5070   15247960  11. Drupal\Core\Extension\ExtensionDiscovery->scan() core/lib/Drupal/Core/Config/InstallStorage.php:173
    0.5085   15377832  12. Drupal\Core\Extension\ExtensionDiscovery->filterByProfileDirectories() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:190
    0.5085   15378240  13. array_filter() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:277
    0.5086   15388312  14. Drupal\Core\Extension\ExtensionDiscovery->Drupal\Core\Extension\{closure}() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:277
    0.5086   15388592  15. strpos() core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:270
Files: 
CommentFileSizeAuthor
#21 2486083-21.patch689 bytesDevin Carlson
#6 2486083-5.patch923 bytesstefan.r
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 92,431 pass(es). View

Comments

iMiksu’s picture

I can confirm this.

benjy’s picture

Issue summary: View changes
fgm’s picture

Same here on Ubuntu 12.04 LTS with PHP 5.6, opcache enabled, no apcu enabled.

eiriksm’s picture

For completion, me too:

Tested on Mac OS x with PHP 5.5.20 and PHP 5.6.7 (both on on the CLI).

Sweetchuck’s picture

Same here on
openSUSE 13.1
PHP version 5.4.20 (official)
PHP version 5.5.21 (custom compile)

php ./core/scripts/run-tests.sh --url http://5521-dev.d8-dev.localhost:1080 --color --verbose --die-on-fail --module mymodule

stefan.r’s picture

Status: Active » Needs review
FileSize
923 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 92,431 pass(es). View

We need to do the same thing in InstallStorage as we do in ExtensionInstallStorage, untested patch attached

Odd that our testbot didn't catch this...

Sweetchuck’s picture

Patch #6 solves the problem. (All the PHP warnings are disappeared)

jeroen.b’s picture

Patch #6 solves it for me too. Think we can RTBC this directly after testbot completes.

eiriksm’s picture

Status: Needs review » Reviewed & tested by the community

Yup. Fixed it for me too, and patch looks good

fgm’s picture

+++ b/core/lib/Drupal/Core/Config/InstallStorage.php
@@ -166,6 +166,11 @@ protected function getAllFolders() {
+          drupal_get_filename('profile', $profile, $profile_list[$profile]->getPathname());

We probably want to check that this call to drupal_get_filename() actually succeded.

stefan.r’s picture

It should always succeed considering all it does is prime the cache right?

jeroen.b’s picture

@fgm That call is to prime the static cache of drupal_get_filename, so to set the path. The call always succeeds.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 081f58e and pushed to 8.0.x. Thanks!

  • alexpott committed 081f58e on 8.0.x
    Issue #2486083 by stefan.r: The following module is missing from the...

Status: Fixed » Closed (fixed)

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

tormi’s picture

Status: Closed (fixed) » Active

Same kind of error again with 8.0.0-beta12 on Pantheon (PHP 5.5.24):

User warning: The following module is missing from the file system: standard in drupal_get_filename() (line 255 of core/includes/bootstrap.inc).

drupal_get_filename('module', 'standard')
drupal_get_path('module', 'standard')
module_load_include('install', 'standard')
module_load_install('standard')
drupal_load_updates()
Drupal\system\SystemManager->listRequirements()
Drupal\system\Controller\SystemInfoController->status()
call_user_func_array(Array, Array)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\DependencyInjection\Container\prod\Symfony_Component_HttpKernel_HttpKernel_Proxy->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\DependencyInjection\Container\prod\Drupal_Core_StackMiddleware_Session_Proxy->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\Core\DependencyInjection\Container\prod\Drupal_Core_StackMiddleware_KernelPreHandle_Proxy->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)
-enzo-’s picture

Same error reported in #16

bradjones1’s picture

Status: Active » Closed (fixed)

Don't re-open long-closed tickets. Start a new ticket if you believe you have a regression or new issue.

charginghawk’s picture

Version: 8.0.x-dev » 9.x-dev

Since #1081266: Avoid re-scanning module directory when a filename or a module is missing just hit D7, this issue has shown up again there. We may need to port this fix.

David_Rothstein’s picture

Version: 9.x-dev » 8.0.0

@charginghawk, what are the steps to reproduce this in Drupal 7? (Probably better to create a new issue and link to it from here.)

Devin Carlson’s picture

Version: 8.0.0 » 7.x-dev
Component: simpletest.module » install system
Status: Closed (fixed) » Needs review
FileSize
689 bytes

I'm also seeing this with custom distributions after updating to 7.50.

Steps to duplicate: attempt to install the latest -dev of Drupal Commons which bumps core up to 7.50.
https://simplytest.me/project/commons/7.x-3.x

Failing tests: https://travis-ci.org/acquia/commons/jobs/143737454#L614

When checking a profile's requirements, drupal_check_profile() creates an array of profile module dependencies. It then adds the the profile module as a dependency of itself, in order to see if it has requirements.

module_load_install() is then called for each of the modules in the array, in order to load their .install files before checking if they implement hook_requirements().

Then module_load_install() calls module_load_include() which calls drupal_get_path() and finally drupal_get_filename().

The issue is between the interaction of module_load_include() and drupal_get_path(). module_load_include() doesn't account for the fact that a module could be a profile and calls drupal_get_path('module', $module) with 'module' hard-coded. This leads to drupal_get_path() calling drupal_get_filename() with $type=module instead of $type=profile, resulting in the profile-specific logic in drupal_get_filename() getting skipped so it is unable to locate the file (all fallback detection methods don't work as the profile module hasn't been installed yet, the function wasn't passed the full filename, the $files static hasn't been primed with the profile path, etc).

The solution committed to D8 also works here. Instead of changing the way the profile requirements are checked, altering module_load_include() to account for profiles, or adding a profile_load_include() function, the $files static of drupal_get_filename() could be primed with the path to the profile.

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

We usually don't do backports this way anymore, so #21, if you could create a new issue, that would be appreciated.

Reviewing the code: RTBC - might need a test, though I don't think we had test coverage for that in D8 either.

David_Rothstein’s picture

Version: 7.x-dev » 8.0.0
Status: Reviewed & tested by the community » Fixed

That doesn't look like a bug in core - rather it's a bug in a patch that Commons in running: #1971072: Install profiles cannot list their own requirements in drupal_check_profile. I tried unapplying that patch and the issue wasn't reproducible.

(See also https://www.drupal.org/node/1081266?page=1#comment-10816284 where this was previously discussed.)

charginghawk’s picture

Status: Fixed » Closed (fixed)

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

donquixote’s picture

This issue fixes just one scenario where this warning occurs.

I think it would be wise to have
- One parent issue with the issue title "(meta) The following module is missing from the file system...", with links to other issues, but no patches.
- Multiple issues, with patches, that fix specific scenarios where this occurs. These issues should have more specific titles, such as "drupal_verify_profile() can cause missing module warnings."

With this in mind, this issue probably should be renamed to "drupal_verify_profile() can cause missing module warnings.". I will not rename it myself, because I don't know if others agree, and I have not completely read all the comments in this issue.