Thanks for testing Automatic Updates! Please tell us in detail about the problem you encountered. To help you, you can use the prompts below as guidance.

What was your goal? For example, what versions of Drupal core were you trying to update from and to?

Testing update from a new create project drupal/recommended-project:9.3.9 to 9.3.16

What were the steps you took, starting from when you added the Automatic Updates module to your Drupal project (see https://www.drupal.org/i/3275810#install-module for instructions)? Include anything that seems relevant, including commands you ran, links you clicked on, output logs, relevant config files, screenshots, screen recordings, etc.

Everything thing went fine as per the instructions. Except when I got to the Extend > Update page I got a message.

The "composer" executable cannot be found...

.

I needed to see where it was and then had to update to >2.3.5. Since this was shared hosting I installed a new copy in /home/acc/composer/composer.phar and added that path to the settings.php as guided on the help page that you are directed to from the above message.

After that no issue.

I then tried with $config['automatic_updates.settings']['allow_core_minor_updates'] = TRUE; to update to 9.4.0
This did update but got the below message

Drupal\automatic_updates\Exception\UpdateException: Stored lock file hash does not match the active lock file. in Drupal\automatic_updates\Updater->dispatch() (line 103 of /home3/surfingj/public_html/designkojo/test/web/modules/contrib/automatic_updates/src/Updater.php).

I think in between updating to 9.3.16 and then trying the minor core update I added admin_toolbar using composer. This might be why "Stored lock file hash does not match the active lock file." error occurred and return AJAX HTTP error on an error page.

As said the update was successful, however.

What was your environment like?
Please answer as many of the following questions as you can.

Was this a local development environment, or a remote server?: Remote shared hosting

Are you using Lando, DDEV, or another Docker-based environment?: NO

What operating system were you using? It say Linux but I guess it is Centos as the user and group are the same.

What web server are you using? Apache Version 2.4.53

What PHP version are you using (see https://www.drupal.org/i/3275810#confirm-php-version)? 7.4.28

What version of Composer are you using (see https://www.drupal.org/i/3275810#confirm-composer-version)? 2.3.7

Did you accomplish your goal? Were the instructions clear? Did you observe any bugs or errors, or other issues? Did you need to do any workarounds?

Yes, the instructions were clear and the guidance from the module not passing the check was good help.

Problem with these instructions? Anything else we should know?

No all good.

Comments

siramsay created an issue. See original summary.

siramsay’s picture

Issue summary: View changes
siramsay’s picture

On the same install, I just update from 9.4.0 to 9.4.1 using the same version of the Automatic Updates Module (8.x-2.0-beta4 )

No issues with this minor update.

Still need to retest/reproduce the issue I had mentioned above

"Drupal\automatic_updates\Exception\UpdateException: Stored lock file hash does not match the active lock file."...
siramsay’s picture

Title: Automatic Updates beta test result » [DrupalCon] Automatic Updates beta test result
phenaproxima’s picture

I think in between updating to 9.3.16 and then trying the minor core update I added admin_toolbar using composer.

Yes, this would absolutely cause the error you encountered. It's potentially dangerous to add or update things in your code base while an update is in progress, because it can change the dependency tree in unaccountable ways. So that's why Automatic Updates produced that validation error.

I'll leave this issue open for now, but it sounds like this works as designed. Maybe we could improve the error message, though, to something like:

Unexpected changes were detected in /path/to/composer.lock. Were extensions added or removed while updating Drupal core? This is strongly discouraged, as it can put the code base into an unreliable state.

But, if the consensus here is that the current experience is reasonable, then we can close this issue out.

phenaproxima’s picture

Title: [DrupalCon] Automatic Updates beta test result » Automatic Updates beta test result

This testing didn't take place at DrupalCon. :)

siramsay’s picture

That's why I had originally removed the DrupalCon but added it back as it is part of the template*)

So once I you install the module you are unable to install new modules?

Just to be clear the steps I took were:

  1. Install new Drupal site using composer for testing purposes
  2. Install Auto Updates module
  3. Install lastest composer
  4. Run updates
  5. Successful

After this, I would have thought the update process would be set to Finish/Success.

Install new module after the success using composer
As I like the Admin toolbar for UI cache clearing I then installed it before proceeding.
This could have been any module, Backup MIgrate or any new module a user may install.

Then I enable the minor update $config['automatic_updates.settings']['allow_core_minor_updates'] = TRUE

Then I went back to the Update page and ran Update.
This should be a new Process? i.e. This was not in the middle of an Update.
If so shouldn't you get the message to do the readiness checks and maybe disable the Update button.

I have some screen captures of the logs. If that will help?

I'll try and reproduce with a new install and the latest version as well.

phenaproxima’s picture

So once I you install the module you are unable to install new modules?

Oh, you can install new modules! :) Just not while an update is actually in progress. Sounds like you didn't do that, though, so sorry for the miscommunication. I musta been tired.

I think if you have screen shots of the logs, those surely wouldn't hurt. I can't think of another scenario that would cause the error you saw, so maybe there's a bug here. Bears further investigation for sure.

siramsay’s picture

No problem, that question was a bit confusing! It should have read "So once I/you install Auto Updates..." and even then a little confusing too.

I am going to try and reproduce it over the weekend and dig out the logs from the first instance.

siramsay’s picture

Title: Automatic Updates beta test result » Stored lock file hash does not match the active lock file / Automatic Updates beta test result

I set up a new instance using the 8.x-2.0-rc1 released 30 June 2022

  1. Updated it from 9.3.9 to 9.3.17 with sucesss.
  2. Added admin toolbar using composer
  3. Add the $config['automatic_updates.settings']['allow_core_minor_updates'] = TRUE;
  4. Updated it from 9.3.17 to 9.4. 1with sucesss.

Unable to reproduce. So maybe whatever caused this was fixed in the RC version.

----

Just in case I'm adding this detail.

In the original issue, the below error occur before the "Drupal\automatic_updates\Exception\UpdateException: Stored lock file hash does not match the active lock file. " mentioned above.

Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::invokeAllWith() in Drupal\Core\Entity\EntityStorageBase->postLoad() (line 430 of /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)

location: /web/batch?_format=json&id=7&op=do
referrer: /web/batch?id=7&op=start

Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::invokeAllWith() in Drupal\Core\Entity\EntityStorageBase->postLoad() (line 430 of /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)

#0 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(353): Drupal\Core\Entity\EntityStorageBase->postLoad(Array)
#1 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(641): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
#2 /home3/surfingj/public_html/designkojo/test/web/core/modules/block/block.module(173): Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array)
#3 [internal function]: block_rebuild()
#4 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array('block_rebuild', Array)
#5 /home3/surfingj/public_html/designkojo/test/web/core/includes/common.inc(573): Drupal\Core\Extension\ModuleHandler->invokeAll('rebuild')
#6 /home3/surfingj/public_html/designkojo/test/web/modules/contrib/automatic_updates/package_manager/src/Stage.php(356): drupal_flush_all_caches()
#7 /home3/surfingj/public_html/designkojo/test/web/modules/contrib/automatic_updates/src/BatchProcessor.php(124): Drupal\package_manager\Stage->apply()
#8 /home3/surfingj/public_html/designkojo/test/web/core/includes/batch.inc(295): Drupal\automatic_updates\BatchProcessor::commit('BW5gtIeBJHYjg9O...', Array)
#9 /home3/surfingj/public_html/designkojo/test/web/core/includes/batch.inc(137): _batch_process()
#10 /home3/surfingj/public_html/designkojo/test/web/core/includes/batch.inc(93): _batch_do()
#11 /home3/surfingj/public_html/designkojo/test/web/core/modules/system/src/Controller/BatchController.php(55): _batch_page(Object(Symfony\Component\HttpFoundation\Request))
#12 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request))
#13 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#14 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#15 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#16 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#17 /home3/surfingj/public_html/designkojo/test/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#18 /home3/surfingj/public_html/designkojo/test/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#19 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /home3/surfingj/public_html/designkojo/test/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /home3/surfingj/public_html/designkojo/test/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /home3/surfingj/public_html/designkojo/test/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /home3/surfingj/public_html/designkojo/test/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /home3/surfingj/public_html/designkojo/test/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#28 {main}
tedbow’s picture

Status: Active » Fixed

@siramsay thanks for testing!

re the problem

Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::invokeAllWith()

Yes I think this issue would have been fixed by #3291147: Successfully applying an update puts the remainder of the request into an unreliable state

I created #3294338: Improve error message in LockFileValidator where we can figure if we need better message than the existing "Stored lock file hash does not match the active lock file" @siramsay if you have any ideas or feedback to improve that message please comment on that issue, thanks

Closing this issue

Status: Fixed » Closed (fixed)

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