Fehlermeldung beim Update trotz installiertem Git "Cannot run "sync-recipes --force": git not found."

Moin,
bei Versuch von Version 6.5.6.0 zu updaten erhalte ich die Fehlermeldung „Cannot run „sync-recipes --force“: git not found.“. Git ist installiert und „DIRECTORY_SEPARATOR“ ist auf „/“ gesetzt. Die Version 6.5.? konnte ich problemlos neu installieren und dafür war Git ja bereits Voraussetzung. Nur das Update klappt nicht. Hat jemand eine Idee an was das liegen könnte?

Hier nochmal die relevanten Zeilen aus dem Protokoll:

No security vulnerability advisories found.

In InstallRecipesCommand.php line 58:

[Symfony\Component\Console\Exception\RuntimeException]
Cannot run „sync-recipes --force“: git not found.

Exception trace:
at /var/www/k6799-1/htdocs/shopware/vendor/symfony/flex/src/Command/InstallRecipesCommand.php:58
Symfony\Flex\Command\InstallRecipesCommand->execute() at phar:///var/www/k6799-1/htdocs/shopware/public/shopware-installer.phar.php/vendor/symfony/console/Command/Command.php:326
Symfony\Component\Console\Command\Command->run() at phar:///var/www/k6799-1/htdocs/shopware/public/shopware-installer.phar.php/vendor/symfony/console/Application.php:1078
Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/k6799-1/htdocs/shopware/public/shopware-installer.phar.php/vendor/symfony/console/Application.php:324
Symfony\Component\Console\Application->doRun() at phar:///var/www/k6799-1/htdocs/shopware/public/shopware-installer.phar.php/vendor/composer/composer/src/Composer/Console/Application.php:382
Composer\Console\Application->doRun() at phar:///var/www/k6799-1/htdocs/shopware/public/shopware-installer.phar.php/vendor/symfony/console/Application.php:175
Symfony\Component\Console\Application->run() at phar:///var/www/k6799-1/htdocs/shopware/public/shopware-installer.phar.php/vendor/composer/composer/src/Composer/Console/Application.php:145
Composer\Console\Application->run() at phar:///var/www/k6799-1/htdocs/shopware/public/shopware-installer.phar.php/vendor/composer/composer/bin/composer:94
include() at phar:///var/www/k6799-1/htdocs/shopware/public/shopware-installer.phar.php/vendor/bin/composer:119
require() at /var/www/k6799-1/htdocs/shopware/public/shopware-installer.phar.php:37

symfony:recipes:install [–force] [–reset] [–] […]

1 „Gefällt mir“

Ich antworte mir mal selbst, weil ich mithilfe einer Facebook-Gruppe und vor allem mithilfe meines Providers eine Lösung finden konnte:

Git wird nicht gefunden, weil der Befehl

is_executable(‚/usr/bin/git‘)

im Update Skript von Shopware durch open_basedir (Kein Zugriff auf /usr/bin/) unterbunden wird. In der Folge wird die Fehlermeldung „Cannot run „sync-recipes --force“: git not found.“ ausgegeben.

Sofern Git sicher installiert ist, kann das Update nach Auskommentieren der folgenden Zeilen durchgeführt werden:

in /htdocs/shopware/vendor/symfony/flex/src/Command/InstallRecipesCommand.php:

/*
exec(‚git --version‘, $output, $retval);
if ($retval === 0) {
// Git ist verfügbar
}
else {
// Git ist nicht verfügbar
}
*/

und in /htdocs/shopware/vendor/symfony/flex/src/Command/UpdateRecipesCommand.php

/*
if (!@is_executable(strtok(exec($win ? ‚where git‘ : ‚command -v git‘), \PHP_EOL))) {
throw new $runtimeExceptionClass(‚Cannot run „recipes:update“: git not found.‘);
*/

Und am Ende noch einen Hinweis von meinem Provider (fürs Shopware-Team): Diese Prüfung hätte man anders lösen können, in dem man die Prüfung direkt per exec durchführen würde:

exec(‚git --version‘, $output, $retval);
if ($retval === 0) {
// Git ist verfügbar
}
else {
// Git ist nicht verfügbar
}

1 „Gefällt mir“