Skip to content

Fix server backup download and backup failure handling - #8194

Open
Rambomst wants to merge 1 commit into
Ylianst:masterfrom
Rambomst:fix-server-backup-download
Open

Rambomst wants to merge 1 commit into
Ylianst:masterfrom
Rambomst:fix-server-backup-download

Conversation

@Rambomst

@Rambomst Rambomst commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The backup dialog started the download with window.location.href. Firefox closes the page's WebSockets when a top-level navigation starts, even one that ends in a download, so the UI disconnected and reloaded a few seconds later, cancelling the download while the zip was still being built. backup.zip now loads in the existing hidden fileDownloadFrame (downloadFile() drops its frame after 10s, too soon for a large backup), and errors from it show in a dialog. Chrome wasn't affected.
  • A backup that failed while zipping made the next one fail without trying, because archiver errors arriving after the output closed set BACKUPFAIL_ZIPCREATE again after the reset. Zip failures are now tracked per run.
  • A failed database dump ran createBackupfile twice (exec callback and exit handler). Only the exec callback continues now.

Only default and default3 have the backup download; mobile and sharing don't.

Resolves #8193

  • 🧠 I used LLMs/AI in this contribution and reviewed all generated content.
    I understand that I am responsible for and able to explain every line of code I submit.
  • 🔍 Any UI changes adhere to visual style of this project.
  • 🛠️ I have self-reviewed and self-tested my code to ensure it works as expected.
  • 🤖 I added or updated automated tests where appropriate.
  • 📄 Documentation updates are included (if applicable).
  • 🧰 Dependency updates are listed and explained.
  • ⚠️ CI passes and is green.

- Ensured unique IDs for `<iframe>` elements in `default.handlebars` and `default3.handlebars` by adding `id="fileDownloadFrame"`.
- Modified backup logic to handle large downloads without interrupting web socket connections or prematurely removing download frames. Added error handling and user feedback via modal dialogs.
- Refactored backup process in `db.js`:
  - Removed unnecessary child process exit handlers for MongoDB, MySQL, and PostgreSQL backups to simplify execution flow.
  - Introduced a `zipStatus` variable to track archiving errors independently of `backupStatus`, ensuring isolated error management for different backup steps.
  - Updated logging and error-handling logic for zip creation to improve reliability and error reporting.

Fixes Ylianst#8193
@si458

si458 commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

@PTR-inc please can you confirm this fix against the issue?
The fix removes the console log errors when mongodump ir mysqkdump couldn't run for whatever reason which isn't a good idea

@PTR-inc

PTR-inc commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Will check it tonight

@Rambomst

Rambomst commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@PTR-inc please can you confirm this fix against the issue? The fix removes the console log errors when mongodump ir mysqkdump couldn't run for whatever reason which isn't a good idea

They're still logged. The exit handler only added a "child process exited with code N" line on top of the exec callback's error, and ran createBackupfile a second time, which is where the duplicate "Backup failed" came from.

@PTR-inc

PTR-inc commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

@si458 Checked, no loss of error messages as @Rambomst stated and fixes the backup issue. Only have to take care not to lose it if this one is merged before #8098

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download backup (from the web interface) crashes server

3 participants