No Code Attached Yet bug
avatar brianteeman
brianteeman
3 Oct 2023

Steps to reproduce the issue

with a php version LESS than 8.1
install and configure joomla 4.4
set the update url to https://update.joomla.org/core/nightlies/next_major_list.xml
check for updates

Expected result

something happens. Probably an error message about not having the required php version. OR more helpfully the preinstall check shows exactly what the problem is. Otherwise it does make the very first check redundant as you can only see that if you are already compliant

image

Actual result

Generic we can not find an update url message. No mention at all that its because the site doesnt match the requirements for 5.0. Especially confusing because the dashboard says a new version is available.

System information (as much as possible)

Additional comments

avatar brianteeman brianteeman - open - 3 Oct 2023
avatar joomla-cms-bot joomla-cms-bot - change - 3 Oct 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 3 Oct 2023
avatar brianteeman brianteeman - change - 3 Oct 2023
The description was changed
avatar brianteeman brianteeman - edited - 3 Oct 2023
avatar richard67
richard67 - comment - 3 Oct 2023

@brianteeman In section „Actual result“ you wrote:

Generic we can find an update url message.

I assume you meant „we can’t find”.

avatar brianteeman brianteeman - change - 3 Oct 2023
The description was changed
avatar brianteeman brianteeman - edited - 3 Oct 2023
avatar brianteeman brianteeman - change - 4 Oct 2023
Title
[5.0] update does nothing
[4.4] update does nothing
avatar brianteeman brianteeman - edited - 4 Oct 2023
avatar richard67
richard67 - comment - 4 Oct 2023

There was an attempt to fix it but it was given up: #38799 .

The issue was reported in past with #38694 , which was closed when the PR mentioned above was created, but it was not reopened when that PR was closed.

As far as I can see, that PR would not have solved the issue when the current installation meets the requirements but the updated site would not, and it checked the requirements of the database driver, which are lower than those of the CMS.

avatar Fedik
Fedik - comment - 6 Oct 2023

Also DB version check would be good,
I was able to run update on MySQL 5.6 that should not be possible :)
(it is half failed but the site still works)

avatar richard67
richard67 - comment - 6 Oct 2023

@Fedik Problem with DB version check is that currently we have the information about the DB requirement of the CMS only in the installation folder in the DatabaseHelper and in the XML files of the update server, but nowhere in a regular installation locally. The check with the minimum version required by the framework's database driver results in a lower requirement.

avatar Fedik
Fedik - comment - 6 Oct 2023

We probably can hardcode it somewhere, in update script/model/view or controller,
Not sure currently how it should be displayed and processed

avatar richard67
richard67 - comment - 6 Oct 2023

For the PHP version it is hardcoded in the index.php files in the root, in administrator and in installation.

avatar Fedik
Fedik - comment - 6 Oct 2023

Maybe something what you made in #41757 or to what we did with log:

// Make sure logging is working before continue
try {
Log::add('Test logging', Log::INFO, 'Update');
} catch (\Throwable $e) {
$message = Text::sprintf('COM_JOOMLAUPDATE_UPDATE_LOGGING_TEST_FAIL', $e->getMessage());
$this->setRedirect('index.php?option=com_joomlaupdate', $message, 'error');
return;
}

Having something like

if($updateToMajorVersion) { 
$this->checkMinRequirement(); 
}

Hmhm, but can be tricky

avatar richard67
richard67 - comment - 6 Oct 2023

$this->checkMinRequirement(); uses the database driver's requirement, as far as I remember, and that's not the same as the CMS requirement.

avatar Fedik
Fedik - comment - 6 Oct 2023

Ah no, I mean a new method $this->blablaCheckMinRequirement(), nothing from existing.
Where we can hardcode everything ?

avatar Fedik
Fedik - comment - 6 Oct 2023

Hm, but we already have it https://update.joomla.org/core/test/extension_test.xml

<supported_databases mysql="8.0.13" mariadb="10.4.0" postgresql="12.0"/>

It just not processed/validated, only check for type

public function isDatabaseTypeSupported()

Okay, so it seems just need one more method and option for the overview list :)

avatar Fedik
Fedik - comment - 6 Oct 2023

something happens. Probably an error message about not having the required php version.

@brianteeman I not sure now, where the issue is, when I example modify the requirement to php 9, then it shows me failed "check".
That what I would expect, maybe I missing something?

Screenshot 2023-10-06_15-40-02

avatar richard67
richard67 - comment - 6 Oct 2023

Hm, but we already have it https://update.joomla.org/core/test/extension_test.xml

<supported_databases mysql="8.0.13" mariadb="10.4.0" postgresql="12.0"/>

It just not processed/validated, only check for type

This helps only if the update site is reachable and an update would be found.

avatar richard67
richard67 - comment - 6 Oct 2023

Hmm I think @Fedik is right and we can do something here. I was confused by my daily work. And now I am tired, was a hard day for me. Will check tomorrow what we can do, if Fedir is not faster.

avatar Fedik
Fedik - comment - 7 Oct 2023

@richard67 here is for DB version check:

avatar brianteeman
brianteeman - comment - 7 Oct 2023

@Fedik there are checks taking place at different times in the process.

If your site is running php 7.x and you try to update it reads the xml it looks for an entry on the update server for that php version. If it doesnt find one then it reports no url found

avatar Fedik
Fedik - comment - 7 Oct 2023

Ah, I understood now, the issue that it does not show anything usefull, and user may think that there is no update.

avatar Fedik Fedik - change - 7 Oct 2023
Labels Added: bug
avatar Fedik Fedik - labeled - 7 Oct 2023
avatar Fedik
Fedik - comment - 7 Oct 2023

The issue that Joomla\CMS\Updater\Update

$update = new Update();
$update->loadFromXml($updateObject->detailsurl, $minimumStability);

return empty result when PHP or DB is incompatible, so we cannot even get the information whether there any incompatibility.

$phpMatch = false;
// Check if PHP version supported via <php_minimum> tag, assume true if tag isn't present
if (!isset($this->currentUpdate->php_minimum) || version_compare(PHP_VERSION, $this->currentUpdate->php_minimum->_data, '>=')) {
$phpMatch = true;
}
$dbMatch = false;
// Check if DB & version is supported via <supported_databases> tag, assume supported if tag isn't present
if (isset($this->currentUpdate->supported_databases)) {
$db = Factory::getDbo();
$dbType = strtolower($db->getServerType());
$dbVersion = $db->getVersion();
$supportedDbs = $this->currentUpdate->supported_databases;
// MySQL and MariaDB use the same database driver but not the same version numbers
if ($dbType === 'mysql') {
// Check whether we have a MariaDB version string and extract the proper version from it
if (stripos($dbVersion, 'mariadb') !== false) {
// MariaDB: Strip off any leading '5.5.5-', if present
$dbVersion = preg_replace('/^5\.5\.5-/', '', $dbVersion);
$dbType = 'mariadb';
}
}
// Do we have an entry for the database?
if (isset($supportedDbs->$dbType)) {
$minimumVersion = $supportedDbs->$dbType;
$dbMatch = version_compare($dbVersion, $minimumVersion, '>=');
}
} else {
// Set to true if the <supported_databases> tag is not set
$dbMatch = true;
}
// Check minimum stability
$stabilityMatch = true;
if (isset($this->currentUpdate->stability) && ($this->currentUpdate->stability < $this->minimum_stability)) {
$stabilityMatch = false;
}
if ($phpMatch && $stabilityMatch && $dbMatch) {
if (!empty($this->currentUpdate->downloadurl) && !empty($this->currentUpdate->downloadurl->_data)) {
$this->compatibleVersions[] = $this->currentUpdate->version->_data;
}
if (
!isset($this->latest)
|| version_compare($this->currentUpdate->version->_data, $this->latest->version->_data, '>')
) {
$this->latest = $this->currentUpdate;
}
}
}

avatar brianteeman
brianteeman - comment - 7 Oct 2023

Ah, I understood now, the issue that it does not show anything usefull, and user may think that there is no update.

exactly

avatar brianteeman
brianteeman - comment - 8 Oct 2023

I have done what I can to raise this important issue and request that it is a release blocker. I can only do so much.

avatar richard67
richard67 - comment - 9 Oct 2023

As far as I remember there was once in 4.x made an optimization for the Joomla Updates Quick Icon. Maybe that's the reason that it shows an available update when the Joomla Update component doesn't find one? The PHP and database requirements are in the details XML file of the update site. If the quickicon doesn't check the details xml but only the list XML (where we also have the targetplatformversion but not the PHP and DB requirements), it will explain that behaviour.

There are 2 possible ways out without having to rewrite the complete updater library for that case:

  1. We let the quick icon also check the details XML so it doesn't show the update when the PHP and DB requirements are not met. So we are consistent between quick icon and Joomla Update component, but it might have a performance impact on the quickicon, maybe need to check and if necessary improve caching for that.
  2. We let the Joomla Update component run both checks, the check from the quickicon and the check for updastes with the updater library. That is silly but maybe easier than changing code of the updater library. When the results (number of updates found) is the same, we do nothing, but when the check from the quick icon shows something larger than zero, and the check for updates results in zero found, we could show an alert that there might be updates available but they require higher PHP or database versions than the current site has.

So or so it is an old problem not introduced with 4.4 or 5.0 so I wouldn't say it's a release blocker.

avatar brianteeman
brianteeman - comment - 9 Oct 2023

We let the quick icon also check the details XML so it doesn't show the update when the PHP and DB requirements are not met.

That just moves the problem - user hears about a new version but their site makes no mention of the update and they dont know why

So or so it is an old problem not introduced with 4.4 or 5.0 so I wouldn't say it's a release blocker.

Of course its a new problem. We didnt have a higher version of php or joomla as a requirement before.

But it seems everyone thinks it is acceptable to hide the availability of an update without explaining why.

avatar Fedik
Fedik - comment - 9 Oct 2023

I think Quickicon should do the same as Component do. At current point: "show nothing" when compatible update did not found.

$hasUpdate = !empty($this->updateInfo['hasUpdate']);
$hasDownload = isset($this->updateInfo['object']->downloadurl->_data);

Then we should look how to improve it.
Maybe need some new mechanism (or changes to existing) to load update information, separately.

What Joomla\CMS\Updater\Update is doing is extarcting download url for compatible update. (technicaly we can have diferent packges: only for Mysql, or only for PHP 5 etc)
It is not very usable for retrieve Update information.

Currently I have no idea how it can be done.

Of course its a new problem.

If I right remember, it was the same for 3 to 4 update.

avatar richard67
richard67 - comment - 9 Oct 2023

If I right remember, it was the same for 3 to 4 update.

I remember the same.

avatar brianteeman
brianteeman - comment - 9 Oct 2023

I dont' I am sure it came in when the emptystate code was added in j4

avatar brianteeman
brianteeman - comment - 9 Oct 2023

but whichever is the case it doesnt resolve the problem

avatar brianteeman
brianteeman - comment - 9 Oct 2023

Is this an acceptable quick fix ??

chrome_2023-10-09_14-03-39.mp4
avatar richard67
richard67 - comment - 9 Oct 2023

I would think yes, but to be sure I'd like to see the code.

avatar brianteeman
brianteeman - comment - 9 Oct 2023

No code - just a string edit

- COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_TITLE="We can't find a download URL"
+ COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_TITLE="This site can not be updated to Joomla %1$s as this web server does not meet the minimum requirements."
avatar Fedik
Fedik - comment - 9 Oct 2023

Looks not bad.

We can't find a download URL

We can't find a download URL for your server environment
People not always read the description ;)

avatar richard67
richard67 - comment - 9 Oct 2023

No code - just a string edit

I see. So it's shown always when no update found.

avatar Fedik
Fedik - comment - 9 Oct 2023

Not realy, it will be shown when Update available, but download URL is empty:

if ($hasUpdate) {
$this->messagePrefix = '_NODOWNLOAD';
}

avatar richard67
richard67 - comment - 9 Oct 2023

Ah.

avatar richard67
richard67 - comment - 9 Oct 2023

Maybe the message could refer to the documentation? We could e.g. add to the end:

<br>Check <a class=\"alert-link\" href=\"https://downloads.joomla.org/technical-requirements\" target=\"_blank\" rel=\"noopener noreferrer\">the technical requirements</a> and switch to a suitable server, or check <a class=\"alert-link\" href=\"https://downloads.joomla.org/latest\" target=\"_blank\" rel=\"noopener noreferrer\">the official Joomla download page</a> for a Joomla <em><strong>Upgrade Package</strong></em> which works with your server.
avatar brianteeman
brianteeman - comment - 9 Oct 2023

agreed - it was just as poc

of course it needs to be a link to a page with actual content ;)

avatar brianteeman
brianteeman - comment - 9 Oct 2023

I will wait for a release lead approval before making a pr

avatar richard67
richard67 - comment - 9 Oct 2023

of course it needs to be a link to a page with actual content ;)

@brianteeman Currently the page for which I suggested the link is empty, but it says it will be updated soon and it links to the developer docs with the right info, so I think we still can use that and not the developer docs link which we later might have to change back.

avatar brianteeman
brianteeman - comment - 9 Oct 2023

please test #42103

avatar richard67
richard67 - comment - 9 Oct 2023

Can this issue be closed as we have a PR? OR is something remaining to be done?

avatar brianteeman
brianteeman - comment - 9 Oct 2023

i just hadnt pressed the button yet - you were too fast

avatar brianteeman brianteeman - close - 9 Oct 2023
avatar brianteeman brianteeman - change - 9 Oct 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-10-09 18:13:53
Closed_By brianteeman

Add a Comment

Login with GitHub to post a comment