Troubleshooting - SameOldNick/laravel-backup-manager GitHub Wiki

Solutions for common issues when using the backup manager.

Backup Jobs Fail From the Queue Worker Timeout

Symptom

A backup job fails — often on larger backups — even though running the backup manually succeeds. The failure typically appears in the queue worker logs as MaxAttemptsExceededException, MaxExceptionsExceededException, or a job that was terminated mid-run with no PHP exception at all.

Cause

Backups are dispatched through Laravel's queue, and Laravel queue workers enforce a timeout that kills the process hard when exceeded. Large databases or large file sets routinely run longer than the timeout, so the backup is cut off before it finishes.

Solution

Increase the queue worker timeout so that backup jobs can run to completion:

  1. Set the worker's --timeout in step with retry_after. These are two different limits: --timeout is how long the worker lets a job run before killing the process, while retry_after is how long the queue driver waits before releasing the job back for retry.

    php artisan queue:work --timeout=600
    

    Important: --timeout must be less than retry_after, leaving a few seconds of margin. If --timeout is greater than retry_after, the queue driver releases the job for retry while the original worker is still running it, so the same job executes on two workers at once.

  2. Raise retry_after in config/queue.php for the connection your backups run on. It must be greater than the longest running backup job.

    'retry_after' => 660, // 11 minutes
    
  3. For Spatie Backup specific jobs (e.g. BackupJob, CleanupJob), confirm they are not also bounded by their own timeout setting. Spatie's cleanup job honors its timeout option as well.

Example: A Worker-Specific Queue

If you run backups on a dedicated queue, apply the longer timeout only to that queue:

// config/queue.php
'backups' => [
    'driver' => 'database',
    'table' => 'jobs',
    'queue' => 'backups',
    'retry_after' => 3600, // 1 hour
],
php artisan queue:work --queue=backups --timeout=3540