Skip to content

Backup Failing when too large #1819

Description

@chris-spencer

When you try to do a backup and the backup is too large it fails, i had my agent go find and download some royalty free music for a project, then my backs started to fail, below is what agent zero said needed to happen to fix it.. putting it here in case it affects anyone else, and hope someone may take on the task to fix it maybe?

--

Why the backup fails with 504
The error isn't a bug in the JSON, and it isn't a hard server crash. It's a gateway timeout: the WebUI asks the backend to create the backup inside a single HTTP request, but that request takes longer than the proxy/browser is willing to wait, so it returns 504 before the backend finishes.

Evidence
Finding Value
Total data matched by your config ~1.3 GB
Largest culprit /a0/usr/workdir/music_downloads/Relaxing/ at 534 MB
Whole music_downloads folder 572 MB
Confirmed backup completes in backend A 664 MB agent-zero-backup-2026-08-08.zip was produced in /tmp even after the UI timed out
Timeout signature Operation was still running after 30 seconds when the tool wrapper cut it off
Root cause
/a0/api/backup_create.py calls BackupService.create_backup(...) synchronously and then returns the zip with send_file(...). Creating a zip of 1.3 GB simply takes longer than the gateway timeout, so the proxy gives up and reports 504. The backend keeps working and finishes successfully (which is why the 664 MB file appeared in /tmp).

Quick fix: exclude the heavy folder
Add this to your exclude_patterns to drop the bulk of the data:

"/a0/usr/workdir/music_downloads/**"
That single folder is 572 MB; excluding it should let the rest of the backup complete well within the timeout. You can also add other large media or download folders the same way.

Better fix: make backup creation asynchronous
If you want to back up the full 1.3 GB reliably, the proper fix is to make /api/backup_create return a job ID immediately and run the zipping in the background (for example via Agent Zero's scheduler or a Celery-style task). The UI can then poll for progress and download the file once it's ready. That avoids any gateway timeout regardless of backup size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions