MultipleObjectsReturned error when calling RetrieveWorkerRunConfiguration as an agent

Teklia Bot
2025-12-02T12:38:05Z

Sentry Issue: [ARKINDEX-BACKEND-2ZZ](https://teklia.sentry.io/issues/7078579129/?referrer=gitlab_integration)

```
WorkerRun.MultipleObjectsReturned: get() returned more than one WorkerRun -- it returned 2!
(4 additional frame(s) were no...

Sentry Issue: ARKINDEX-BACKEND-2ZZ

WorkerRun.MultipleObjectsReturned: get() returned more than one WorkerRun -- it returned 2!
(4 additional frame(s) were not displayed)
...
  File "arkindex/process/api/worker_configuration.py", line 211, in get_object

When a Ponos agent has multiple tasks assigned to it with the same WorkerRun, for example because a process ran with multiple chunks, RetrieveWorkerRunConfiguration can crash because it performs a INNER JOIN on a reverse relationship on WorkerRun.tasks, which can duplicate the WorkerRun once per task.