Problem/Motivation

Based on https://github.com/drud/ddev/issues/1929, there seems to be a few things we can do to improve notification that this module doesn't support full Composer based workflows.

Proposed resolution

  • Read only filesystem for vendor
  • Vendor insufficient space
  • /core" is read only" is just incorrect

And lastly, add a "requirements" check to module's .install file for location of vendor folder in relation to core folder. If the site is a fully composer based install, don't allow module to be installed.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#6 interdiff_2-6.txt714 bytesheddn
#6 3093700-6.patch14.74 KBheddn
#2 3093700.patch14.04 KBheddn

Comments

heddn created an issue. See original summary.

heddn’s picture

Status: Active » Needs review
StatusFileSize
new14.04 KB

heddn credited rfay.

heddn credited rkoller.

heddn’s picture

Adding credit.

heddn’s picture

StatusFileSize
new714 bytes
new14.74 KB
ressa’s picture

I have also recently seen messages like Drupal core filesystem at "/var/www/html/web/core" is read only and There must be at least 10 megabytes free. mentioned in Readiness Check for Drupal Automatic Update returns errors running on DDEV testing the module in Drupal 8 via Composer installation in Lando.

I have tested the patch (#6) with a Composer install in Lando, and it works as expected, showing this text after clicking "run the readiness checks":

Your site is currently failing readiness checks for automatic updates. It cannot be automatically updated until further action is performed:
The vendor folder could not be located.

ressa’s picture

Also, I get this message if I try to enable the module from admin/modules, so that works fine as well:

Error message
This module does not currently support relocated vendor folder and composer-based workflows. (Currently using Automatic Updates version 1.x)

I am able to enable it via Drush, though:

$ drush en automatic_updates
[success] Successfully enabled: automatic_updates
heddn’s picture

There's not much we can do about #8. I noticed the same thing. But we have it plastered all over everywhere in README.md, project page, official documentation and a hook_requirements, which will show up on the site status. I think that is about as good as we can do.

ressa’s picture

I agree. Checkboxes probably can't be disabled on the module install page, like they can on on the uninstall page ... Also, it is stated very prominently that the installation fails the readiness checks.

ressa’s picture

Status: Needs review » Reviewed & tested by the community

... and thanks for all your good work on the module, like adding this feature :-)

  • heddn committed a595242 on 8.x-1.x
    Issue #3093700 by heddn, ressa, rfay, rkoller: Improve requirements...
heddn’s picture

Status: Reviewed & tested by the community » Needs work

And thanks for all the great testing and feedback from the community. Pushed to 8.x. Working on a backport to 7.x.

heddn’s picture

Status: Needs work » Fixed

There's nothing in here that needs backporting to 7.x from what I can tell. There's no default vendor folder.

ressa’s picture

Status: Fixed » Needs work

I just tested the latest dev-version with a Drupal tar-ball in Lando, but get an error ("The website encountered an unexpected error.") if I try to enable the module ... The code in #6 patch looks different than the code which got committed in the automatic_updates.install file:

  $vendor_checker = new Vendor(\Drupal::getContainer()->get('app.root'));
  if (!empty($vendor_checker->run())) {

https://git.drupalcode.org/project/automatic_updates/blob/a5952429359dab...

The same bit in #6 patch:
if (!is_dir(\Drupal::root() . DIRECTORY_SEPARATOR . 'vendor')) {

If I change the two lines of code in the module to the single line from patch in #6, I can install the module. (It fails if I try the experimental upgrade from 8.4.7 to 8.8.0-beta, but that's another issue ...)

The error:

Message   Error: Class 'Drupal\automatic_updates\ReadinessChecker\Vendor' not found in automatic_updates_requirements() (line 17 of /app/modules/automatic_updates/automatic_updates.install) #0 [internal function]: automatic_updates_requirements('install') #1 /app/core/lib/Drupal/Core/Extension/ModuleHandler.php(392): call_user_func_array('automatic_updat...', Array) #2 /app/core/includes/install.inc(1038): Drupal\Core\Extension\ModuleHandler->invoke('automatic_updat...', 'requirements', Array) #3 /app/core/modules/system/src/Form/ModulesListForm.php(421): drupal_check_module('automatic_updat...') #4 /app/core/modules/system/src/Form/ModulesListForm.php(439): Drupal\system\Form\ModulesListForm->buildModuleList(Object(Drupal\Core\Form\FormState)) #5 [internal function]: Drupal\system\Form\ModulesListForm->submitForm(Array, Object(Drupal\Core\Form\FormState)) #6 /app/core/lib/Drupal/Core/Form/FormSubmitter.php(111): call_user_func_array(Array, Array) #7 /app/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState)) #8 /app/core/lib/Drupal/Core/Form/FormBuilder.php(590): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState)) #9 /app/core/lib/Drupal/Core/Form/FormBuilder.php(319): Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object(Drupal\Core\Form\FormState)) #10 /app/core/lib/Drupal/Core/Controller/FormController.php(93): Drupal\Core\Form\FormBuilder->buildForm('system_modules', Object(Drupal\Core\Form\FormState)) #11 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #12 /app/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #13 /app/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #14 /app/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #15 /app/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #16 /app/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #17 /app/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #18 /app/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /app/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /app/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /app/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /app/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /app/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /app/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /app/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /app/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #27 {main}.
Severity  

My Lando install process, for my own documentation:

mkdir drutar && cd drutar && curl -sSL https://ftp.drupal.org/files/projects/drupal-8.7.4.tar.gz | tar -xz --strip-components=1

# get latest dev-version of module
curl -sSL https://ftp.drupal.org/files/projects/automatic_updates-8.x-1.x-dev.tar.gz | tar -xz -C modules

# create Lando instance
lando init --recipe drupal8 --webroot . --name drutar

  • heddn committed 7515c3a on 8.x-1.x
    Issue #3093700 by heddn, ressa, rfay, rkoller: Improve requirements...
heddn’s picture

Status: Needs work » Fixed

And fixed once again. Using the checker was an attempt to keep code simple. But apparently class loading isn't available at at that point... so I brought back the procedural approach that essentially clones the checker.

ressa’s picture

Cool, thanks. Latest version works as expected, refusing in Composer-based installation with "Error message: This module does not currently support relocated vendor folder ..." and no errors in tar-ball install, when enabling the module.

Status: Fixed » Closed (fixed)

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