WSOD when installing already downloaded modules without active public internet connection

Created on 15 February 2025, about 2 months ago

Problem/Motivation

Installing a locally downloaded module with automatic_updates installed and no active public internet connection throws a RuntimeException and WSOD.

Steps to reproduce

Install Drupal CMS

Add the following to settings.php (to simulate a network failure, or proxy failure).

$settings['http_client_config']['proxy']['http'] = 'http://127.0.0.1:63000';
$settings['http_client_config']['proxy']['https'] = 'http://127.0.0.1:63000';

Attempt to install a module that is already downloaded yet not installed, such as the Drupal Core Help Module.

Observe WSOD.

The website encountered an unexpected error. Try again later.

RuntimeException: The project 'drupal' can not be updated because its status is not-fetched in Drupal\package_manager\ProjectInfo->getInstallableReleases() (line 97 of modules/contrib/automatic_updates/package_manager/src/ProjectInfo.php).

Drupal\automatic_updates\Validator\VersionPolicyValidator->getAvailableReleases() (Line: 115)
Drupal\automatic_updates\Validator\VersionPolicyValidator->validateVersion() (Line: 181)
Drupal\automatic_updates\Validator\VersionPolicyValidator->checkVersion() (Line: 246)
Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}() (Line: 206)
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 50)
Drupal\automatic_updates\Validation\StatusChecker->runStatusCheck() (Line: 62)
Drupal\automatic_updates\Validation\StatusChecker->run() (Line: 194)
automatic_updates_modules_installed()
call_user_func_array() (Line: 355)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 307)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 354)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 725)
Drupal\Core\Extension\ModuleInstaller->invokeAll() (Line: 392)
Drupal\Core\Extension\ModuleInstaller->install() (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install() (Line: 504)
Drupal\system\Form\ModulesListForm->submitForm()
call_user_func_array() (Line: 105)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 43)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 589)
Drupal\Core\Form\FormBuilder->processForm() (Line: 144)
Drupal\autosave_form\Form\AutosaveFormBuilder->processForm() (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 97)
Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Proposed resolution

Capture RuntimeException, do not WSOD. I leave how this is to be presented to the automatic_updates develoeprs, only noting that interruptions in internet should be considered an expected occurance and the software needs to cope with it.

Presumably similar would occur if the sever hosting the relevant API endpoints is offline while other endpoints (packaging) remained online allowing local download with composer.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cmlara

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024