deployphp / deployer

The PHP deployment tool with support for popular frameworks out of the box
https://deployer.org
MIT License
10.41k stars 1.47k forks source link

Setup task randomly fails #3798

Open AntoineAresu opened 3 months ago

AntoineAresu commented 3 months ago

Situation:

On a symfony project, I use proxy jump to reach target server through a bastion. I'm migrating deploy tool from an easycorp/easydeploybundle fork, which works well, but is no longer maintained.

Issue:

Even if i'm sometime able to deploy, the setup task randomly fails.

Config : Symfony : 6.3 Deployer : 7.3.3

// ssh config
Host hostname
    User user
    Hostname bastionurl
    ForwardAgent yes
    ProxyJump  www-data@address
// host configuration
host('hostname')
    ->setForwardAgent(true)
    ->set('config_file', '~/.ssh/config')
    ->set('deploy_path', '~/www')
    ->setSshMultiplexing(true)
    ->set('http_user', 'user');

Output :

task deploy:info
[hostname] /usr/bin/php8.2 /home/user/Work/vault/vendor/deployer/deployer/dep worker --port 41007 --task deploy:info --host hostname --decorated -vvv
[hostname] info deploying development
done on hostname
done deploy:info 122ms
task deploy:setup
[hostname] /usr/bin/php8.2 /home/user/Work/vault/vendor/deployer/deployer/dep worker --port 41007 --task deploy:setup --host hostname --decorated -vvv
[hostname] ssh '-F' '/home/user/.ssh/config' '-A' '-o' 'ControlMaster=auto' '-o' 'ControlPersist=60' '-o' 'ControlPath=~/.ssh/hostname' 'hostname ': 369f170a5680d20ec1ea; bash -ls'
[vault-pp] run [ -d ~/www ] || mkdir -p ~/www;
cd ~/www;
[ -d .dep ] || mkdir .dep;
[ -d releases ] || mkdir releases;
[ -d shared ] || mkdir shared;
[hostname]  error  in setup.php on line 6:
[hostname] exit code -1 (Unknown error)
done deploy:setup 2s 158ms
ERROR: Task deploy:setup failed!
task deploy:failed
[hostname] /usr/bin/php8.2 /home/user/Work/vault/vendor/deployer/deployer/dep worker --port 41007 --task deploy:failed --host hostname --decorated -vvv
done on hostname
done deploy:failed 90ms
task deploy:unlock
[hostname] /usr/bin/php8.2 /home/user/Work/vault/vendor/deployer/deployer/dep worker --port 41007 --task deploy:unlock --host hostname --decorated -vvv
[hostname ssh '-F' '/home/user/.ssh/config' '-A' '-o' 'ControlMaster=auto' '-o' 'ControlPersist=60' '-o' 'ControlPath=~/.ssh/hostname' 'hostname' ': c818b48aa46313af89da; bash -ls'
[hostname] run rm -f ~/www/.dep/deploy.lock
[hostname] 
[hostname] Echec de la connexion à la cible secondaire
[hostname]  error  in lock.php on line 21:
[hostname] exit code -1 (Unknown error)
done deploy:unlock 2s 644ms
ERROR: Task deploy:unlock failed!

Upvote & Fund

Fund with Polar

tcheymol commented 3 months ago

I get the same problem here, my host is a bastion server that connects to a secondary target. The bastion is IP whitelisted, this explains the proxy jump

gbobts commented 2 months ago

You might try this configuration : https://github.com/deployphp/deployer/issues/3558#issuecomment-2027081478

It might help to determine whether the issue is related to deployer, or your environment