Automatic Update Error

After installing and playing around with a pre-release version of Drupal-CMS on my MacBook, I left it alone for a while, so I updated the Drupal core and each module. Drupal-CMS allows you to update the core program and modules from the administration screen, so I will update them from the administration screen. The Drupal core update was completed without any problems, and I will now update the modules.

You will also need to update multiple modules. You can update multiple modules at once by checking the modules you want to update on the admin screen, but just to be safe, update them one by one.

I was worried about updating from the admin screen, but it went without a hitch. I thought it would go smoothly, but when I updated the Automatic Update module, an error occurred.

Environment where an error occurred

  • Macbook M1 Pro Max
  • LAMP environment using Orbstack and DDEV
  • Drupal-CMS 1.0

Updating from the Drupal-CMS pre-release version to Drupal-CMS 1.0

An error occurred when updating the Automatic Update module from the admin screen

The details of the error that occurred are as follows.

Error details


The website encountered an unexpected error. Try again later.
LogicException: Stored hash key deleted. in Drupal\package_manager\Validator\LockFileValidator->validate() (line 122 of modules/contrib/automatic_updates/package_manager/src/Validator/LockFileValidator.php).
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: 85)
Drupal\automatic_updates\Validation\StatusCheckRequirements->getRequirements() (Line: 30)
automatic_updates_requirements()
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: 109)
Drupal\system\SystemManager->listRequirements() (Line: 53)
Drupal\system\Controller\SystemInfoController->status()
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)

This occurs when the Automatic Updates module (automatic_updates) tries to verify the hash key in composer.lock, but the corresponding hash key has been deleted or changed.

Possible causes

  1. Inconsistency in composer.lock
  2. Bug in the Automatic Updates module

We think that the above problems may be causing the error.

1.Fixing errors.

We will fix the errors. We have encountered inconsistencies in the composer.lock file in the past, so we will check it first.

1-1.Checking composer.lock


% ddev ssh
// Connect to ddev via ssh.
// Change from Zch to Bash.
shinichirotakeda@drupal-cms-web:/var/www/html$ 
// shinichirotakeda@drupal-cms-web:/var/www/html is omitted from here on.
// Checking the composer.lock file
$ composer validate
// Checking for errors No errors have occurred.
$ composer update --lock
// Just to be sure, I'll regenerate the lock file.
$ drush cr
// Clear the cache
I will check, but the error will not disappear. Delete composer.lock once and reinstall the dependencies with composer install.
$ rm composer.lock
// Deleting composer.lock
$ composer install
// Reinstall dependencies
$ drush cr
// Clear the cache
$ drush updatedb
// DB update

I'll check it, but the error doesn't go away. I suspect the automatic_updates module.

It doesn't seem to be a problem with composer.lock, so I suspect a problem with the automatic_updates module. I'll uninstall and reinstall the module.

1-2.Reinstalling automatic_updates


$ drush pm:uninstall automatic_updates
// Uninstall the automatic_updates module.
The following extensions will be uninstalled: automatic_updates, automatic_updates_extensions
┌ Do you want to continue?  ───────────────────────────────────┐
│ Yes                                                          │
└──────────────────────────────────────────────────────────────┘
[success] Successfully uninstalled: automatic_updates, automatic_updates_extensions
  
 $  drush en automatic_updates -y
// Reinstall the automatic_updates module.
[notice] automatic_updates Checked the translation of ja.
[notice] automatic_updates Downloaded the ja translation
[notice] automatic_updates ja translation been imported.
[warning] foreach() argument must be of type array|object, null given Mapping.php:31
[warning] foreach() argument must be of type array|object, null given Mapping.php:230
[notice] Updated default configuration to ja
[warning] foreach() argument must be of type array|object, null given Mapping.php:31
[warning] foreach() argument must be of type array|object, null given Mapping.php:230
[notice] Translations imported: 0 added, 28 updated, 0 removed.
[notice] The configuration was successfully updated. 200 configuration objects updated.
[notice] Message: 1 translation file has been imported. /0/ translations have been added, /28/ translations have been updated, and /0/ translations have been deleted.
[notice] Message: The structure has been updated. 200 configuration objects have been updated.
[success] Module automatic_updates has been installed. (Configure)
$
// Reinstallation complete

The error disappeared after I uninstalled and reinstalled the automatic_updates module.

There is a warning saying [warning] foreach() argument must be of type array|object, null given, but when I check the admin screen, the error has disappeared and the update has been carried out without a problem.

It seems that the error this time was caused by a problem with the automatic_updates module, which prevented the verification of the composer.lock hash key. The error was resolved by reinstalling composer.lock and reinstalling the automatic_updates module.

2.log screen

Uninstall
Install
Translation
Translation
Warning

If you check the log on the administration screen when you install the automatic_updates module, you will see a warning about package_manager.

This is not an error, so it does not directly affect the use of Drupal-CMS, but I am curious, so I will investigate.

3.Warning

3-1.Warning displayed

Warning message displayed in the terminal when installing the automatic_updates module

[warning] foreach() argument must be of type array|object, null given Mapping.php:31
[warning] foreach() argument must be of type array|object, null given Mapping.php:230

Warning from package_manager in the admin screen log

The following paths in /var/www/html aren't recognized as part of your Drupal site, so to be safe, Package Manager is excluding them from all stage operations. If these files are not needed for Composer to work properly in your site, no action is needed. Otherwise, you can disable this behavior by setting the package_manager.settings:include_unknown_files_in_project_root config setting to TRUE. .ddev README.md launch-drupal-cms.sh recipes

The Package Manager warning says ‘Ignore files that the Package Manager does not recognise’. From this, it is highly likely that the array that is null in the automatic_updates module is data provided by the Package Manager.

automatic_updates obtains information about package updates via the package_manager. It is thought that the package_manager is blocked, and that automatic_updates is unable to obtain the necessary data and is returning null.

Let's try to find out how this warning is affecting us.

3-2.Impact of warnings

The following message will appear on the administration screen when an update is required.


//
The latest versions of one or more of the modules or themes you are using are available. You should update them as soon as possible to keep your site functioning properly.
//

Even if the core programme or modules are up-to-date and do not need updating, the above message will always be displayed on the administration screen.

The automatic_updates module has a dependency on the package_manager module, so there may be a problem with the dependency. It is also possible that the module is corrupted, so you will need to delete the module and recheck the dependencies.

As the article would be too long, I will summarise the solutions we came up with in the following article.

Conclude.

I installed Drupal-CMS when the pre-release was released, but I hadn't touched it for a while, so when I logged into the admin screen for the first time in a while, I found that there were updates for the core program and modules, so I updated them.

As it is now possible to update modules and themes, including the Drupal core, from the Drupal-CMS administration screen, I will update them from the administration screen, but I have fixed the error that occurred when updating the automatic_updates module. Although I have fixed the error, there are still warnings about problems with the automatic_updates and package_manager modules.

There are other warnings, so I will summarise the causes and countermeasures for the warnings displayed in the next article.

Since it is now easier to install from the admin screen, I tried installing the core program, modules and themes from the admin screen, but depending on the module, you may need to use Composer to avoid problems with dependencies.

As this case was a bug that occurred in the environment of updating from the pre-release version, the error that occurred this time may not be reproduced when updating from the installation of the official release version.

Post
2025-03-11
Contributor
S.Takeda
Article
Related articles.

This is a related article on Drupal and web development. Please take a look if you like.

Basics of creating page.

I've been writing a series of articles on the basic concepts of Drupal that are necessary for creating pages, but since it's become a lot of articles and it's hard to understand, I'm going to organise them.

En Drupal Articles.

Drupal 10.3x and Extensions.

This section summarises the version of Drupal actually used on this website, the themes used and the modules used. As you can see, we have minimal customisation and minimal modules installed, including design.

En Drupal Articles.

Drupal-CMS Warning Resolved

I have dealt with the warning that appeared when I fixed the problem with the automatic_updates module that appeared in the last Drupal-CMS update. By removing drupal_cms_starter from the dependencies, I also ended up removing the modules and themes that are installed with Drupal-CMS from the start, and the dependency was broken, so it took quite a while to fix.

En Drupal Articles.

Welcome

I am currently trying my hand at Drupal after discovering the appeal of CMS through WordPress.

This is a blog written by a beginner who is learning Drupal.

Drupal is a CMS that requires an understanding of structured rules. As a result, it offers a high degree of configuration flexibility, but this also means that it has a steep learning curve for beginners. However, once you become familiar with it, it allows for more flexible system construction than other CMSs.

With its robust security and excellent scalability, this CMS is ideal for building large-scale websites. As a result, it is more commonly used by public institutions and corporations than by individuals, and development is often carried out by vendors. However, it is also an excellent CMS that offers high availability for individual use.

Creation

This article will explain how to build a website using Drupal.

Article

  All Article.

  Drupal Article.

  Web site Article.

  Mac Article.

  AWS Article.

Life Style

This article is about second-hand clothes and fashion.

Article

  All Article.

  Old-Clothes Article.

  Fashion Article.

  Watch Article.

  Photo Article.

  Recommended Shops.

Environment

Core Drupal 10.5.1

Theme Bootstrap5 4.0.5

Thanks to

  Drupal

  bootstrap5

  Bootstrap

  Font Awesome

  Amazon Web Service

  Amazon Lightsail

  Bitnami

  Google reCAPTCHA