AB updated without problem
AT with the same download ID gives a 403
Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Latest post by brianteeman on Tuesday, 23 March 2021 08:56 CDT
AB updated without problem
AT with the same download ID gives a 403
Hello, Brian! I will give you the same reply I give to people with this issue. It's too long to paraphrase.
Hello and thank you for contacting us about your update issue.
There is no problem with your account or our site. You have hit a Joomla bug. Please note that all of the following information is already in our documentation.
Before we begin please understand that extension updates are discovered, downloaded and installed by Joomla itself, using code that's under the absolute and total control of the Joomla project. Akeeba Ltd can not and does not have any influence on that code. In simple terms, your issue is a Joomla bug which is NOT influenced by anything we have done, currently do or can ever do. We can only offer a workaround and an explanation.
Workaround
IMPORTANT! Please follow all of these steps in the exact order provided below, without skipping any one of them even if you think it is unnecessary. Each step and the order we tell you to follow is the result of dozens of hours poring over Joomla's code, understanding how it works and figuring out the shortest workaround to many weird things Joomla does.
For each one of your sites:
Explanation
Joomla handles the extensions updates on its own, using code inside Joomla itself. This feature was originally written to only support free extensions. Back in Joomla! 3.2 support for paid extensions was added. The following is a technical explanation of how Joomla finds updates and how it determines the download URL when you choose to update a paid extension.
How updates work
Joomla cannot read the Download ID from the component's configuration. Whenever you click on Save & Close in our software's Options page you come back to the main page of our software. There, we check if the Download ID in the Options has changed. If it has, we find the row in the #__update_sites table for our software and add
dlid=THE_DOWNLOAD_ID_YOU_ENTERED
in the extra_query column.
When Joomla tries to find updates it reads the contents of the URL in the location column of the #__update_sites table. This is a static XML file listing all published versions of an extension. Joomla finds the latest version compatible with your Joomla version. Then it checks the latest version with the version currently installed on your site. If the version is different (not necessarily newer, mind you!) it decides there is an update available. At this point it creates a new row in the #__updates table and copies the extra_query column from the #__update_sites table's row to the new row in the #__updates table. At this point Joomla HAS NOT YET determined the download URL for the new version.
When you select an extension and click on the Update button Joomla reads the corresponding row of the #__updates table. It goes ahead and reads the contents of the detailsurl of that row. This is the same XML file it read to determine if there's an update available. Now it reads the downloadurl information from the XML file which contains the download URL for the new version without the Download ID. At this point Joomla combines this download URL with extra_query column of the #__updates table's row to create the real download URL. Moreover, it calls the XXX event to let any plugins in the "installer" group to modify the download URL. It then tries to download the new version's ZIP file from this modified download URL.
Why you get a 403
As you can understand from the explanation above, if the extra_query column in the #__update_sites table is empty or contains an invalid Download ID when Joomla tries to find updates then the download URL will contain no or an invalid Download ID. As a result our site will forbid downloading the update with a 403 Forbidden error message. Joomla suppresses all information except the 403 error code.
The only way to correct this issue is to replace the extra_query in the #__update_sites table, clear all updates, have Joomla find all updates again (so the #__updates rows have the updated extra_query) and then retry to apply the updates.
Why do you need the complicated workaround
This brings us back to Joomla doing some really weird things with updates.
For starters, it does not read the Download ID from the component's Options, it uses the extra_query column in the #__updates table. The only way to work around that and have our component replace the extra_query column in the #__updates table is to clear and re-enter the Download ID which triggers our code that applies the extra_query.
The second weird thing is that the extra_query column appears twice, once in the #__update_sites and once in the #__updates table. Therefore we need to replace the #__updates table records. The only way to do that is through Joomla's extension updater's Clear Cache which empties the #__updates_table.
However, Joomla does something which makes no sense. It caches the database queries! Even though we replaced the extra_query column in #__update_sites and cleared the #__updates table (i.e. the updates cache) Joomla will STILL see the old, non-working updates unless we go to Clear Cache and clear the administrator cache. Even funnier, the database query cache which is part of the "system" cache may not even show up in the Clean Cache page, totally misleading the user! That's why we ask you to blindly click on Clear All on that page.
Now that the queries cache is cleared we might still see updates because Joomla did not, in fact, clear the updates cache (the #__updates table) when we told it to because of the database query cache. That's another thing that makes no sense. Therefore we need to click on Clear Cache in the Update page again to have Joomla actually clear the update cache.
At this point we can now tell Joomla to Find Updates which will trigger the entire process we detailed above, finding the updates and using the correct extra_query. At this point applying updates works fine since we've worked around all the weird things Joomla does when trying to find and apply updates. Lucklily, this is only required once.
Why did that happen
The problem is that the extra_query column in the #__updates table went missing. There are two reasons why this could happen:
1. You clicked on the Refresh Update Sites button in the Updates page. This feature is VERY BUGGY. It silently removes the extra_query column from ALL RECORDS of the #__update_sites table. You get no warning whatsoever.
2. A third party extension triggered the Refresh Update Sites feature or stupidly deleted the extra_query column of the #__updates_sites table.
Neither of these two root causes are under our control, nor can we do anything to stop that from happening.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!
I only reported it because I saw in the changelog that you had worked on the installer ;)
Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.
Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!