Windows Virtual Desktop Agent Upgrade Failed

Brass Contributor

Can't tell why, but the WVD Agent is updating and for some reason can't start up with new version and then rollback to the previous version. But doesn't get out of this loop and the service stops working.

 

AgentVersion : 1.0.2195.6400
AssignedUser :
OsVersion : 10.0.14393
SxSStackVersion : rdp-sxs200826002
Status : UpgradeFailed
UpdateState : Failed
LastUpdateTime : 04/11/2020 14:43:04
UpdateErrorMessage : Method not found: 'Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensions.AddHttpClient(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.String, System.Action`1<System.Net.Http.HttpClient>)'.

 

I searched for an option to disable automatic upgrade, but couldn't find one so far.
The most recent version that Microsoft has available is the one installed, so why is the agent trying to install to a newer version, if it isn't available yet?

11 Replies

Hi @Ricardo Simão 

Can you please look in the event logs on that VM (Under "Windows Logs" -> Application)

This looks like an exception caught by the RDAgentBootLoader - if your application log has too many entries - you can filter the current log and apply this XML filter

<QueryList>
<Query Id="0" Path="Application">
<Select Path="Application">*[System[Provider[@Name='RDAgentBootLoader']]]</Select>
</Query>
</QueryList>

 

We can start here to see what why the service is failing.

thanks,

-al

@alhenriq_msthanks in advance.

 

Here is the exception:

 

BootLoader exception:System.MissingMethodException: Method not found: 'Microsoft.Extensions.DependencyInjection.IHttpClientBuilder Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensions.AddHttpClient(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.String, System.Action`1<System.Net.Http.HttpClient>)'.
at Microsoft.RDInfra.Diagnostics.Agent.DiagnosticsHelperMethods.AddRDAgentDiagnostics(IServiceCollection services, RDComponent currentComponent)
at Microsoft.RDInfra.RDAgent.Service.Startup.ConfigureServices(IServiceCollection services) in E:\agent\_work\2\s\src\RDAgent\src\Service\Startup.cs:line 99
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at Microsoft.RDInfra.RDAgent.Service.RDAgentMain.CreateRDAgentWebHost(String workingDirectory) in E:\agent\_work\2\s\src\RDAgent\src\Service\RDAgentMain.cs:line 40
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)
at RDAgentBootLoader.RDAgentBootLoader.<BootLoaderStartAsync>d__8.MoveNext() in C:\agent\_work\92\s\src\RDAgent\src\RDAgentBootLoader\RDAgentBootLoader.cs:line 53

I forgot to add a screenshot.

@Ricardo Simão 

 

Yes thanks for providing the error message - can you provide me with the version of the bootloader - please use this powershell command

Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq "Remote Desktop Agent Boot Loader"}

This is a rare occurrence where the service fails the load the updated WVD Agent - the agent version you have is 2195.x and I believe what's in production is 2548.x - the upgrade is failing.

@alhenriq_msHere is the version of the bootloader as requested.

 

 

PS C:\Windows\system32> Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq "Remote Desktop Agent Boot Loader"
}


IdentifyingNumber : {A38EE409-424D-4A0D-B5B6-5D66F20F62A5}
Name : Remote Desktop Agent Boot Loader
Vendor : Microsoft Corporation
Version : 1.0.0.0
Caption : Remote Desktop Agent Boot Loader

 

When you say that the version 2548.x is in production, isn't supposed to be that version offered in the link by Microsoft? But, the download link points to the 2195.x!

 

Thank you

@Ricardo Simão - Hi

 

"...When you say that the version 2548.x is in production, isn't supposed to be that version offered in the link by Microsoft? But, the download link points to the 2195.x!..."

 

No. WVD Agents are updated typically in a monthly cadence. And, VMs are auto-updated. Once the updated agent reaches stability over all regions, which can take sometime, the link is then updated

 

For your issue I feel the quickest mitigation is to rebuild the VM (remove the VM from the hostpool) and uninstall the bootloader and agent and re-install the components. Once you install 2195.x in 5-10 minutes your agent should begin to auto-update.

 

 

 

thank you,

-al

@alhenriq_msHello again.

 

I did what you've suggested, but the issue remains the same.

The upgrade fail as before, with the same error.

 

I also tried to uninstall the two versions of the agent, I manage to get the msi of the 2548.xxxx version and then installed it, but the agent reported it's still the version 2195.xxxx.

What can I do more? Can I disable the automatic update of the agent? Is that even possible?

 

 

@Ricardo Simão - Hi

If the bootloader is failing to load the latest agent - could mean the os image you have is missing some external dependency...have you tried re-imaging your VM? I assume you are using Windows (Windows 10 Enterprise for Virtual Desktops) image.

 

The agent failing to update should not be interrupting the ability for your users to connect to your VM - or interrupt users connections on your VM.

 

I think you should create an incident - service engineers can quickly guide you through some preliminary troubleshooting steps.

 

Hello,

I've finally managed to understand that the method failing is related to .Net Framework installation.

So in this case, our VM has the .NET 4.6 installed and in this case it requires the .NET upgrade to the 4.8 version.
After that, the service RDAgent Bootloader started correctly with the wvd agent version 1.0.2548.6500.

Problem solved!

@Ricardo Simão Never query WMI class Win32_Product. It will reconfigure all applications installed.

Windows Installer reconfigured all applications - Windows Server | Microsoft Docs

@Ricardo Simão 

 

So all of our SessionHosts are going into an unavailable state after they update to 1.0.2839.400. The previous version they are fine. If I uninstall the agents, the sxs, and remove and re-add it to the hostpool its fine for a little bit, then as soon as it updates it going to unavailable. 

 

I built a new session host which starts off on a different version and is fine, soon as it updates it goes into this state. WTH is going on with this?