Problem/Motivation

Discovered as part of #2606772: Long Twig cache directories can cause failures on some filesystems.

On all Windows machines, some encrypted Linux filesystems, and some Docker configurations there is a max path limit of 255 chars. If $settings['extension_discovery_scan_tests'] = TRUE, which is part of the default settings.local.php file, Drupal will throw an uncaught exception when trying to read invalid_module_name_over_the_maximum_allowed_character_length.info.yml if the Drupal root directory is greater than 88 characters. This comes at the very beginning of the install process so the user is not warned by the error added in #2606772: Long Twig cache directories can cause failures on some filesystems.

The work-around is to set extension_discovery_scan_tests to FALSE.

Full error message:

RuntimeException: SplFileInfo::openFile(C:\Users\Mike\Documents\dev\drupal-core\123456789-123456789-123456789-123456789-123456789-123456789-1/core/modules/system/tests/modules/invalid_module_name_over_the_maximum_allowed_character_length/invalid_module_name_over_the_maximum_allowed_character_length.info.yml): failed to open stream: Invalid argument in SplFileInfo->openFile() (line 458 of C:\Users\Mike\Documents\dev\drupal-core\123456789-123456789-123456789-123456789-123456789-123456789-1\core\lib\Drupal\Core\Extension\ExtensionDiscovery.php).

SplFileInfo->openFile('r') (Line: 458)
Drupal\Core\Extension\ExtensionDiscovery->scanDirectory('core', 1) (Line: 205)
Drupal\Core\Extension\ExtensionDiscovery->scan('module') (Line: 170)
Drupal\Core\Config\InstallStorage->getAllFolders() (Line: 95)
Drupal\Core\Config\InstallStorage->exists('core.extension') (Line: 103)
Drupal\Core\Config\FileStorage->read('core.extension') (Line: 130)
Drupal\Core\Config\FileStorage->readMultiple(Array) (Line: 165)
Drupal\Core\Config\ConfigFactory->doLoadMultiple(Array, 1) (Line: 104)
Drupal\Core\Config\ConfigFactory->doGet('core.extension') (Line: 89)
Drupal\Core\Config\ConfigFactory->get('core.extension') (Line: 220)
Drupal\Core\Extension\ThemeHandler->refreshInfo() (Line: 186)
Drupal\Core\Extension\ThemeHandler->listInfo() (Line: 65)
_drupal_maintenance_theme() (Line: 709)
drupal_maintenance_theme() (Line: 965)
install_display_output(Array, Array, Array) (Line: 264)
_drupal_log_error(Array, 1) (Line: 569)
_drupal_exception_handler(Object)

Steps to reproduce

  • Create a webroot so that the absolute path to the root folder is more than 88 characters long.
  • Put Drupal in that path
  • Set $settings['extension_discovery_scan_tests'] = TRUE
  • Attempt to install

Proposed resolution

Catch the Exception and show a useful warning.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

mikeker created an issue. See original summary.

cilefen’s picture

Title: Uncaught exception SplFileInfo::openFile during installation on Windows » Uncaught exception SplFileInfo::openFile during installation on Windows when the Drupal root directory is greater than 88 characters
Priority: Normal » Major
Issue tags: +DX (Developer Experience)

I am tagging this DX because it could hit developers on Windows. Technically, this should be major.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

larowlan’s picture

Priority: Major » Minor
Issue summary: View changes

Given this only happens on Windows or certain configurations of other OSs, when you have a webroot of 88 characters or more AND have $settings['extension_discovery_scan_tests'] = TRUE, I think this is at best minor. The lack of activity would support this hypothesis.

Reclassifying as such and adding an issue summary update with a proposed resolution.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.