laravel / forge-cli

The Laravel Forge CLI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Forge reports error when attempting to ssh into remote server

titantwentyone opened this issue · comments

  • Forge CLI Version: 1.40
  • PHP Version: 8.0.18

Description:

This is related to a couple of similar issues I have seen - namely #16 and #18

I am using Forge CLI v.1.4 on Ubuntu MATE 21.04. I am able to connect to machine manually via ssh and all is okay. The command proposed in issue #18: ssh -o "IdentitiesOnly=yes" -i ~/path/to/key forge@SERVER_IP also works for me but when using forge ssh:test I get Unable to connect to remote server. Maybe run [ssh:configure] to configure an SSH Key?. When I deploy, with forge deploy. deployment is fine - i.e. it happens and the Forge UI records it appropriately however, the process disconnects with this error. Out of interest, I ran forge ssh:test -vvv which records an execption:

me@machine:/var/www/mysite/dev$ forge ssh:test -vvv

Box Requirements Checker
========================

> Using PHP 8.0.18
> PHP is using the following php.ini file:
  /etc/php/8.0/cli/php.ini

> Checking Box requirements:
  ✔ The application requires the version "^8.0" or greater.
  ✔ The application requires the extension "zlib".
  
                                                                                                                                       
 [OK] Your system is ready to run the application.                                                                                     
                                                                                                                                       

==> Establishing Secure Connection

In Application.php line 124:
                                                                                          
  [LaravelZero\Framework\Exceptions\ConsoleException]                                     
  Unable to connect to remote server. Maybe run [ssh:configure] to configure an SSH Key?  
                                                                                          

Exception trace:
  at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/laravel-zero/framework/src/Application.php:124
 LaravelZero\Framework\Application->abort() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/laravel-zero/foundation/src/Illuminate/Foundation/helpers.php:44
 abort() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/laravel-zero/foundation/src/Illuminate/Foundation/helpers.php:64
 abort_if() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/app/Repositories/RemoteRepository.php:176
 App\Repositories\RemoteRepository->App\Repositories\{closure}() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/spatie/once/src/functions.php:40
 once() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/app/Repositories/RemoteRepository.php:177
 App\Repositories\RemoteRepository->ensureSshIsConfigured() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/app/Commands/SshTestCommand.php:44
 App\Commands\SshTestCommand->handle() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/illuminate/container/BoundMethod.php:36
 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/illuminate/container/Util.php:41
 Illuminate\Container\Util::unwrapIfClosure() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/illuminate/container/BoundMethod.php:93
 Illuminate\Container\BoundMethod::callBoundMethod() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/illuminate/container/BoundMethod.php:37
 Illuminate\Container\BoundMethod::call() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/illuminate/container/Container.php:653
 Illuminate\Container\Container->call() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/illuminate/console/Command.php:136
 Illuminate\Console\Command->execute() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/app/Commands/Command.php:103
 App\Commands\Command->execute() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/symfony/console/Command/Command.php:291
 Symfony\Component\Console\Command\Command->run() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/illuminate/console/Command.php:121
 Illuminate\Console\Command->run() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/symfony/console/Application.php:989
 Symfony\Component\Console\Application->doRunCommand() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/illuminate/console/Application.php:102
 Illuminate\Console\Application->run() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Console/Kernel.php:129
 Illuminate\Foundation\Console\Kernel->handle() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/vendor/laravel-zero/framework/src/Kernel.php:95
 LaravelZero\Framework\Kernel->handle() at phar:///home/me/.config/composer/vendor/laravel/forge-cli/builds/forge/forge:36
 require() at /home/me/.config/composer/vendor/laravel/forge-cli/builds/forge:14
 include() at /home/me/.config/composer/vendor/bin/forge:117

Steps To Reproduce:

  1. Configure ssh with ssh:configure
  2. Execute forge ssh:test or forge deploy

Hi there. Can you report this directly to Forge support please? Thanks

@driesvints Thanks Dries. Have done this. Is this more of an issue with Forge than the CLI then?

Hi there,

Dries is merely pointing out that we at Forge Support provide support for the CLI as well as Forge as such. Also, at Forge Support, we'd have much better tools to understand your unique situation.

Best regards,
Guus
Laveral Forge - Customer Success