IServiceProvider Error

Running into a fatal error when starting the PowerShell Universal service this morning, I had to do a fresh reinstall recently due to loads of errors related to hangfire jobs and have now started to get the below and I can’t figure out if it’s a code / DB related issue.

System.ObjectDisposedException: Cannot access a disposed object.
Object name: ‘IServiceProvider’.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at UniversalAutomation.StartupService.RunInitializationScript() in C:\actions-runner_work\universal\universal\src\Universal.Server\Services\StartupService.cs:line 332
at UniversalAutomation.StartupService.RunStartup() in C:\actions-runner_work\universal\universal\src\Universal.Server\Services\StartupService.cs:line 234
at UniversalAutomation.StartupService.TryRunStartup() in C:\actions-runner_work\universal\universal\src\Universal.Server\Services\StartupService.cs:line 187

Product: PowerShell Universal
Version: 3.4.2

This seems like it is the side effect of the server shutting down unexpectedly when starting up. Are there other errors in the log besides this one?

I’ve managed to get it past that step but then it starts running groom jobs, fails and the service dies again.

2022-10-21 16:26:39.506 +01:00 [INF] Starting groom job.
2022-10-21 16:26:39.516 +01:00 [WRN] Settings not populated yet. Skipping groom.
2022-10-21 16:26:41.524 +01:00 [INF] Finished groom job.
2022-10-21 16:26:42.983 +01:00 [WRN] Failed to process the job ‘36239’: an exception occurred. Retry attempt 1 of 10 will be performed in 00:00:29.

These are just the errors from the ProgramData log. Not sure if there’s anywhere else I can pull more info from?

I would suggest checking in Event Viewer in the Application log. There could be a .NET Application error that will be of interest.