powershell-universal
powershell-universal copied to clipboard
5.0.12 - Groom Job Failed
Version
5.0.11
Severity
Low
Environment
msi
Steps to Reproduce
Possibly due to updating to PostgreSQL 17, the Groom Job has been failing on all nodes.
Expected behavior
Groom job should complete successfully.
Actual behavior
Groom job fails.
Additional Environment data
Occurring since 5.0.11 but also updated to PostgreSQL 17 at that same time.
Snippet from the log:
`2024-10-18 00:01:12.416 -03:00 [WRN][UniversalAutomation.GroomService] Failed to delete entity Job (21462) Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> Npgsql.PostgresException (0x80004005): 23503: update or delete on table "Job" violates foreign key constraint "FK_Job_Job_ParentJobId" on table "Job"
DETAIL: Detail redacted as it may contain sensitive data. Specify 'Include Error Detail' in the connection string to include this information. at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder'1.StateMachineBox'1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection) Exception data: Severity: ERROR SqlState: 23503 MessageText: update or delete on table "Job" violates foreign key constraint "FK_Job_Job_ParentJobId" on table "Job" Detail: Detail redacted as it may contain sensitive data. Specify 'Include Error Detail' in the connection string to include this information. SchemaName: public TableName: Job ConstraintName: FK_Job_Job_ParentJobId File: ri_triggers.c Line: 2624 Routine: ri_ReportViolation --- End of inner exception stack trace --- at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable'1 commandBatches, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList'1 entriesToSave) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(StateManager stateManager, Boolean acceptAllChangesOnSuccess) at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Fun'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.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess) at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) at PowerShellUniversal.Extensibility.EFTable'2.SaveWithRetry(DbContext context) in C:\actions-runner_work\universal\universal\src\PowerShellUniversal.Extensibility\Persistence\EFTable.cs:line 692 at PowerShellUniversal.Extensibility.EFTable'2.Delete(T item) in C:\actions-runner_work\universal\universal\src\PowerShellUniversal.Extensibility\Persistence\EFTable.cs:line 129 at UniversalAutomation.GroomService.DeleteEntity[T](T entity) in C:\actions-runner_work\universal\universal\src\Universal.Server\Services\GroomService.cs:line 264`