Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect-EflowVM fails with non-descriptive error and no way to troubleshoot #48

Closed
dmaxwe22 opened this issue Jul 16, 2021 · 4 comments
Closed

Comments

@dmaxwe22
Copy link

Connect-EflowVM results in following error:

ssh : GetConsoleMode on hOutputConsole failed with 6
At C:\Program Files\WindowsPowerShell\Modules\AzureEFLOW\AzureEFLOW.psm1:2213 char:17

  • ... ssh -o LogLevel=ERROR -o UserKnownHostsFile="$HostKeySess ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (GetConsoleMode ...e failed with 6:String) [], RemoteException
    • FullyQualifiedErrorId : NativeCommandError

To Reproduce
Steps to reproduce the behavior:

  1. Successful Deploy-Eflow
  2. Successful Provision-EflowVm
  3. Successful telemetry with Azure IoT Hub and metrics view OK. All is OK.
  4. Connect-EflowVM fails.

Expected behavior
Expected to be able to connect to the EFLOW virtual machine.
Troubleshooting documentation is scarce.

Get-EflowLogs runs for a while but I have to stop it.

PS C:\WINDOWS\system32> Get-EflowLogs
[07/15/2021 20:48:12] Collecting Logs from Deployment...
[07/15/2021 20:48:12] Collecting configuration
[07/15/2021 20:48:12] Collecting 'Azure IoT Edge for Linux on Windows' event logs
[07/15/2021 20:48:12] Collecting virtual machine logs

-- stopped it here because it hung up ---

How do I find out where the problem is in connecting to the EflowVM?

@TerryWarwick
Copy link
Contributor

@dmaxwe22,

Just a hunch, but by any chance are you using Remote PowerShell when you are invoking the Connect-EflowVM command? Both of these commands require SSH, which would be attempting a double-hop which any combination of Remote PowerShell and SSH do not allow. It would be possible from a Remote Desktop session, but not a Remote Powershell session.

Terry Warwick
Microsoft

@dmaxwe22
Copy link
Author

dmaxwe22 commented Jul 16, 2021

I am not using a remote PowerShell attempt to connect. The deployment is using a PowerShell ISE on the same Windows 10 IoT Enterprise 2019 computer and running it in the administrative mode. I chose the PowerShell method of implementing the deployment because the Windows Admin center method was more complicated than needed. Everything worked well and the DPS with X509 deployment worked and telemetry is streaming to the IoT Hub. Except three things are not normal and blocking further work.

  1. I cannot connect using this Connect-EflowVM. An error as stated above results.
  2. I cannot get logs. It seems to shut down the VM and does not complete. Maybe this is coincidence. After restarting the VM (Start-EflowVM), I tried again and same results.
  3. I cannot see the IoT Edge Linux VM in the Hyper V manager on the computer. It seems a ghost and yet telemetry is streaming.

One additional clue. This same computer was used for the windows version of Azure IoT Edge but I uninstalled it and the iotedge folder is gone.

Actually, another clue. The IP address of the Linux VM seems to be different than the message that occurs when I try to get logs. 192.168.57.125 is stated when querying using PowerShell to get VM IP Address vs. 192.168.57.113 that is stated after "Ctrl-C" when trying to get logs. In PowerShell on the same Windows computer, I tried manually SSH iotedge-user@192.168.57.125 and the other IP address as well but no response in either case.

Could it be that an SSH host file is not readable? I ran the PowerShell deployment scripts from C:\Windows\System32. Maybe that is a problem.

There is a clue above where I could find the PowerShell module source code and look inside it for a clue:

  • "C:\Program Files\WindowsPowerShell\Modules\AzureEFLOW\AzureEFLOW.psm1:2213 char:17"

I would appreciate help here in this issues area. Thank you.

@fcabrera23
Copy link
Contributor

fcabrera23 commented Jul 16, 2021

Hi @dmaxwe22,

Thanks for your detailed information.

  • For your questions 1 and 2 - Can you try using PowerShell with elevated permissions instead of using PowerShell ISE?

  • For your third question - Unfortunately, this interface won't longer be available to manage the EFLOW VM since GA. To introduce GPU support for the VM, we had to change our VM management interface from WMMS to HCS. As such, the EFLOW VM will no longer be visible in Hyper-V but instead, appear more like WSL VM in HCS.

Thanks,
Francisco

@dmaxwe22
Copy link
Author

Thanks, @fcabrera23, using PowerShell with elevated permissions instead of PowerShell ISE with elevated permissions seems to have worked. I am now able to Connect-EflowVM and use commands like sudo iotedge list and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants