Oban error info does not contain worker name

I am seeing in my logs:

\[Oban.Pro.Engines.Smart\] Unique constraint violation repaired.

This may indicate a unique job misconfiguration where jobs are being inserted
with conflicting unique keys across different states. The engine repaired the
violation for uniq_key: d6SRNHhS+Xdfu6D6nK2mDV/pIgGRhvczz93PBF2+UeM

Check your unique job configuration to ensure the :states option matches the
expected job lifecycle for this worker.

I would like to investigate this, but “this worker” is not helpful for me to identify the worker.

Without the worker module name how would I investigate this?

The unique violation is coming from Postgres, and that’s all the information it provides. You can use the uniq_key to find the worker, either by querying in the Web dashboard, or with this SQL:

select worker from oban_jobs where meta @> '{"uniq_key":"d6SRNHhS+Xdfu6D6nK2mDV/pIgGRhvczz93PBF2+UeM"}` limit 1;

It’s highly likely this is caused by an incomplete list of unique states. Look into switching to unique groups instead: https://hexdocs.pm/oban/v2-20.html#update-unique-states-optional

2 Likes