Wrong PHP binary path in "db:backup" task #38
-
Hey there! There seems to be a problem in the "db:backup" task. I have specified the server-specific path to the correct PHP version ( deploy.php with placeholders (***) for sensitive values <?php
namespace Deployer;
require_once(__DIR__ . '/vendor/sourcebroker/deployer-loader/autoload.php');
new \SourceBroker\DeployerExtendedTypo3\Loader();
set('repository', 'ssh://git@***:***/toelke/308-typo3-deployer.git');
set('keep_releases', 5);
set('driver_typo3cms', true);
host('moria')
->set('hostname', '***.***.de')
->set('port', 10022)
->set('branch', 'main')
->set('bin/php', '/usr/bin/php8.2')
->set('public_urls', ['http://***.***.net/toelke/308-typo3-deployer/current/public'])
->set('dotenv', '/data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/shared/.env')
->set('deploy_path', '/data/mounts/webspaces/php8.2/toelke/308-typo3-deployer');
host('local')
->set('branch', 'main')
->set('deploy_path', getcwd())
->set('public_urls', ['https://308-typo3-deploy.ddev.site']); However, this is not the case here: Output snippet of task db:backup
[moria] run . /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/shared/.env; cd /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer && cat .dep/latest_release || echo 0
[moria] 30
[moria] run . /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/shared/.env; if [ -e '/data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/bin/dep' ]; then echo +accurate; fi
[moria] +accurate
[moria] run . /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/shared/.env; cd /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30 && /usr/bin/php8.2 /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/bin/dep db:export moria --options=dumpcode:backup_for_release_30_6bd0998b74384abe4ecaf17c55b1ccc9 -vvv
[moria] task db:export
[moria] [moria] /usr/bin/php8.2 /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep worker --port 36557 --task db:export --host moria --options dumpcode:backup_for_release_30_6bd0998b74384abe4ecaf17c55b1ccc9 -vvv
[moria] [localhost] run command -v 'php' || which 'php' || type -p 'php'
[moria] [localhost] /usr/bin/php
[moria] [moria] Deployer\Exception\ConfigurationException in Typo3CmsDriver.php on line 22:
[moria] [moria]
[moria] [moria] Command: "/usr/bin/php ./vendor/bin/typo3 configuration:showactive DB --json" returned error code: "255"
[moria] [moria]
[moria] [moria] #0 /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/sourcebroker/deployer-extended-typo3/deployer/10-12/set.php(70): SourceBroker\DeployerExtendedTypo3\Drivers\Typo3CmsDriver->getDatabaseConfig()
[moria] [moria] #1 /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/sourcebroker/deployer-extended-database/deployer/db/config/set.php(62): SourceBroker\DeployerLoader\Utility\FileUtility->Deployer\{closure}()
[moria] [moria] #2 [internal function]: SourceBroker\DeployerLoader\Utility\FileUtility->Deployer\{closure}()
[moria] [moria] #3 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/src/Configuration/Configuration.php(100): call_user_func()
[moria] [moria] #4 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/src/functions.php(696): Deployer\Configuration\Configuration->get()
[moria] [moria] #5 /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/sourcebroker/deployer-extended-database/deployer/db/task/db_export.php(29): Deployer\get()
[moria] [moria] #6 [internal function]: SourceBroker\DeployerLoader\Utility\FileUtility->Deployer\{closure}()
[moria] [moria] #7 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/src/Task/Task.php(90): call_user_func()
[moria] [moria] #8 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/src/Executor/Worker.php(38): Deployer\Task\Task->run()
[moria] [moria] #9 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/src/Command/WorkerCommand.php(52): Deployer\Executor\Worker->execute()
[moria] [moria] #10 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/vendor/symfony/console/Command/Command.php(298): Deployer\Command\WorkerCommand->execute()
[moria] [moria] #11 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
[moria] [moria] #12 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
[moria] [moria] #13 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
[moria] [moria] #14 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/src/Deployer.php(317): Symfony\Component\Console\Application->run()
[moria] [moria] #15 phar:///data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep/bin/dep(96): Deployer\Deployer::run()
[moria] [moria] #16 /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/deployer/deployer/dep(4): require('...')
[moria] [moria] #17 {main}
[moria] Composer detected issues in your platform:
[moria] Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.2.34-39+ubuntu20.04.1+deb.sury.org+1.
[moria] PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.2.34-39+ubuntu20.04.1+deb.sury.org+1. in /data/mounts/webspaces/php8.2/toelke/308-typo3-deployer/releases/30/vendor/composer/platform_check.php on line 24
[moria] done db:export 181ms
[moria] �[0K�[31;1mERROR: Task db:export failed!�[0;m If I see it correctly, it queries locally where the PHP binary is located and then applies this to the remote server: If I replace Best regards |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
@einNicklas Especially the part about moria itself
Also do you have in .env file |
Beta Was this translation helpful? Give feedback.
-
Si si, the deploy.php files are identical and the |
Beta Was this translation helpful? Give feedback.
-
I must admit I do not use We have two problems here:
So the fix for this (which I do not like much but I see not other solution for now) is to define 'local/bin/php' next to 'bin/php' for host like:
You can test it when you get |
Beta Was this translation helpful? Give feedback.
-
Thanks for the information and the quick fix! |
Beta Was this translation helpful? Give feedback.
@einNicklas
I must admit I do not use
driver_typo3cms
so I did not face this bug ealier.We have two problems here:
We can not use "bin/php" as in deployer this variable by default requires connection to remote host so when you would be on moria it would try to connect with ssh to moria because moria is not defined as localhost. If you would redefine 'bin/php' in deploy.php as simple string then it would not connect but not all users define 'bin/php' in their deploy.php file - so for them it would fail. I suppose the long term solution here would be to dynamically redefine current hosts as localhosts, but that would require lot of refactor.
This is why 'local/bin/php' has been introdu…