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

Azure IoT Edge for Linux on Windows. Update not working. From 1.4.12.24074 (x64) to 1.5.1.28104 (x64). possible cert issue? #295

Open
hi-ski opened this issue Nov 20, 2024 · 1 comment

Comments

@hi-ski
Copy link

hi-ski commented Nov 20, 2024

Attempting to update from version From 1.4.12.24074 (x64) to 1.5.1.28104 (x64) via Windows Updates and manual attempts do not work.
I believe it is due to an expiring cert.
When I attempt to connect using connect-eflowvm, I was getting an X509 expiry error.
I have ran the provided script - details below:

Check for admin privilege first before proceeding...

If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "Ensure to tun this PowerShell module in Administrator mode!" -ForegroundColor "Red"
return
}

Write-Host "Stopping WSSDAgent service"
Stop-Service wssdagent
Remove-Item -Force -Path "HKLM:SOFTWARE\Microsoft\WssdAgent\v0.10.8-alpha.10\CertificateInternal"
Remove-Item -Force -Path "HKLM:SOFTWARE\Microsoft\WssdAgent\v0.10.8-alpha.10\IdentityInternal"

Write-Host "Restarting WSSDAgent service"
Start-Service wssdagent
Start-Sleep 10

Remove-Item -Recurse -Force -Path "$env:UserProfile.wssd\nodectl"

& "E:\ProgramFiles\Azure IoT Edge\eflowi-9b08aec6-a8ac-4359-a2ee-0392b4fa4763\nodectl.exe" security login --loginpath "$env:Programdata\wssdagent\nodelogin.yaml" --identity
Start-Sleep 15
Copy-Item -Path "$env:UserProfile.wssd\nodectl\cloudconfig"  -Destination "$env:Programdata\azure iot edge\protected.wssd\cloudconfig" -Force

Remove-Item -Recurse -Force -Path "$env:UserProfile.wssd\nodectl"

try
{
Invoke-EflowVmCommand "ls -la"
Write-Host "Connection to EFLOW VM successful."
}
catch [Exception]
{
Write-Host "Error caught while invoking VM command"
$e = $_.Exception
Write-Host $e.Message.ToString()
}

I then got this immediately after running:
PS C:\WINDOWS\system32> E:\MccScripts\CertFixScript.ps1
Stopping WSSDAgent service
Restarting WSSDAgent service
Remove-Item : Cannot find path 'C:\Users\username.wssd\nodectl' because it does not exist.
At E:\MccScripts\CertFixScript.ps1:17 char:1

  • Remove-Item -Recurse -Force -Path "$env:UserProfile.wssd\nodectl"
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\username\.wssd\nodectl:String) [Remove-Item], ItemNotFoundException
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
    
    

& : The term 'E:\ProgramFiles\Azure IoT Edge\eflowi-9b08aec6-a8ac-4359-a2ee-0392b4fa4763\nodectl.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At E:\MccScripts\CertFixScript.ps1:19 char:3

  • & "E:\ProgramFiles\Azure IoT Edge\eflowi-9b08aec6-a8ac-4359-a2ee-0392 ...
  • + CategoryInfo          : ObjectNotFound: (E:\ProgramFiles...763\nodectl.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    
    

Copy-Item : Cannot find path 'C:\Users\username.wssd\nodectl\cloudconfig' because it does not exist.
At E:\MccScripts\CertFixScript.ps1:21 char:1

  • Copy-Item -Path "$env:UserProfile.wssd\nodectl\cloudconfig"  -Destin ...
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\Usern...ctl\cloudconfig:String) [Copy-Item], ItemNotFoundException
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
    
    

Remove-Item : Cannot find path 'C:\Users\username.wssd\nodectl' because it does not exist.
At E:\MccScripts\CertFixScript.ps1:23 char:1

  • Remove-Item -Recurse -Force -Path "$env:UserProfile.wssd\nodectl"
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\username\.wssd\nodectl:String) [Remove-Item], ItemNotFoundException
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
    
    
    

[11/20/2024 12:25:20] Exception caught!!!

  • E:\Program Files\Azure IoT Edge\eflowi-9b08aec6-a8ac-4359-a2ee-0392b4fa4763\nodectl.exe compute vm list -o tsv --query "[*].name" failed to execute [Error: rpc error: code = Unavailable desc = connection error: desc = "transp
    ort: authentication handshake failed: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "NodeAgent")"] at line 4349
    Error caught while invoking VM command
    Failed to retrieve virtual machine name.

I attempted to connect again using connect-eflowvm and got this:

  • E:\Program Files\Azure IoT Edge\eflowi-9b08aec6-a8ac-4359-a2ee-0392b4fa4763\nodectl.exe compute vm list -o tsv --query "[*].name" failed to execute [Error: rpc error: code = Unavailable desc = connection error: desc = "transp
    ort: authentication handshake failed: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "NodeAgent")"] at line 4349

[11/20/2024 12:52:54] Exception caught!!!

  • Failed to retrieve virtual machine name. at line 3060

Would you be so kind to assist with this please?

@hi-ski
Copy link
Author

hi-ski commented Nov 20, 2024

Host OS is Windows Server 2019
The previous update for Azure IOT Edge on Windows did install OK back in August.

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

1 participant