deployer: Bug - can ssh in terminal but deployer reporting 'ssh' is not recognized as an internal or external command, operable program or batch file.

Q A
Issue Type Bug, Question, Feature Request
Deployer Version 6.3
Local Machine OS Windows 10
Remote Machine OS Ubuntu 18.04

Description

If you’re reporting a bug, please include following information

Steps to reproduce

running vendor\bin\dep deploy -vvv on windows with ssh support When I ssh on command prompt, there is ssh help message. But deployer seems to not see ssh.

Content of deploy.php

<?php
namespace Deployer;

require 'recipe/laravel.php';

// Project name
set('application', REMOVED);
set('default_stage', 'staging');


// Project repository
set('repository', REMOVED);

// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true); 

// Shared files/dirs between deploys 
add('shared_files', []);
add('shared_dirs', []);

// Writable dirs by web server 
add('writable_dirs', []);


// Hosts

host('production')
    ->hostname(REMOVED)
    ->port(25560)
    ->set('deploy_path', '/var/www/{{application}}');

host('staging')
    ->hostname(REMOVED)
    ->port(25560)
    ->set('deploy_path', '/var/www/staging_{{application}}');
    
// Tasks

task('build', function () {
    run('cd {{release_path}} && build');
});

// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');

// Migrate database before symlink new release.

before('deploy:symlink', 'artisan:migrate');

Output log

With enabled option for verbose output -vvv.

vendor\bin\dep deploy -vvv

[localhost] > git rev-parse --abbrev-ref HEAD [localhost] < Development ✈︎ Deploying Development on staging • done on [staging] ➤ Executing task deploy:prepare [staging] > echo $0 [staging] < ssh multiplexing initialization [staging] < ‘ssh’ is not recognized as an internal or external command, [staging] < operable program or batch file. ➤ Executing task deploy:failed • done on [staging] ✔ Ok [1ms] ➤ Executing task deploy:unlock [staging] > rm -f /var/www/REMOVED/.dep/deploy.lock [staging] < ssh multiplexing initialization [staging] < ‘ssh’ is not recognized as an internal or external command, [staging] < operable program or batch file.

In Client.php line 99:

[Deployer\Exception\RuntimeException (-1)]
The command “rm -f /var/www/REMOVED/.dep/deploy.lock” failed.

Exit Code: -1 (Unknown error)

Host Name: staging

================
‘ssh’ is not recognized as an internal or external command,
operable program or batch file.

Exception trace: Deployer\Ssh\Client->run() at REMOVED\vendor\deployer\deployer\src\functions.php:304 Deployer\run() at REMOVED\vendor\deployer\deployer\recipe\deploy\lock.php:30 Deployer\Deployer::Deployer{closure}() at n/a:n/a call_user_func() at REMOVED\vendor\deployer\deployer\src\Task\Task.php:105 Deployer\Task\Task->run() at REMOVED\vendor\deployer\deployer\src\Executor\SeriesExecutor.php:63 Deployer\Executor\SeriesExecutor->run() at REMOVED\vendor\deployer\deployer\src\Console\TaskCommand.php:155 Deployer\Console\TaskCommand->execute() at REMOVED\vendor\symfony\console\Command\Command.php:255 Symfony\Component\Console\Command\Command->run() at REMOVED\vendor\symfony\console\Application.php:948 Symfony\Component\Console\Application->doRunCommand() at REMOVED\vendor\deployer\deployer\src\Console\Application.php:133 Deployer\Console\Application->doRunCommand() at REMOVED\vendor\symfony\console\Application.php:250 Symfony\Component\Console\Application->doRun() at REMOVED\vendor\symfony\console\Application.php:148 Symfony\Component\Console\Application->run() at REMOVED\vendor\deployer\deployer\src\Deployer.php:331 Deployer\Deployer::run() at REMOVED\vendor\deployer\deployer\bin\dep:120

deploy [-p|–parallel] [-l|–limit LIMIT] [–no-hooks] [–log LOG] [–roles ROLES] [–hosts HOSTS] [-o|–option OPTION] [–] [<stage>]

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (11 by maintainers)

Most upvoted comments

The reason that ssh can’t be called is because XAMPP uses 32bit version of php, and exec in 32bit php uses cmd in C:\Windows\SysWOW64 which somehow doesn’t have ssh. The solution is to use 64 bit php.

@danielpclin Just thought you should know, this comment really helped me out. Thank you.

The reason that ssh can’t be called is because XAMPP uses 32bit version of php, and exec in 32bit php uses cmd in C:\Windows\SysWOW64 which somehow doesn’t have ssh. The solution is to use 64 bit php.

I think this may be a issue with php and Windows 10. Closing the issue.

Can’t tell too. I need your machine to investigate 😃