Deployer: Closed

Created on 14 Jun 2016  Β·  18Comments  Β·  Source: deployphp/deployer

| Q | A |
| --- | --- |
| Issue Type | Question |
| Deployer Version | Using .phar version, 3.3.0 |
| Local Machine OS | Windows 7 |
| Remote Machine OS | Debian 8 |

Description

I can't connect to my server with Deployer, but "normal SSH" connexion is working (through Git Bash, OpenSSH, Putty...).

Content of deploy.php

<?php
require 'recipe/symfony.php';
set('ssh_type','ext-ssh2');

server('preprod', 'XX.XX.XX.XXX')
    ->user('user')
    ->configFile('C:/Users/user/.ssh/config')
    ->stage('production')
    ->env('deploy_path', '/var/www/path/www');

set('repository', 'https://[email protected]/user/repo.git');

Output log

$ php deployer.phar deploy preprod -vvv
Ô×ñ Executing task ←[32mdeploy:prepare←[39m
Γ”Γ₯β”‚ on [preprod]
←[31m>←[39m echo $0

Warning: ssh2_connect(): Unable to connect to XX.XX.XX.XXX on port 22 in phar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Session.php o
n line 153

Warning: ssh2_connect(): Unable to connect to XX.XX.XX.XXX in phar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Session.php on line 153
←[37;41m                                                                                      ←[39;49m
←[37;41m  Shell on your server is not POSIX-compliant. Please change to sh, bash or similar.  ←[39;49m
←[37;41m  Usually, you can change your shell to bash by running: chsh -s /bin/bash            ←[39;49m
←[37;41m                                                                                      ←[39;49m
←[37;41m                              ←[39;49m
←[37;41m  [RuntimeException]          ←[39;49m
←[37;41m  The SSH connection failed.  ←[39;49m
←[37;41m                              ←[39;49m

←[33mException trace:←[39m
 () at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Session.php:134←[39m
 Ssh\Session->createResource() at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/AbstractResourceHolder.php:25←[39m
 Ssh\AbstractResourceHolder->getResource() at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Subsystem.php:39←[39m
 Ssh\Subsystem->getSessionResource() at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Exec.php:18←[39m
 Ssh\Exec->createResource() at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/AbstractResourceHolder.php:25←[39m
 Ssh\AbstractResourceHolder->getResource() at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/herzult/php-ssh/src/Ssh/Exec.php:24←[39m
 Ssh\Exec->run() at ←[32mphar://C:/wamp/www/repo/deployer.phar/src/Server/Remote/SshExtension.php:116←[39m
 Deployer\Server\Remote\SshExtension->run() at ←[32mphar://C:/wamp/www/repo/deployer.phar/src/functions.php:296←[39m
 run() at ←[32mphar://C:/wamp/www/repo/deployer.phar/recipe/common.php:110←[39m
 {closure}() at ←[32mn/a:n/a←[39m
 call_user_func() at ←[32mphar://C:/wamp/www/repo/deployer.phar/src/Task/Task.php:79←[39m
 Deployer\Task\Task->run() at ←[32mphar://C:/wamp/www/repo/deployer.phar/src/Executor/SeriesExecutor.php:43←[39m
 Deployer\Executor\SeriesExecutor->run() at ←[32mphar://C:/wamp/www/repo/deployer.phar/src/Console/TaskCommand.php:82←[39m
 Deployer\Console\TaskCommand->execute() at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/symfony/console/Command/Command.php:256←[39m
 Symfony\Component\Console\Command\Command->run() at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/symfony/console/Application.php:791←[39m
 Symfony\Component\Console\Application->doRunCommand() at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/symfony/console/Application.php:186←[39m
 Symfony\Component\Console\Application->doRun() at ←[32mphar://C:/wamp/www/repo/deployer.phar/vendor/symfony/console/Application.php:117←[39m
 Symfony\Component\Console\Application->run() at ←[32mphar://C:/wamp/www/repo/deployer.phar/src/Deployer.php:101←[39m
 Deployer\Deployer->run() at ←[32mphar://C:/wamp/www/repo/deployer.phar/bin/dep:63←[39m
 require() at ←[32mC:\wamp\www\repo\deployer.phar:4←[39m

←[32mdeploy [-p|--parallel]←[39m

bug

Most helpful comment

I have the same issue.

and I find out echo $0 will output '-bash'.

yes, with leading "-".

using native ssh and deployer 4.2.1

but phpseclib is okay.

All 18 comments

@elfet This seems like an ssh2 extension bug

@oanhnn Has this bug been reported to ssh2 developers?

Do I have another solution to connect to my server in the meantime?

Is there any solution for this problem? Or is that mean that ext-ssh2 doesn't work in deployer?

It's working. In Deployer v4 you can use native ssh implementation.

Is v4 released ? The doc/website still mention v3.3.

And if yes, what is the correct setup to use the native SSH ? The doc has not been updated or so it seems.

Many thanks!

v4 in still in progress. Will be releases soon i hope.

Ok thanks! Can't wait, still using the old version of Capifony here...

If you want to support Deployer development you can become backer on https://www.patreon.com/deployer

Still doesn't work for me in 4.0.1 :/

@sebastianlp
What is method you used? ssh2, phpseclib or native ssh ?
Can you try with other method?

You can close it, now it's working with native ssh.

Cool.

I have the same issue.

and I find out echo $0 will output '-bash'.

yes, with leading "-".

using native ssh and deployer 4.2.1

but phpseclib is okay.

I'm having this issue too. Has is been resolved and if so, how?

closed but no comment on how to fix this @antonmedv

Open new issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sweebee picture sweebee  Β·  3Comments

greatwitenorth picture greatwitenorth  Β·  4Comments

minkbear picture minkbear  Β·  4Comments

krve picture krve  Β·  4Comments

brunodevel picture brunodevel  Β·  3Comments