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

Copy-EflowVmFile no longer works with latest windows update #293

Open
maggiojoe2 opened this issue Oct 14, 2024 · 6 comments
Open

Copy-EflowVmFile no longer works with latest windows update #293

maggiojoe2 opened this issue Oct 14, 2024 · 6 comments
Assignees

Comments

@maggiojoe2
Copy link

Describe the bug
Using Copy-EflowVmFile fails now that my devices have updated to the most recent version of Windows.

I noticed the last few releases of Eflow have said that newer versions of OpenSSH are causing this issue.

https://github.com/Azure/iotedge-eflow/releases

Is there an update on when there will be a fix in place?

What is the workaround for uploading files to the EFLOW VM? Right now we can't install new devices because we can't copy the certificates onto the EFLOW VM.

To Reproduce
Steps to reproduce the behavior:

  1. On a fully set up EFLOW device with the newest Windows updates
  2. Run Copy-EflowVmFile with any test file
  3. Image

Expected behavior
File should be copied.

Screenshots
Image

At C:\Program Files\WindowsPowerShell\Modules\AzureEFLOW\AzureEFLOW.psm1:4349 char:9
+         throw "$command $arguments failed to execute [$err]"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (scp  failed to ...nection closed]:String) [], RuntimeException
    + FullyQualifiedErrorId : scp  failed to execute [subsystem request failed on channel 0 C:\WINDOWS\System32\OpenSSH\scp.exe: Connection c
   losed]```

**Windows Host OS (please complete the following information):**
 - Edition: Windows 10 Professional
 - Version: 22H2
 - Virtual Machine: None
@jwiggenhorn
Copy link

I was running into this issue as well and came up with the following script as a workaround until this is hopefully fixed in the next release:

# See known issue on current release of EFLOW https://github.com/Azure/iotedge-eflow/releases/tag/1.4.14.24074
# Need to add the -O legacy option to scp for it to work during x509 provisioning
$scriptFilePath = "C:\Program Files\WindowsPowerShell\Modules\AzureEFLOW\AzureEFLOW.psm1"
$scriptContent = Get-Content -Path $scriptFilePath
$scriptContent = $scriptContent -replace "'-o', 'BatchMode=yes'", "'-O', '-o', 'BatchMode=yes'"
Set-Content -Path $scriptFilePath -Value $scriptContent

@Vishwanath-Reddy-M
Copy link

Hi @jwiggenhorn,

Above working around updating the script, but it is tampering the original script which is leading to fail to start EFLOW itself. Any suggestion please.

Thanks,
Vishwa

@macamachog
Copy link

Hi, I also cross with this issue, for me the solution was this:
Instead of using Copy-Eflow y just create a shared folder between host and Eflow, this works for me, hope this can be helpfull to someone else.
https://learn.microsoft.com/en-us/azure/iot-edge/how-to-share-windows-folder-to-vm?view=iotedge-1.5

@dperez83
Copy link

dperez83 commented Nov 5, 2024

Hi @jwiggenhorn,

Above working around updating the script, but it is tampering the original script which is leading to fail to start EFLOW itself. Any suggestion please.

Thanks, Vishwa

Just run this after modifying the script and it will work:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
Import-Module AzureEFLOW -Force

@dperez83
Copy link

dperez83 commented Nov 5, 2024

I was running into this issue as well and came up with the following script as a workaround until this is hopefully fixed in the next release:

# See known issue on current release of EFLOW https://github.com/Azure/iotedge-eflow/releases/tag/1.4.14.24074
# Need to add the -O legacy option to scp for it to work during x509 provisioning
$scriptFilePath = "C:\Program Files\WindowsPowerShell\Modules\AzureEFLOW\AzureEFLOW.psm1"
$scriptContent = Get-Content -Path $scriptFilePath
$scriptContent = $scriptContent -replace "'-o', 'BatchMode=yes'", "'-O', '-o', 'BatchMode=yes'"
Set-Content -Path $scriptFilePath -Value $scriptContent

Thank you very much! Don't understand how this bug is still there and a user had to find a workaround. This should be fixed in the original script.

@jagadishmurugan
Copy link

Expect a fix in the next release in Jan/2025. For now, please use the following workarounds:

  1. Use SSH version < 8.6 - https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v8.1.0.0p1-Beta (OR)
  2. Suggest not to modify the script directly. If at all you do, ensure the following procedure:
    1. copy over the files from c:\program files\windows\powershell\modules\azureeflow* to a new folder c:\users\public\eflow
    2. Make changes to files in c:\users\public\eflow
    3. Remove-Module AzureEflow; Import-Module "c:\users\public\eflow\AzureEFLOW.psm1" -Force
    4. Copy-EflowVmFile...

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

7 participants