RetrieveOrdersTask.ProcessRecurringAsync

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

var retrieveOrdersTask = Activate<RetrieveOrdersTask>();
await retrieveOrdersTask.ProcessRecurringAsync(
    null,
    "default",
    FromJson<TaskType>("{\"Id\":27,\"SystemName\":\"RetrieveOrders\",\"Name\":\"Siparişlerin Çekimi\",\"JobClassName\":\"RetrieveOrdersTask\",\"Type\":\"Recurring\",\"Cron\":\"*/1 * * * *\",\"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\":44,\"TaskTypeId\":27,\"SalesChannelId\":1,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":false},{\"Id\":102,\"TaskTypeId\":27,\"SalesChannelId\":14,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true},{\"Id\":100,\"TaskTypeId\":27,\"SalesChannelId\":3,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true},{\"Id\":101,\"TaskTypeId\":27,\"SalesChannelId\":2,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true},{\"Id\":92,\"TaskTypeId\":27,\"SalesChannelId\":7,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true},{\"Id\":177,\"TaskTypeId\":27,\"SalesChannelId\":15,\"CreatedOnUtc\":\"2023-05-22T15:26:29.407\",\"UpdatedOnUtc\":\"2023-05-22T15:26:29.407\",\"IsActive\":true},{\"Id\":190,\"TaskTypeId\":27,\"SalesChannelId\":5,\"CreatedOnUtc\":\"2023-08-23T09:04:44.668\",\"UpdatedOnUtc\":\"2023-08-23T09:04:44.668\",\"IsActive\":true}]}"));

Parameters

RecurringJobId
"RetrieveOrders"
Time
1753336634
CurrentCulture
""
CurrentUICulture
""

State

07/24/2025 05:57:15 (+790ms) 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.EntityFrameworkCore.PostgreSQL.Update.Internal.NpgsqlModificationCommandBatch.ConsumeAsync(RelationalDataReader reader, 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 Npgsql.EntityFrameworkCore.PostgreSQL.Update.Internal.NpgsqlModificationCommandBatch.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
   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 /src/Integration/EkolPY.Integration.Service/IntegrationService.cs:line 154
   at EkolPY.Integration.Service.IntegrationTaskService.AddTaskError(Exception ex, String[] msgs) in /src/Integration/EkolPY.Integration.Service/IntegrationService.cs:line 146
   at EkolPY.Integration.Service.IntegrationTaskService.SetFailedWithException(String message, Exception ex) in /src/Integration/EkolPY.Integration.Service/IntegrationService.cs:line 247
   at EkolPY.Integration.Manager.TaskBase`1.ProcessRecurringAsync(PerformContext context, String queueName, TaskType taskType) in /src/Integration/EkolPY.Integration.Manager/TaskBase.cs:line 162
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

+19ms Processing

Server:
ekol-py-int-tst-798f54d7-87dlm:1
Worker:
fbf484d9

+6ms Enqueued

Triggered by recurring job scheduler

Queue:
default

07/24/2025 05:57:14 Created