xf-addon:upgrade causes fatal error if cwd ist inaccessible by the user

Kirby

Well-known member
Affected version
2.3.8 Preview
If xf-addon:upgrade ist started via sudo from a directory that is inaccessible for the user a fatal error is triggered

Code:
Upgrading XenForo Media Gallery from 2.3.5 to 2.3.5...
Confirm upgrade? (y/n)y

In Process.php line 356:

  [Symfony\Component\Process\Exception\RuntimeException]
  Unable to launch a new process.


Exception trace:
  at <path>/src/vendor/symfony/process/Process.php:356
 Symfony\Component\Process\Process->start() at <path>/src/vendor/symfony/process/Process.php:253
 Symfony\Component\Process\Process->run() at <path>/src/vendor/symfony/console/Helper/ProcessHelper.php:73
 Symfony\Component\Console\Helper\ProcessHelper->run() at <path>/src/vendor/symfony/console/Helper/ProcessHelper.php:103
 Symfony\Component\Console\Helper\ProcessHelper->mustRun() at <path>/src/XF/Cli/Command/AddOnActionTrait.php:238
 XF\Cli\Command\AddOnUpgrade->runSubAction() at <path>/src/XF/Cli/Command/AddOnUpgrade.php:120
 XF\Cli\Command\AddOnUpgrade->execute() at <path>/src/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at <path>/src/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at <path>/src/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at <path>/src/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at <path>/src/XF/Cli/Runner.php:115
 XF\Cli\Runner->run() at <path>/cmd.php:17

This leaves the system in an inconsistent state (causing further issues) and seems to be a regression from XenForo 2.2 where this works fine.
 
Also happens without sudo if forceCliUser is set and the command is started by a different user from a directory that the configured user cannot access.
 
Back
Top Bottom