Closed miqrogroove closed 9 months ago
Workaround:
Replace the function under app/Services/UpgradeService.php as follows
private function fetchLatestVersion(bool $force): string
{
return '2.1.18|2.0.0|https://github.com/fisharebest/webtrees/releases/download/2.1.18/webtrees-2.1.18.zip';
}
Then:
mysql> UPDATE site_setting SET setting_value = '' WHERE setting_name = 'LATEST_WT_VERSION_ERROR';
The cause of the problem is that an update check is carried out with every request (click or spider). Only if the attempt is successful LAST_WT_VERSION_TIMESTAMP will be set to the current time and the next query will take place in approximately 24 hours.
I use the following workaround in function fetchLatestVersion:
Old from linme358:
} else {
Site::setPreference('LATEST_WT_VERSION_ERROR', 'HTTP' . $response->getStatusCode());
}
} catch (GuzzleException $ex) {
// Can't connect to the server?
// Use the existing information about latest versions.
Site::setPreference('LATEST_WT_VERSION_ERROR', $ex->getMessage());
}
new:
} else {
Site::setPreference('LATEST_WT_VERSION_ERROR', 'HTTP' . $response->getStatusCode());
Site::setPreference('LATEST_WT_VERSION_TIMESTAMP', (string) $current_timestamp);
}
} catch (GuzzleException $ex) {
// Can't connect to the server?
// Use the existing information about latest versions.
Site::setPreference('LATEST_WT_VERSION_ERROR', $ex->getMessage());
Site::setPreference('LATEST_WT_VERSION_TIMESTAMP', (string) $current_timestamp);
}
The next access to the update server takes place one day later, regardless of whether the access was successful.
The error message appears in two installations exactly from 27.12.2023 in the webtrees log under "config". Since there were no program changes before that, there seems to be a problem on the update server.
there seems to be a problem on the update server.
There was a problem with the update server (the first significant downtime in 10+ years?).
It has now been moved to a new (and more powerful) server and is working again.
@FrankWarius - yes, we need a solution like the one you propose.
To minimize update racing, it would be better to reset the timestamp before waiting for connection errors.
My server is throwing this error about 50 times per minute and the server is now running extremely slow.
I suspect the UpgradeService is failing to update the version check timestamp when connection errors occur.