Joomla provides an auto-update feature that allows website administrators to update their installed extensions with one click. This feature requires developers to support it in their extensions. I included support for the updater in a few of my extensions, and recently I received a report from two of my customers that they could not get to update my extension. Every time they attempted to update, the would get an “Invalid extension update” error. Unfortunately, I was not able to replicate the error on any of my test servers, but I was able to figure it out after I was allowed to use one of my customers server for testing purposes. Fixing this error turned out to be very easy, and understanding why one could get the error and how to avoid it is very valuable.
Understanding the Error
If you take a look at Joomla’s Library Updater code, you will find that this error is triggered when the download URL is not found. However, the key to understand this error is to realize that there are a number of reasons why the download URL would not be available after processing the Update XML file. Before realizing this, it can be confusing because when you examine the Update XML file, you will find the download URL present in the downloadurl tag.
Actually, if the downloadurl tag is present in your Update XML file, then there are 3 main reasons why Joomla won’t detect the download URL:
- The server’s PHP version is lower than the minimum PHP version requirement specified in the Update XML file for the extension.
- Either the database version is lower than the minimum supported database version specified in the Update XML file, Or the database type is missing in the supported_databases tag.
- The stability status of the update is lower than the stability status of the installed extension.
PHP Version
1 |
<php_minimum>7.3</php_minimum> |
The php_minimum tag used in the Update XML file is designed to ensure that there are no conflicts with the extension update and the Joomla server it will be installed on. By adding this tag to your XML file, the developer can ensure compatibility and unnecessary errors. If the PHP version of your server was 7.1, and the update to the extension was designed for 7.3 and specified in the php_minimum tag, then you would undoubtedly get the “Invalid extension update” error.
It would have been useful to provide a more descriptive error message, but this is the error that is provided as of Joomla version 3.9.26. If the php_minimum tag is missing from the Update XML file, you will also get this error. So, the php_minimum tag must be present.
Database version and Type
1 |
<supported_databases mysql="5.5.3" postgresql="9.1" mssql="10.50.1600.1" mariadb="10.1"/> |
Unlike the php_minimum tag, the supported_databases tag is not required to be present in the Update XML file, based on the Joomla code. However, if it is present, then your database engine must meet the requirements specified in the tag. Also, you must be using one of the database engines listed.
For example, if you are using MySQL, but your version of MySQL is version 5.1, the minimum requirement for running Joomla, but the extension requires 5.5.3, then you will get the “Invalid extension update” error, because the update is incompatible with your Joomla setup. Further, the database engine that you use must be listed in the tag. So, if you have MariaDB installed (a free, open-source fork of MySQL), but the developer did not include mariadb as an attribute in the supported_databases tag, then you will also trigger this error.
Stability Status
1 2 3 |
<tags> <tag>stable</tag> </tags> |
The stability status is also not required to be present in the Update XML file. However, if it is present, then then it must either be the same or greater than the stability of the installed version of the extension. There are five levels of stability:
- DEV
- ALPHA
- BETA
- RC
- STABLE
How I fixed it
In my particular case, I was able to fix this error for my customers by first identifying the reason why they got the error. Apparently, they had a MariaDB installed, and I did not have the mariadb attribute listed in the supported_databases tag. Once, I added the mariadb attribute with a minimum version set to 10.1, the error disappeared, and they were able to install the update from the Updater without issue.
How to avoid the error
Comparing the Update XML file that I provide for my extensions with those provided by other developers, I realize that some developers do not include the supported_databases tag. If you don’t include it, you won’t get this error with mismatched database versions or missing types. Specifying the correct requirements can be crucial to ensure compatibility for a web server and the extensions that are installed. It is at the developer’s discretion to determine the best course of action to ensure compatibility and a good user experience. You could avoid the error by not including database and stability information in the XML.
However, if you don’t avoid the error by writing complete Update XML files, and you ensure that you specify the appropriate minimum parameters to run your extension, then getting the error may be the appropriate response. The only drawback is the misleading nature of the vague description the error. It would be better to have more descriptive errors for specific causes. Hopefully this will be implemented later Joomla releases. “Invalid extension update” does not really convey anything meaningful, and actually infers that the developer is incompetent or the update is bad.
I hope this post helps someone solve their “Invalid extension update” error. Happy Coding.