JobAutomacaoAuditoriaPosService.ProcessarAutomacao (inpart-jobs)

// Id: #10061501
// Queue: inpart-jobs
using Inpart.Integracao.GerenciadorJobs.Services.AutomacaoAuditoriaPos;

var jobAutomacaoAuditoriaPosService = Activate<JobAutomacaoAuditoriaPosService>();
await jobAutomacaoAuditoriaPosService.ProcessarAutomacao();

Parameters

CurrentCulture
""
RecurringJobId
"automacao-auditoria-pos"
Time
1790861407

State

10/01/2026 13:30:13 (+5.860s) Failed

An exception occurred during performance of the job.

Microsoft.EntityFrameworkCore.DbUpdateException (2c954dc318ad.staging:1)

An error occurred while saving the entity changes. See the inner exception for details.

Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
 ---> Microsoft.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_histpedidodistr_idUsuario_UsuarioNova". The conflict occurred in database "InpartSaudeRestore", table "dbo.Usuario", column 'idUsuario'.
The statement has been terminated.
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
   at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   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.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
ClientConnectionId:bebe4db9-6cf6-46e7-8a99-05a278a43f8b
Error Number:547,State:0,Class:16
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.Execute(IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Storage.RelationalDatabase.SaveChanges(IList`1 entries)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList`1 entriesToSave)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(StateManager stateManager, Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.<>c.<SaveChanges>b__114_0(DbContext _, ValueTuple`2 t)
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass28_0`2.<Execute>b__0(DbContext context, TState innerState)
   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.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Inpart.DataAccess.EFRepository`1.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Inpart.Integracao.GerenciadorJobs.Services.AutomacaoAuditoriaPos.JobAutomacaoAuditoriaPosService.ProcessarPedido(PedidoCandidato pedido) in /src/Inpart.Integracao.GerenciadorJobs/Services/AutomacaoAuditoriaPos/JobAutomacaoAuditoriaPosService.cs:line 148
   at Inpart.Integracao.GerenciadorJobs.Services.AutomacaoAuditoriaPos.JobAutomacaoAuditoriaPosService.ProcessarAutomacao() in /src/Inpart.Integracao.GerenciadorJobs/Services/AutomacaoAuditoriaPos/JobAutomacaoAuditoriaPosService.cs:line 71
   at InvokeStub_TaskAwaiter.GetResult(Object, Object, IntPtr*)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

+33ms Processing

Server:
2c954dc318ad.staging:1
Worker:
e1f86df4

+7ms Enqueued

Triggered by recurring job scheduler

10/01/2026 13:30:07 Created