Windows Virtual Desktop Agent Upgrade Failed

%3CLINGO-SUB%20id%3D%22lingo-sub-1853968%22%20slang%3D%22en-US%22%3EWindows%20Virtual%20Desktop%20Agent%20Upgrade%20Failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1853968%22%20slang%3D%22en-US%22%3E%3CP%3ECan't%20tell%20why%2C%20but%20the%20WVD%20Agent%20is%20updating%20and%20for%20some%20reason%20can't%20start%20up%20with%20new%20version%20and%20then%20rollback%20to%20the%20previous%20version.%20But%20doesn't%20get%20out%20of%20this%20loop%20and%20the%20service%20stops%20working.%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EAgentVersion%20%3A%201.0.2195.6400%3CBR%20%2F%3EAssignedUser%20%3A%3CBR%20%2F%3EOsVersion%20%3A%2010.0.14393%3CBR%20%2F%3ESxSStackVersion%20%3A%20rdp-sxs200826002%3CBR%20%2F%3EStatus%20%3A%20UpgradeFailed%3CBR%20%2F%3EUpdateState%20%3A%20Failed%3CBR%20%2F%3ELastUpdateTime%20%3A%2004%2F11%2F2020%2014%3A43%3A04%3CBR%20%2F%3EUpdateErrorMessage%20%3A%20Method%20not%20found%3A%20'Microsoft.Extensions.DependencyInjection.IHttpClientBuilder%3CBR%20%2F%3EMicrosoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensions.AddHttpClient(Microsoft.Extensions.DependencyInjection.IServiceCollection%2C%20System.String%2C%20System.Action%601%3CSYSTEM.NET.HTTP.HTTPCLIENT%3E)'.%3C%2FSYSTEM.NET.HTTP.HTTPCLIENT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20searched%20for%20an%20option%20to%20disable%20automatic%20upgrade%2C%20but%20couldn't%20find%20one%20so%20far.%3CBR%20%2F%3EThe%20most%20recent%20version%20that%20Microsoft%20has%20available%20is%20the%20one%20installed%2C%20so%20why%20is%20the%20agent%20trying%20to%20install%20to%20a%20newer%20version%2C%20if%20it%20isn't%20available%20yet%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1854640%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20Virtual%20Desktop%20Agent%20Upgrade%20Failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1854640%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F51884%22%20target%3D%22_blank%22%3E%40Ricardo%20Sim%C3%A3o%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20please%20look%20in%20the%20event%20logs%20on%20that%20VM%20(Under%20%22Windows%20Logs%22%20-%26gt%3B%20Application)%3C%2FP%3E%3CP%3EThis%20looks%20like%20an%20exception%20caught%20by%20the%20RDAgentBootLoader%20-%20if%20your%20application%20log%20has%20too%20many%20entries%20-%20you%20can%20filter%20the%20current%20log%20and%20apply%20this%20XML%20filter%3C%2FP%3E%3CP%3E%3CQUERYLIST%3E%3CBR%20%2F%3E%3CQUERY%20id%3D%22%26quot%3B0%26quot%3B%22%20path%3D%22%26quot%3BApplication%26quot%3B%22%3E%3CBR%20%2F%3E%3CSELECT%20path%3D%22%26quot%3BApplication%26quot%3B%22%3E*%5BSystem%5BProvider%5B%40Name%3D'RDAgentBootLoader'%5D%5D%5D%3C%2FSELECT%3E%3CBR%20%2F%3E%3C%2FQUERY%3E%3CBR%20%2F%3E%3C%2FQUERYLIST%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20can%20start%20here%20to%20see%20what%20why%20the%20service%20is%20failing.%3C%2FP%3E%3CP%3Ethanks%2C%3C%2FP%3E%3CP%3E-al%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1854753%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20Virtual%20Desktop%20Agent%20Upgrade%20Failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1854753%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F312165%22%20target%3D%22_blank%22%3E%40alhenriq_ms%3C%2FA%3Ethanks%20in%20advance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20the%20exception%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBootLoader%20exception%3ASystem.MissingMethodException%3A%20Method%20not%20found%3A%20'Microsoft.Extensions.DependencyInjection.IHttpClientBuilder%20Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensions.AddHttpClient(Microsoft.Extensions.DependencyInjection.IServiceCollection%2C%20System.String%2C%20System.Action%601%3CSYSTEM.NET.HTTP.HTTPCLIENT%3E)'.%3CBR%20%2F%3Eat%20Microsoft.RDInfra.Diagnostics.Agent.DiagnosticsHelperMethods.AddRDAgentDiagnostics(IServiceCollection%20services%2C%20RDComponent%20currentComponent)%3CBR%20%2F%3Eat%20Microsoft.RDInfra.RDAgent.Service.Startup.ConfigureServices(IServiceCollection%20services)%20in%20E%3A%5Cagent%5C_work%5C2%5Cs%5Csrc%5CRDAgent%5Csrc%5CService%5CStartup.cs%3Aline%2099%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3Eat%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%3CBR%20%2F%3Eat%20Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection%20services)%3CBR%20%2F%3Eat%20Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()%3CBR%20%2F%3Eat%20Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()%3CBR%20%2F%3Eat%20Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()%3CBR%20%2F%3Eat%20Microsoft.RDInfra.RDAgent.Service.RDAgentMain.CreateRDAgentWebHost(String%20workingDirectory)%20in%20E%3A%5Cagent%5C_work%5C2%5Cs%5Csrc%5CRDAgent%5Csrc%5CService%5CRDAgentMain.cs%3Aline%2040%3CBR%20%2F%3Eat%20System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2%5BT0%2CT1%5D(CallSite%20site%2C%20T0%20arg0%2C%20T1%20arg1)%3CBR%20%2F%3Eat%20RDAgentBootLoader.RDAgentBootLoader.%3CBOOTLOADERSTARTASYNC%3Ed__8.MoveNext()%20in%20C%3A%5Cagent%5C_work%5C92%5Cs%5Csrc%5CRDAgent%5Csrc%5CRDAgentBootLoader%5CRDAgentBootLoader.cs%3Aline%2053%3C%2FBOOTLOADERSTARTASYNC%3E%3C%2FSYSTEM.NET.HTTP.HTTPCLIENT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1854756%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20Virtual%20Desktop%20Agent%20Upgrade%20Failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1854756%22%20slang%3D%22en-US%22%3E%3CP%3EI%20forgot%20to%20add%20a%20screenshot.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1854923%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20Virtual%20Desktop%20Agent%20Upgrade%20Failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1854923%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F51884%22%20target%3D%22_blank%22%3E%40Ricardo%20Sim%C3%A3o%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%20thanks%20for%20providing%20the%20error%20message%20-%20can%20you%20provide%20me%20with%20the%20version%20of%20the%20bootloader%20-%20please%20use%20this%20powershell%20command%3C%2FP%3E%3CP%3E%3CSTRONG%3EGet-WmiObject%20-Class%20Win32_Product%20%7C%20Where-Object%7B%24_.Name%20-eq%20%22Remote%20Desktop%20Agent%20Boot%20Loader%22%7D%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EThis%20is%20a%20rare%20occurrence%20where%20the%20service%20fails%20the%20load%20the%20updated%20WVD%20Agent%20-%20the%20agent%20version%20you%20have%20is%202195.x%20and%20I%20believe%20what's%20in%20production%20is%202548.x%20-%20the%20upgrade%20is%20failing.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1856356%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20Virtual%20Desktop%20Agent%20Upgrade%20Failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1856356%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F312165%22%20target%3D%22_blank%22%3E%40alhenriq_ms%3C%2FA%3EHere%20is%20the%20version%20of%20the%20bootloader%20as%20requested.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EPS%20C%3A%5CWindows%5Csystem32%26gt%3B%20Get-WmiObject%20-Class%20Win32_Product%20%7C%20Where-Object%7B%24_.Name%20-eq%20%22Remote%20Desktop%20Agent%20Boot%20Loader%22%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EIdentifyingNumber%20%3A%20%7BA38EE409-424D-4A0D-B5B6-5D66F20F62A5%7D%3CBR%20%2F%3EName%20%3A%20Remote%20Desktop%20Agent%20Boot%20Loader%3CBR%20%2F%3EVendor%20%3A%20Microsoft%20Corporation%3CBR%20%2F%3EVersion%20%3A%201.0.0.0%3CBR%20%2F%3ECaption%20%3A%20Remote%20Desktop%20Agent%20Boot%20Loader%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20you%20say%20that%20the%20version%202548.x%20is%20in%20production%2C%20isn't%20supposed%20to%20be%20that%20version%20offered%20in%20the%20link%20by%20Microsoft%3F%20But%2C%20the%20download%20link%20points%20to%20the%202195.x!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1858555%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20Virtual%20Desktop%20Agent%20Upgrade%20Failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1858555%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F51884%22%20target%3D%22_blank%22%3E%40Ricardo%20Sim%C3%A3o%3C%2FA%3E%26nbsp%3B-%20Hi%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22...%3CSPAN%3E%3CEM%3EWhen%20you%20say%20that%20the%20version%202548.x%20is%20in%20production%2C%20isn't%20supposed%20to%20be%20that%20version%20offered%20in%20the%20link%20by%20Microsoft%3F%20But%2C%20the%20download%20link%20points%20to%20the%202195.x!%3C%2FEM%3E...%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ENo.%20WVD%20Agents%20are%20updated%20typically%20in%20a%20monthly%20cadence.%20And%2C%20VMs%20are%20auto-updated.%20Once%20the%20updated%20agent%20reaches%20stability%20over%20all%20regions%2C%20which%20can%20take%20sometime%2C%20the%20link%20is%20then%20updated%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EFor%20your%20issue%20I%20feel%20the%20quickest%20mitigation%20is%20to%20rebuild%20the%20VM%20(remove%20the%20VM%20from%20the%20hostpool)%20and%20uninstall%20the%20bootloader%20and%20agent%20and%20re-install%20the%20components.%20Once%20you%20install%202195.x%20in%205-10%20minutes%20your%20agent%20should%20begin%20to%20auto-update.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3Ethank%20you%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E-al%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1867760%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20Virtual%20Desktop%20Agent%20Upgrade%20Failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1867760%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F312165%22%20target%3D%22_blank%22%3E%40alhenriq_ms%3C%2FA%3EHello%20again.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20what%20you've%20suggested%2C%20but%20the%20issue%20remains%20the%20same.%3C%2FP%3E%3CP%3EThe%20upgrade%20fail%20as%20before%2C%20with%20the%20same%20error.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20tried%20to%20uninstall%20the%20two%20versions%20of%20the%20agent%2C%20I%20manage%20to%20get%20the%20msi%20of%20the%202548.xxxx%20version%20and%20then%20installed%20it%2C%20but%20the%20agent%20reported%20it's%20still%20the%20version%202195.xxxx.%3C%2FP%3E%3CP%3EWhat%20can%20I%20do%20more%3F%20Can%20I%20disable%20the%20automatic%20update%20of%20the%20agent%3F%20Is%20that%20even%20possible%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Occasional 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?