RetrieveUpdateProductStockBatchResultsTask.ProcessRecurringAsync

// Job ID: #2001290
using EkolPY.Integration.Manager.Tasks;

var retrieveUpdateProductStockBatchResultsTask = Activate<RetrieveUpdateProductStockBatchResultsTask>();
await retrieveUpdateProductStockBatchResultsTask.ProcessRecurringAsync(
    null,
    "default",
    FromJson<TaskType>("{\"Id\":54,\"SystemName\":\"RetrieveUpdateProductStockBatchResults\",\"Name\":\"Toplu(stok güncelleme) işlem olan kanalların bekleyen sonuçlarını alır\",\"JobClassName\":\"RetrieveUpdateProductStockBatchResultsTask\",\"Type\":\"Recurring\",\"Cron\":\"*/2 * * * *\",\"AccountId\":1,\"SalesChannelOption\":1,\"AccountOption\":1,\"SalesChannelOptionEnum\":1,\"AccountOptionEnum\":1,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true,\"TaskTypeSalesChannel\":[{\"Id\":19,\"TaskTypeId\":54,\"SalesChannelId\":2,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true},{\"Id\":20,\"TaskTypeId\":54,\"SalesChannelId\":14,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true},{\"Id\":21,\"TaskTypeId\":54,\"SalesChannelId\":3,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true},{\"Id\":202,\"TaskTypeId\":54,\"SalesChannelId\":1,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true},{\"Id\":221,\"TaskTypeId\":54,\"SalesChannelId\":7,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true}]}"));

Parameters

RecurringJobId
"RetrieveUpdateProductStockBatchResults"
Time
1761053461
CurrentCulture
"tr-TR"
CurrentUICulture
"en-US"

State

10/21/2025 13:32:41 (+1m 37.327s) Failed

An exception occurred during performance of the job.

Microsoft.EntityFrameworkCore.DbUpdateException

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.
 ---> Npgsql.PostgresException (0x80004005): 23503: insert or update on table "IntegrationTaskLog" violates foreign key constraint "FK_IntegrationTaskLog_TaskId_IntegrationTask_Id"

DETAIL: Key (TaskId)=(0) is not present in table "IntegrationTask".
   at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|215_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
  Exception data:
    Severity: ERROR
    SqlState: 23503
    MessageText: insert or update on table "IntegrationTaskLog" violates foreign key constraint "FK_IntegrationTaskLog_TaskId_IntegrationTask_Id"
    Detail: Key (TaskId)=(0) is not present in table "IntegrationTask".
    SchemaName: public
    TableName: IntegrationTaskLog
    ConstraintName: FK_IntegrationTaskLog_TaskId_IntegrationTask_Id
    File: ri_triggers.c
    Line: 2619
    Routine: ri_ReportViolation
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
   at EkolPY.Integration.Service.IntegrationTaskService.AddTaskLog(TaskLogLevel logLevel, String[] messages) in C:\Ekol\ekol360\Integration\EkolPY.Integration.Service\IntegrationService.cs:line 163
   at EkolPY.Integration.Service.IntegrationTaskService.AddTaskError(Exception ex, String[] msgs) in C:\Ekol\ekol360\Integration\EkolPY.Integration.Service\IntegrationService.cs:line 149
   at EkolPY.Integration.Service.IntegrationTaskService.SetFailedWithException(String message, Exception ex) in C:\Ekol\ekol360\Integration\EkolPY.Integration.Service\IntegrationService.cs:line 262
   at EkolPY.Integration.Manager.TaskBase`1.ProcessRecurringAsync(PerformContext context, String queueName, TaskType taskType) in C:\Ekol\ekol360\Integration\EkolPY.Integration.Manager\TaskBase.cs:line 162
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()

+2.422s Processing

Server:
abdullahaydogdu:4944
Worker:
6671c50b

+799ms Enqueued

Triggered by recurring job scheduler

Queue:
default

10/21/2025 13:31:01 Created