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
Comment #2
siramsay commentedComment #3
siramsay commentedOn 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
Comment #4
siramsay commentedComment #5
phenaproximaYes, 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:
But, if the consensus here is that the current experience is reasonable, then we can close this issue out.
Comment #6
phenaproximaThis testing didn't take place at DrupalCon. :)
Comment #7
siramsay commentedThat'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:
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.
Comment #8
phenaproximaOh, 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.
Comment #9
siramsay commentedNo 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.
Comment #10
siramsay commentedI set up a new instance using the 8.x-2.0-rc1 released 30 June 2022
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.
location: /web/batch?_format=json&id=7&op=do
referrer: /web/batch?id=7&op=start
Comment #11
tedbow@siramsay thanks for testing!
re the problem
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