Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

306
Vistas
Laravel Supervisor: Duplicate entry '' for key 'failed_jobs_uuid_unique'

I'm using Laravel's Supervisor for queue management, and added the failed_jobs table by using the default commands (php artisan queue:failed-table + migrate).

A job sometimes fails, but the failed_jobs table is never filled because it apparently tries to add a record without a primary key. I have no idea where in Laravel to have it generate a uuid.

I find issues like Duplicate entry '014c3080-3ee3-4198-946c-dfe1d8d858a7' for key 'failed_jobs_uuid_unique', but that has a different cause. My application doesn't even generate a uuid.

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

It seems like Laravel is trying to log the same failed job with the same UUID multiple times. This may happen when two workers pick the same job and both executions fail. The first worker will be able to log the job successfully but the second worker will receive this error because an entry with the same UUID already exists.

check this link for prevent this issue

https://divinglaravel.com/prevent-your-queued-jobs-from-duplicating

over 4 years ago · Santiago Trujillo Denunciar

0

The uuid of a Job is generated trough a driver named "database-uuids". This should be configured by default inside your config/queue.php as following (near the end of the file):

'failed' => [
    'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
    'database' => env('DB_CONNECTION', 'mysql'),
    'table' => 'failed_jobs',
],

Unless you have provided another value for QUEUE_FAILED_DRIVER in your .env file, your failed_jobs should be given a uuid by default.

If this does not work, please leave a comment on this answer and I'll try look for another solution.

over 4 years ago · Santiago Trujillo Denunciar

0

Change uuid field nullable at failed_jobs table.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda