Laravel queue jobs running twice: what I check before retrying
Separate duplicate dispatches from retried Laravel jobs using message IDs, attempt times and a worked timeout example. Check external results before replaying.

Laravel's queue documentation identifies a specific way to process a job twice: the retry window expires while its first worker is still running. That is one explanation for repeated emails, invoices or stock changes. Another is that the application dispatched two separate jobs. I separate those cases by comparing the business reference, queue message identity and attempt number before replaying anything.
If an external system might already have accepted the action, check its records first. A local exception does not prove that an invoice, payment request or notification failed at the other end.
A timeout example that explains the overlap
Illustrative configuration, not a recommended setting: imagine a queue connection with retry_after = 90 seconds and an effective worker timeout of 120 seconds. A slow job starts at time zero and remains unfinished.
- At zero seconds, worker A reserves the message and starts the job.
- From 90 seconds, that reservation can expire and another worker can pick up the same unfinished message.
- Worker A has not yet reached its 120-second timeout. Both attempts can now be active.
The important measurement is the gap between reservation expiry and the first worker stopping. Adding more retries will not close that gap.
Laravel says the worker timeout must be several seconds shorter than retry_after. SQS uses its visibility timeout instead. Check the documentation for the installed Laravel version and backend. A job-specific timeout can override the worker setting; outgoing requests also need appropriate connection and request timeouts, and Laravel's job timeout mechanism requires PCNTL.
Before changing values, measure normal and slow job duration. If a growing import now takes several minutes, splitting it into smaller, recoverable chunks may be a better change than allowing every worker to run indefinitely.
Collect four identifiers for one repeated action
Choose one affected order, invoice or import row. Ask the developer to correlate these fields in application logs, using references that do not expose customer data:
- Business operation: the intended action, such as exporting invoice INV-DEMO-42. Keep this stable across retries.
- Queue message identity: the job UUID or backend identifier available in the application. Record which identifier it is so that identifiers from different systems are not mistaken for separate jobs.
- Attempt and execution: attempt number, start and finish time with timezone, and worker or host identity.
- External result: the provider's request reference and any confirmed record ID.
A useful log trail records dispatch, processing start, external acknowledgement and local completion separately. If logging starts only after the external call, an interruption can leave the most important part of the story missing. These are suggested diagnostic fields, not a log format automatically supplied by every Laravel application.
Read the evidence before choosing a fix
Two dispatch records for the same intended operation: trace the entry points. A controller and a model observer may both request an export. A webhook may be delivered again. A manual retry button may create new work without checking whether the original operation completed. Compare the callers before changing worker settings.
One message with overlapping processing attempts: inspect the reservation window, effective timeout and worker lifecycle. Record the connection and queue actually being consumed. Several workers are normal; the fault is two attempts acting on the same operation when the workflow cannot tolerate it.
One attempt with two provider requests: inspect loops, callbacks and the HTTP client's retry behaviour. Queue settings alone cannot explain two calls made inside one execution.
A later attempt after an apparently successful provider request: reconcile the provider's record with local completion. The first attempt may have performed its external action and then failed before saving the acknowledgement. This is the same uncertainty described in my guide to duplicate orders in a Laravel API integration.
Check the running workers, not just the environment file
Collect the process manager's worker command, the deployed queue configuration and any job-level overrides. A changed environment file is evidence of an edit, not evidence that every process is using it.
Laravel's deployment guidance explains that workers keep application state in memory. Include their controlled restart in the deployment plan and confirm the process manager brings them back. Check every host consuming the affected queue.
An empty failed-job list is useful information, but it does not establish that each business operation happened once. Two separately dispatched jobs can both finish successfully. Monitoring needs to distinguish technical completion from duplicate business outcomes.
Make a repeated delivery safe
Amazon explicitly documents at-least-once delivery for SQS standard queues. The application must cope with seeing a message again. This is a stronger requirement than preventing two workers from overlapping.
For an invoice export, a stable operation reference can tie repeat attempts to the same intended export. If the provider supports idempotency keys, follow its rules for reusing that key. If it does not, design a reconciliation step for uncertain results. Do not assume that a missing local reference means the provider has no invoice.
A local “already done” check also needs a concurrency design: two processes can both read “not done” before either saves completion. The correct protection depends on the database, external API and operation. A permanent lock on an entire customer account could hide duplicates by blocking legitimate later work.
Prove the repair with an interrupted attempt
Use an isolated test environment with substitute or sandbox integrations. Interrupt the workflow after the provider accepts the action but before local completion is saved, then process the same intended operation again. The check is whether it reconciles to one business result.
Also test simultaneous requests for the same operation and two genuinely different operations for the same record. The first should not duplicate the result; the second must not be silently discarded. Before replaying a production backlog, separate confirmed completions, confirmed failures and uncertain outcomes, then agree a small, observable first batch.
Is a Laravel job repeating business actions?I work on existing Laravel applications, integrations and reliability problems. Send the affected workflow, an approximate incident time and a redacted example. I can scope an investigation around the records needed to establish what happened.
Ask Adam about your queue issue
Need a hand with this?
Work directly with me on an existing Laravel application, from a focused assessment to ongoing development.
Find the right support
A related project
Improving an existing Laravel application in placeFocused work on catalogue loading and operational screens, backed by regression checks for the workflows already in use.
Related Articles
Signs Your Laravel App Needs a Dedicated Developer Not a One-Off Contractor
If your Laravel application is central to how your business runs but nobody truly owns it, here are the signs you need dedicated ongoing support rather than another one-off contractor.
Taking over a Laravel app with no handover
An inherited Laravel app still has to run tomorrow. Map the live systems, trace one real workflow and make a change you can verify and roll back.
Multi-Location Inventory in Laravel -- What to Decide Before You Build
Multi-location inventory sounds straightforward until you start building it. Here are the decisions that will shape your entire data model before you write a line of code.