Hello Adam,
thank you very much for your response.
Here is the requested log. I stopped the service for this, cleaned the logs and started the service again:
2023-01-13 15:16:31.228 +01:00 [INF] Start installing Hangfire SQL objects...
2023-01-13 15:16:31.393 +01:00 [INF] Hangfire SQL objects installed.
2023-01-13 15:16:31.668 +01:00 [DBG] Hosting starting
2023-01-13 15:16:31.708 +01:00 [INF] User profile is available. Using 'C:\Users\svc.glo.p.pou_t1\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
2023-01-13 15:16:31.773 +01:00 [DBG] Reading data from file 'C:\Users\svc.glo.p.pou_t1\AppData\Local\ASP.NET\DataProtection-Keys\key-8f4095e4-c009-4a21-9bb1-d984d6cf8538.xml'.
2023-01-13 15:16:31.775 +01:00 [DBG] Reading data from file 'C:\Users\svc.glo.p.pou_t1\AppData\Local\ASP.NET\DataProtection-Keys\key-b82f6f9c-37e3-42c0-bc06-7877d5df59e0.xml'.
2023-01-13 15:16:31.780 +01:00 [DBG] Found key {8f4095e4-c009-4a21-9bb1-d984d6cf8538}.
2023-01-13 15:16:31.783 +01:00 [DBG] Found key {b82f6f9c-37e3-42c0-bc06-7877d5df59e0}.
2023-01-13 15:16:31.789 +01:00 [DBG] Considering key {8f4095e4-c009-4a21-9bb1-d984d6cf8538} with expiration date 2023-04-05 08:56:43Z as default key.
2023-01-13 15:16:31.790 +01:00 [DBG] Forwarded activator type request from Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiXmlDecryptor, Microsoft.AspNetCore.DataProtection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiXmlDecryptor, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60
2023-01-13 15:16:31.792 +01:00 [DBG] Decrypting secret element using Windows DPAPI.
2023-01-13 15:16:31.793 +01:00 [DBG] Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60
2023-01-13 15:16:31.796 +01:00 [DBG] Opening CNG algorithm 'AES' from provider 'null' with chaining mode CBC.
2023-01-13 15:16:31.798 +01:00 [DBG] Opening CNG algorithm 'SHA256' from provider 'null' with HMAC.
2023-01-13 15:16:31.802 +01:00 [DBG] Using key {8f4095e4-c009-4a21-9bb1-d984d6cf8538} as the default key.
2023-01-13 15:16:31.803 +01:00 [DBG] Key ring with default key {8f4095e4-c009-4a21-9bb1-d984d6cf8538} was loaded during application startup.
2023-01-13 15:16:31.968 +01:00 [DBG] Registered SignalR Protocol: json, implemented by Microsoft.AspNetCore.SignalR.Protocol.JsonHubProtocol.
2023-01-13 15:16:31.979 +01:00 [INF] Starting heartbeat job.
2023-01-13 15:16:32.074 +01:00 [INF] Starting heartbeat job.
2023-01-13 15:16:32.193 +01:00 [DBG] Registered model binder providers, in the following order: ["Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ServicesModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.HeaderModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FloatingPointTypeModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.EnumTypeModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DateTimeModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.SimpleTypeModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CancellationTokenModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ByteArrayModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FormFileModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FormCollectionModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.KeyValuePairModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ArrayModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinderProvider","Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexObjectModelBinderProvider"]
2023-01-13 15:16:32.381 +01:00 [WRN] Failed to process the job '320200': an exception occurred. Retry attempt 1 of 10 will be performed in 00:00:17.
System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
Object name: 'PsuDbContext'.
at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed()
at Microsoft.EntityFrameworkCore.DbContext.get_Database()
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.OnFirstExecution()
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Boolean& found)
at lambda_method344(Closure , QueryContext )
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
at System.Linq.Queryable.Any[TSource](IQueryable`1 source)
at PowerShellUniversal.SQL.SqlTable`1.<>c.<Exists>b__15_0(IQueryable`1 m) in C:\actions-runner\_work\universal\universal\src\PowerShellUniversal.SQL\Database.cs:line 589
at PowerShellUniversal.SQL.SqlTable`1.DisposeAfterCall[X](Func`2 call) in C:\actions-runner\_work\universal\universal\src\PowerShellUniversal.SQL\Database.cs:line 664
at PowerShellUniversal.SQL.SqlTable`1.Exists() in C:\actions-runner\_work\universal\universal\src\PowerShellUniversal.SQL\Database.cs:line 589
at UniversalAutomation.GitSyncService.Sync(Boolean force) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 77
2023-01-13 15:16:32.469 +01:00 [WRN] Failed to process the job '320207': an exception occurred. Retry attempt 1 of 10 will be performed in 00:00:33.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Data.SqlClient.SqlConnection.get_TypeSystem()
at Microsoft.Data.SqlClient.SqlDataReader..ctor(SqlCommand command, CommandBehavior behavior)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader()
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.<>c.<MoveNext>b__19_0(DbContext _, Enumerator enumerator)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass31_0`2.<Execute>b__0(DbContext context, TState state)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at PowerShellUniversal.SQL.SqlTable`1.<>c.<ToArray>b__18_0(IQueryable`1 m) in C:\actions-runner\_work\universal\universal\src\PowerShellUniversal.SQL\Database.cs:line 604
at PowerShellUniversal.SQL.SqlTable`1.DisposeAfterCall[X](Func`2 call) in C:\actions-runner\_work\universal\universal\src\PowerShellUniversal.SQL\Database.cs:line 664
at PowerShellUniversal.SQL.SqlTable`1.ToArray() in C:\actions-runner\_work\universal\universal\src\PowerShellUniversal.SQL\Database.cs:line 604
at UniversalAutomation.Services.AppTokenService.Load() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\Authentication\AppTokenService.cs:line 26
2023-01-13 15:16:32.592 +01:00 [DBG] Repository directory already exists. Validating whether it is a valid git repository.
2023-01-13 15:16:32.599 +01:00 [ERR] Failed to reschedule git sync.
System.NullReferenceException: Object reference not set to an instance of an object.
at UniversalAutomation.HeartBeatService.Run() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\HeartBeatService.cs:line 0
2023-01-13 15:16:32.621 +01:00 [INF] Finished heartbeat job.
2023-01-13 15:16:32.680 +01:00 [DBG] Repository directory is valid repository.
2023-01-13 15:16:32.700 +01:00 [DBG] Starting sync...
2023-01-13 15:16:32.719 +01:00 [DBG] Git has remote. Starting pull
2023-01-13 15:16:32.730 +01:00 [ERR] Failed to reschedule git sync.
System.NullReferenceException: Object reference not set to an instance of an object.
at UniversalAutomation.HeartBeatService.Run() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\HeartBeatService.cs:line 0
2023-01-13 15:16:32.763 +01:00 [INF] Now listening on: http://[::]:5000
2023-01-13 15:16:32.764 +01:00 [DBG] Loaded hosting startup assembly Universal.Server
2023-01-13 15:16:32.765 +01:00 [INF] Application started. Hosting environment: Production; Content root path: C:\Program Files (x86)\PowershellUniversal\
2023-01-13 15:16:32.765 +01:00 [DBG] Hosting started
2023-01-13 15:16:32.776 +01:00 [INF] Finished heartbeat job.
2023-01-13 15:16:32.835 +01:00 [DBG] Loading license information.
2023-01-13 15:16:33.015 +01:00 [ERR] Failed to sync: Sequence contains no elements at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at PowerShellUniversal.MemoryTable`1.First() in C:\actions-runner\_work\universal\universal\src\PowerShellUniversal\MemoryTable.cs:line 45
at UniversalAutomation.Git.GitService.GetProxyOptions() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitService.cs:line 175
at UniversalAutomation.Git.GitService.Pull() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitService.cs:line 556
at UniversalAutomation.GitSyncService.TrySync(GitStatus status, Boolean force, GitSettings settings) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 160
at UniversalAutomation.GitSyncService.Sync(Boolean force) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 91
Here is an excerpt from above that I consider relevant:
2023-01-13 15:16:32.680 +01:00 [DBG] Repository directory is valid repository.
2023-01-13 15:16:32.700 +01:00 [DBG] Starting sync...
2023-01-13 15:16:32.719 +01:00 [DBG] Git has remote. Starting pull
2023-01-13 15:16:32.730 +01:00 [ERR] Failed to reschedule git sync.
System.NullReferenceException: Object reference not set to an instance of an object.
at UniversalAutomation.HeartBeatService.Run() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\HeartBeatService.cs:line 0
2023-01-13 15:16:32.763 +01:00 [INF] Now listening on: http://[::]:5000
2023-01-13 15:16:32.764 +01:00 [DBG] Loaded hosting startup assembly Universal.Server
2023-01-13 15:16:32.765 +01:00 [INF] Application started. Hosting environment: Production; Content root path: C:\Program Files (x86)\PowershellUniversal\
2023-01-13 15:16:32.765 +01:00 [DBG] Hosting started
2023-01-13 15:16:32.776 +01:00 [INF] Finished heartbeat job.
2023-01-13 15:16:32.835 +01:00 [DBG] Loading license information.
2023-01-13 15:16:33.015 +01:00 [ERR] Failed to sync: Sequence contains no elements at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at PowerShellUniversal.MemoryTable`1.First() in C:\actions-runner\_work\universal\universal\src\PowerShellUniversal\MemoryTable.cs:line 45
at UniversalAutomation.Git.GitService.GetProxyOptions() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitService.cs:line 175
at UniversalAutomation.Git.GitService.Pull() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitService.cs:line 556
at UniversalAutomation.GitSyncService.TrySync(GitStatus status, Boolean force, GitSettings settings) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 160
at UniversalAutomation.GitSyncService.Sync(Boolean force) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\GitSyncService.cs:line 91
ProcMon does not find any process accessing the directory, apart from Universal.Server and PowerShell. However, PowerShell also comes through the Universal service, example:
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NonInteractive -NoProfile -Command "& { [System.Reflection.Assembly]::LoadFrom('C:\Program Files (x86)\PowershellUniversal\Host\host.dll') | Out-Null; [UniversalHost.AgentService]::StartApi(64606, 5760, 64600) }"
PS: The SQL error in the full log - is this negligible or should we clean the database?
Thanks thanks thanks!