laravel / forge-cli

The Laravel Forge CLI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error during `forge ssh:configure`

ethanclevenger91 opened this issue · comments

  • Forge CLI Version: 0.1.5
  • PHP Version: 7.4.3
  • Operating System: WINNT
  • Error Message: Trying to access array offset on value of type null.

Description:

Fatal error. VSCode automatically opened laravel\forge-cli\scripts\keysFactory.php.

Steps To Reproduce:

  • Run forge ssh:configure
  • Select server by typing in server's name
  • Use option 0 to create new key
  • See error

Attempted the above picking the server by number instead of by server name. Same error, but got an additional error:

[22908:0806/114026.335:ERROR:broker_win.cc(56)] Error reading broker pipe: The pipe has been ended. (0x6D)

I don't have a way to test this. If more customers report this issue, I will take a deep look.

Working to debug this by running the uncompiled source. Same error, but with some actual context to where it's happening:

41▕             : dirname($phar, 2);
     42▕
     43▕         $keys = json_decode(exec($basePath.'/scripts/keysFactory.php'), true);
     44▕
  ➜  45▕         File::put($this->keysPath.'/'.$this->privateKeyName($name), $keys['private']);
     46▕         File::put($this->keysPath.'/'.($localName = $this->publicKeyName($name)), $keys['public']);
     47▕
     48▕         return [$localName, $keys['public']];
     49▕     }

I'll just put together a PR once I've finished.

Alright, so if you have VSCode configured to handle PHP files on Windows, apparently the exec statement in line 43 above just opens VSCode instead of actually exec-ing the file. I set the default file handler for PHP files to the PHP executable on my system, which allowed the command to work.

But then I'm getting the results that #18 is getting, so I'll pick things up there.