Skip to content

Safe Upgrade dialog is running forever #2493

@Xoriander

Description

@Xoriander

Grav Version: 1.8.0-beta.28
PHP Version: 8.4.12
Grav System Config changes: None

Steps to reproduce:

  1. Log in to Admin interface when upgrade is available.
  2. Click Update Grav Now
  3. Click Start Safe Upgrade

Expected:

Grav should be updated to the version mentioned in the notification saying that an upgrade is available.

Actual:

Safe Upgrade dialog is running forever showing this window:

Image

Output of the worker log:

(user/data/upgrades/jobs/job-2026xyz/worker.log)

Job job-2026xyz queued
Command: nohup '/usr/bin/php' '/grav/bin/grav' safe-upgrade:run --job='job-2026xyz' >> '/grav/user/data/upgrades/jobs/job-2026xyz/worker.log' 2>&1 &
PHP Fatal error:  Uncaught RuntimeException: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.3.0". You are running 7.4.33-nmm7. in /grav/vendor/composer/platform_check.php:22
Stack trace:
#0 /grav/vendor/composer/autoload_real.php(25): require()
#1 /grav/vendor/autoload.php(22): ComposerAutoloaderInitb39160710f90a14d6be86b6c7237404a::getLoader()
#2 /grav/bin/grav(26): require('/www/...')
#3 {main}
  thrown in /grav/vendor/composer/platform_check.php on line 22

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.3.0". You are running 7.4.33

Additional details:

Running the Safe Upgrade from cli with the versioned php executable works as expexted:
php84 bin/gpm selfupgrade --force --safe

Reason:

This is a special issue caused by the webserver configuration because the php version for the cli differs from the php version used by apache server. The Problem is that the hoster only allows to set the default version for the frontend.

The php executable with the incompatible version was set at this point:

try {
$finder = new PhpExecutableFinder();
$phpPath = $finder->find(false) ?: PHP_BINARY;

Possible Solution:

A solution could be to set the php path to the versioned executable:

$phpExeName = 'php' . PHP_MAJOR_VERSION . PHP_MINOR_VERSION;
$finder = new ExecutableFinder();
$phpPath = $finder->find($phpExeName);

if (!$phpPath) {
    $finder = new PhpExecutableFinder();
    $phpPath = $finder->find(false) ?: PHP_BINARY;
}

But the versioned name can differ, I also see 'php' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION under debian.
A new system setting option for the name or the path of the versioned php executable for cli commands could help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions