Support

Admin Tools

#29977 Problems with update

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by drlukacs on Friday, 20 July 2018 09:08 CDT

drlukacs
Hi,

I was running into trouble upgrading to 5.1.3 -- I keep getting error code 403. Then, suddenly, it did upgrade (on one of the copies of the website), but the result seems to be inconsistent.

I was wondering if you are aware of the issue.

Best wishes,
Gabor

nicholas
Akeeba Staff
Manager
Can you please where you were getting the 403? If it was displayed as an error in a Joomla! message box it has to do with the way Joomla! handles download URLs for updates (namely, how it applies the download ID).

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!

drlukacs
Hi Nickolas,

The 403 was displayed as an error in a Joomla! message box. The funny thing is that after I attempted to update a few times, it went through -- but on an other copy it would not (so far).

What is funny about this error is that it is inconsistent. Very hard to debug.

Best wishes,
Gabor

nicholas
Akeeba Staff
Manager
This happens when Joomla! has not gotten the memo about your Download ID but has already figured out there is an update. In this case the download URL does not contain the Download ID. This resets after up to 24 hours (the exact timeout depends on your settings in Extensions, Manage, Options). After the cache timeout Joomla! refetches the updates, sees the Download ID and the download succeeds.

The alternative to that is us using a plugin to supply the download ID for the download URL instead of using Joomla's extra query method. The downside to the plugin is that if it's not published the Download ID is not applied, making updates impossible. At least with the method we use we can tell clients "hey, put a new Download ID in and just wait 24 hours".

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!

drlukacs
Hi Nicholas,

Although I am quite familiar with caching and Joomla, I am afraid I am unable to follow your explanation.

The cache can be cleaned -- and I have already cleaned it. Moreover, I am not a new subscriber. So, that alone could not have possibly been the problem.

Could you please elaborate on the issue?

Best,
Gabor

nicholas
Akeeba Staff
Manager
TL;DR. Go to Components, Admin Tools. Look to the right of the page. Click on Reload Update Information. On some sites you have to go back to Joomla's control panel, clear the administrator cache and then redo what I said. If you still have a problem please re-enter your Download ID after checking it on our site and repeat the instructions in this paragraph.

I can also tell you why you need to do that.

I am not talking about the page cache. I am talking about the updates cache. You cannot clean the updates cache, it's stored in the database. I can tell you with absolute certainty how Joomla! extension updates work. I am one of the four people who are still active in Joomla! and know how this beast works inside and out. I am the person who introduced support for extra_query in it (see below), albeit with the constraints imposed to me by the production leadership team at the time (2012-2013), therefore it's not exactly the elegant solution I intended to contribute...

It doesn't matter if you are a new subscriber or an old subscriber. Joomla! works the same. First it downloads the XML update stream for the extension. If it finds an update it caches its version and the download location, from the XML update stream, in the database. The XML update stream is common for all users of the software and cannot include personalized information or secrets, such as your Download ID.

The problem is that if you would you ask it to install an update, the generic download URL it has wouldn't work since Joomla, making the request, is not logged in on our site. There are exactly TWO (2) ways to work around that:

1. The extra_query method, contributed to Joomla by yours truly. When you enter the Download ID in our software we populate the extra_query field of the #__update_sites database table. This is where Joomla stores the locations of the update XML streams. In your case, we look for the Admin Tools stream and fill in the extra_query field with
&dlid=YOUR_DOWNLOAD_ID
. When Joomla! finds an update it appends the extra_query to the Download URL it stores in the database. Therefore IF AND ONLY IF the extra_query is correctly populated when fetching the update information THEN AND ONLY THEN will the Download URL be correct.

2. Using a plugin. The other way is having a plugin in the "installer" group. When Joomla! tries to install an update and before it downloads the update ZIP file it triggers an event handled by that plugin. The plugin can then modify the Download URL Joomla! sees. The drawback with that approach is that if the plugin is uninstalled, not updated or simply disabled the updates will fail.

We use the FIRST method. This means that the Download ID must have been entered and the extra_query field populated BEFORE you or Joomla! tries to fetch update information. When Joomla! fetches the update information and sees the update it will cache whatever Download URL it can figure out in its database. This Download URL will stay in the database for as long as the cache time is defined in Extensions, Manage, Update, Options. It has NOTHING to do with your site's front-end or administrator cache (even though for some ass backwards reasons the administrator cache CAN get in the way if we were to use the second method, a plugin, which is the main reason we don't!). When you ask Joomla to install an update it retrieves the Download URL from the updates cache it keeps in its database. The updates cache timeout can be configured 0 to 24 hours with a default value of 6. That's why I told you wait 24 hours.

Also note that Joomla! may be asked to rebuild the update sites. When that happens the extra_query field contents are removed. Even though you have entered a Download ID in our software Joomla! can no longer see it so updates will always fail.

We know of all of these issues and about five pages' wort more that I won't bother putting in words. We have created an automated recovery for most of them. Half of the solution runs automatically when you go in our software's control panel (Components, Admin Tools) and half of it when you click its Reload Update Information.

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!

drlukacs
Dear Nicholas,

Thank you for incredibly comprehensive response, which I greatly enjoyed reading. I am very interested in how Joomla works, and so I appreciate the insight.

Eventually, putting the download ID in again is what got things working.

I will keep monitoring the problem in the next updates, and will let you know.

Thank you again for the detailed explanation.

Best wishes,
Gabor

Support Information

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!