PowerShell Universal services crashes after Windows security update

After Windows Security update KB5004244 was installed, the service crashes. If I remove the update and reboot the server, the service properly starts up and continues to run normally. I have also tried updating to the very latest version and the issue persists. Has anybody else run into this issue? Unfortunately, this update is required and gets re-installed every weekend so I need to get the service working with it in place.

Application Error
Application: Universal.Server.exe
CoreCLR Version: 5.0.921.35908
.NET Version: 5.0.9
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Exception: No Execution Environment found
at UniversalAutomation.Common.Extensions.DatabaseExtensions.GetExecutionEnvironment(IDatabase database, String environmentName) in D:\a\universal\universal\src\UniversalAutomation.Common\DatabaseExtensions.cs:line 33
at Universal.Server.Services.SecurityProxy.Start() in D:\a\universal\universal\src\Universal.Server\Services\SecurityProxy.cs:line 66
at UniversalAutomation.StartupService.StartAsync(CancellationToken cancellationToken) in D:\a\universal\universal\src\Universal.Server\Services\StartupService.cs:line 93
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Universal.Server.Program.Main(String[] args) in D:\a\universal\universal\src\Universal.Server\Program.cs:line 31

.Net Runtime event
Faulting application name: Universal.Server.exe, version: 1.0.0.0, time stamp: 0x60e896d9
Faulting module name: KERNELBASE.dll, version: 10.0.17763.2028, time stamp: 0x4569c786
Exception code: 0xe0434352
Fault offset: 0x0000000000039329
Faulting process id: 0x21a8
Faulting application start time: 0x01d7e847bb9fefce
Faulting application path: C:\Program Files (x86)\Universal\Universal.Server.exe
Faulting module path: C:\windows\System32\KERNELBASE.dll
Report Id: 086b2d9f-d4a1-4e17-b6be-466e31f30a27
Faulting package full name:
Faulting package-relative application ID:
Event Xml:

What do you have in settings.ps1? Did you change the default environment?

This is just a hunch, but you might not have an environments.ps1 and then have a -DefaultEnvironment in settings.ps1 configured to point to a specific WinPS version. The upgrade changed the WinPS version and now it no longer exists on that machine.

appreciate the response Adam. i do not see an environments.ps1 or settings.ps1 but the service is running fine after the upgrade after I removed the mentioned security update. So the upgrade is not the issue. there’s definitely something related to that update that breaks the services. very strange.

Do you have your default environment set to integrated in Settings \ General \ Environments?

no. at the moment I have it set to 5.1.17763.1490. I believe that’s .Net Core 5

5.1 is Windows PowerShell. That’s the current version on the machine.

What I would suggest is to edit your environments before upgrading. Click Settings \ Environments and then either edit an existing environment or add a new one. This was cause an environments.ps1 file to be generated. Environments - PowerShell Universal

This will disable the auto discovery of the Windows PowerShell version and use the ones within the environments.ps1 file. Since the location of the Windows PowerShell executable doesn’t change, this will be fine.

After that, you can try to patch the server with the security update.

ok I can try that. when you say edit existing or add new environment, what do you mean exactly? I’m not sure what I would edit or add. This is what I see in mine.

What I would suggest doing is to create a new environment. For name, version and path, just input powershell. After creating the environment, you can just delete it. The result is that an environments.ps1 file will be generated, and your versions will be static.

Ok I have done that and now I see an environments.ps1 file in the.universal folder in ProgramData. Interestingly, the security update that was causing the issue did not get installed this past weekend. a different security update was installed and this one did not cause the service to crash. I will keep an eye on it. Thanks for your suggestions.