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:
-
Set the worker's
--timeoutin step withretry_after. These are two different limits:--timeoutis how long the worker lets a job run before killing the process, whileretry_afteris how long the queue driver waits before releasing the job back for retry.php artisan queue:work --timeout=600Important:
--timeoutmust be less thanretry_after, leaving a few seconds of margin. If--timeoutis greater thanretry_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. -
Raise
retry_afterinconfig/queue.phpfor the connection your backups run on. It must be greater than the longest running backup job.'retry_after' => 660, // 11 minutes -
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 itstimeoutoption 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