-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Sites - Joomla! Core (Could not load root metadata) #43287
Comments
any problems during the update? How was it applied? Could you please provide the content of the #__tuf_metadata table? |
Please paste the contents of the update log |
Update completed successfully with the internal wizard / guided procedure. I've done that in several other sites without issues (same extensions installed). #__tuf_metadata table was empty. I cloned it from a similar installation and everything worked! |
This means that the update was NOT successful. Please pust the update log |
This is the content of the "/administrator/logs/joomla_update.php" file. #Date: 2024-04-17 06:32:52 UTC #Fields: datetime priority clientip category message |
That explains why the TUF database did not contain anything and it also shows that you do not have a completed update, No SQL updates took place!! This is what I would have expected to see. @richard67 any thoughts? #Date: 2024-04-17 10:09:35 UTC
|
To be precise, I performed a second update with the "Upload and Update" function... perhaps this log is redirected on the second attempt? At the end of the first attempt (online update) in the System >> Maintenance >> Database section there were inconsistencies on the "Joomla CMS" line and I used the "Update Structure" button. |
yes that would explain why the log shows no updates. "Update Structure" does exactly AND only that. It will not make other changes that may be needed like additonal data records. So it would create a missing tuf database table but it would not create the missing data in that table, |
So that would mean that the first update most likely failed before the SQL statements could be executed. The repair process created the table but not the row, resulting in the missing data. |
If only the #__tuf_metadata table was involved, can I consider the issue closed? |
@alecrespi78 If it is right that no SQL statements were executed with the first update, then all script named like 5.1.0-*.sql which could be found here have not run: https://github.com/joomla/joomla-cms/tree/5.1-dev/administrator/components/com_admin/sql/updates/mysql . These are the scripts
The "Fix structure" button has only run the DDL (data definition language) SQL statements, i.e. "CREATE TABLE" or "ALTER TABLE", but not the DML (data manipulation language) SQL statements like e.g. "INSERT" or "UPDATE" or "DELETE". You should check in phpMyAdmin if it needs to run these statements (i.e. check if the result of that statement is already there or not) and have to run them in phpMyAdmin. |
I have the same problem after update to 5.1. An error has occurred.0 Internal check failed. Call Stack| Function | Location-- | -- | -- I have this issue on all updated sites so I hope in a quick update to fix this issue. |
please post the update log and also the method you used to perform the update!! |
Hi Brian, I updated Joomla by the automated Joomla Backend functionality and this is the update log: # #Fields: datetime priority clientip category message |
No, it’s definitely not the same issue. You get a completely different error message compared to the one in the initial post of this issue. Yours:
The one from this issue:
And your log shows that all SQL statements were run without error. So maybe you should open a new issue for your case. |
Thank you, |
@umbcel are all those sites hosted on the same machine or at the same hosting company? Can you post the content of the tuf_metadata table? |
Yes, all those sites are hosted on the same machine. |
@umbcel can you please try to reproduce the issue with the same site but on a different machine at a different host? The error seems to be related to the handling of the cryto logic in an upstream library and I assume that some sort of environment issue (OS, PHP Version etc) plays a role. Would like to confirm that assumption. |
I can't. I have all those web sites on my machine, my hosting, and no problem happen with older 3.x/4.x/5.x Joomla releases. This problem started after I updated web sites to Joomla 5.1. |
Well that's a pity. Could you please at least provide as many environment informations as possible? OS, PHP info() output, CPU? |
... which supports the assumption that the problem is related to the environment. |
So why was everything working fine just before installing the updates? Why did the previous version of Joomla 5 work well? |
Because Joomla 5.1 introduced a new function that ensures that an update, that is fetched from the joomla server, is actually a legit one and not one that has been manipulated by an attacker. The error message is having its source in the cryptographic verification process which works fine on a wide range of different machines. In fact, you are the only person with that issue so far - so something about that environment has to be special. |
Ok, thanks, this is a more logical explanation and is likely to be the case. Where can I find information on these changes to remedy them on my hosting? |
What I need to check and implement on my hosting to avoid these problems? |
Joomla has implemented TUF as its updating framework https://theupdateframework.io/ We are using PHP-TUF as the implementation within Joomla to consume the updates: https://github.com/joomla-backports/php-tuf And PHP-TUF uses the compat package for lib_sodium to do the crypto operations: https://github.com/paragonie/sodium_compat The error message occurs in the last part of the chain, the crypto library.
That's a though one. At a first step, check if your PHP native sodium support: https://www.php.net/manual/en/sodium.installation.php and if not try to enable it. If that solves the issue, it's most likely a bug in the upstream library that needs further debugging. |
Yeahhhh! Problem solved! I just enabled Sodium support in PHP and all run fine now. |
Interesting. Can you at least provide the used PHP version and operation system so I can have same basic information to look for the root cause in the upstream library? |
Windows system |
I'm getting these errors as well. My environment is Apache 2.4, PHP 8.3.6. I'm running Joomla! 5.1.0. Here's the stack trace: 2024-05-19T20:45:45+00:00 CRITICAL 45.17.166.59 error Uncaught Throwable of type JsonException thrown with message "Syntax error". Stack trace: #0 [ROOT]/libraries/vendor/php-tuf/php-tuf/src/Metadata/MetadataBase.php(90): json_decode('', true, 512, 4194304) |
I have the same error. I clicked on it and the 5.1.1 update appeared. After that I get a Could not load root metadata error. After that I just get a red X to update. I think this error should be handled if the tuf_metadata table is empty somewhere. |
To solve - install second instance of joomla on the server, copy using phpmyadmin or similiar table "updates" and move it to the main instance (which you would like to fix) |
When TUF was introduced, the update should have checked if there was such a table (tuf_metadata) and if it contained the correct data. If not, it should have been fixed automatically. |
The table and the correct data was created on the update to 5.1.0, if however, for whatever reason, that update wasn't performed correctly, you'll end up with exactly this problem. So the root issue is not the introduction of TUF or the lack of logic to add the table, but an incomplete update. |
Let's look at it from another perspective. There is a 5.1.0 Joomla! page, where the tuf_metadata table exists, but there is no data in it. According to the database maintainer: All database table structures are up to date. After that, if I click on the 5.1.1 update and get a Could not load root metadata error, it is a feature and not a bug. |
I had the same problem on a developing website. Enabling sodium extension didn't help in my case. To get around this, I temporarily modified the libraries/src/Updater/Updater.php file line 263: This allowed me to access the com_joomlaupdate component, and I then imported the latest Joomla update pack. After installation everything was OK. |
@tristan-bellosta, all you need is the following: Install a new Joomla, then export the contents of the tuf_metadata table, and finally import this into the database of your existing Joomla site. Note: The problem remains that Joomla! according to the empty tuf_metadata table does not represent a database problem. Ergo, it is not possible to fix the error automatically by fixing the database. |
Steps to reproduce the issue
Upgrade from 5.0.3 to 5.1.0
Update Sites - Joomla! Core (enabled)
https://update.joomla.org/cms/
Expected result
Working checking notifications in Home Dashboard
Actual result
Notifications error (red icons) on Extensions / Overrides / Pull requests
Unknown extensions …
Error on checking overrides.
Unknown requests …
An error has occurred.
0 Could not load root metadata.
System information (as much as possible)
PHP Built On Linux webxc201s02.ad.aruba.it 3.10.0-1160.92.1.el7.x86_64 #1 SMP Tue Jun 20 11:48:01 UTC 2023 x86_64
Database Type mysql
Database Version 8.0.32-24
PHP Version 8.2.13
Web Server Apache
Joomla! Version Joomla! 5.1.0 Stable [ Kudumisha ] 16-April-2024 16:00 GMT
Joomla Backward Compatibility Plugin Enabled ()
Additional comments
This is a part of the log...
2024-04-17T09:55:04+00:00 CRITICAL xxx.xxx.xxx.xxx error Uncaught Throwable of type LogicException thrown with message "Could not load root metadata.". Stack trace: #0 [ROOT]/libraries/vendor/php-tuf/php-tuf/src/Client/Updater.php(138): Tuf\Metadata\StorageBase->getRoot()
#1 [ROOT]/libraries/src/TUF/TufFetcher.php(117): Tuf\Client\Updater->refresh()
#2 [ROOT]/libraries/src/Updater/Adapter/TufAdapter.php(84): Joomla\CMS\TUF\TufFetcher->getValidUpdate()
#3 [ROOT]/libraries/src/Updater/Adapter/TufAdapter.php(50): Joomla\CMS\Updater\Adapter\TufAdapter->getUpdateTargets()
#4 [ROOT]/libraries/src/Updater/Updater.php(263): Joomla\CMS\Updater\Adapter\TufAdapter->findUpdate()
#5 [ROOT]/libraries/src/Updater/Updater.php(164): Joomla\CMS\Updater\Updater->getUpdateObjectsForSite()
#6 [ROOT]/administrator/components/com_installer/src/Model/UpdateModel.php(275): Joomla\CMS\Updater\Updater->findUpdates()
#7 [ROOT]/administrator/components/com_installer/src/Controller/UpdateController.php(161): Joomla\Component\Installer\Administrator\Model\UpdateModel->findUpdates()
#8 [ROOT]/libraries/src/MVC/Controller/BaseController.php(730): Joomla\Component\Installer\Administrator\Controller\UpdateController->ajax()
#9 [ROOT]/libraries/src/Dispatcher/ComponentDispatcher.php(143): Joomla\CMS\MVC\Controller\BaseController->execute()
#10 [ROOT]/libraries/src/Component/ComponentHelper.php(361): Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch()
#11 [ROOT]/libraries/src/Application/AdministratorApplication.php(150): Joomla\CMS\Component\ComponentHelper::renderComponent()
#12 [ROOT]/libraries/src/Application/AdministratorApplication.php(195): Joomla\CMS\Application\AdministratorApplication->dispatch()
#13 [ROOT]/libraries/src/Application/CMSApplication.php(306): Joomla\CMS\Application\AdministratorApplication->doExecute()
#14 [ROOT]/administrator/includes/app.php(58): Joomla\CMS\Application\CMSApplication->execute()
#15 [ROOT]/administrator/index.php(32): require_once('...')
#16 {main}
The text was updated successfully, but these errors were encountered: