[PR #555] [MERGED] Handle corrupted backups gracefully and continue loading other backups #3374

Closed
opened 2026-04-25 00:15:24 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/555
Author: @selfhost-alt
Created: 5/3/2022
Status: Merged
Merged: 5/3/2022
Merged by: @advplyr

Base: masterHead: handle-corrupted-backups


📝 Commits (1)

  • 5ac342d Handle corrupted backups gracefully and continue loading other backups

📊 Changes

1 file changed (+15 additions, -2 deletions)

View changed files

📝 server/managers/BackupManager.js (+15 -2)

📄 Description

I've been noticing that recent backups weren't being displayed in the UI, and was finally able to figure out why. When Audiobookshelf is finding backups, it has to load the archive to get info about the backup version etc. If the archive is corrupted, the following error is thrown and Audiobookshelf stops loading any remaining backups.

[ERROR: [BackupManager] Failed to load backups Error: Bad archive
    at FsRead.readUntilFoundCallback [as callback] (/node_modules/node-stream-zip/node_stream_zip.js:198:39)
    at FsRead.readCallback (/node_modules/node-stream-zip/node_stream_zip.js:996:25)
    at FSReqCallback.wrapper [as oncomplete] (node:fs:660:5)

To fix that issue, this PR adds an inner try/catch to handle that specific Bad archive error, log a message, and continue loading any other remaining backups. After applying that fix,


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/555 **Author:** [@selfhost-alt](https://github.com/selfhost-alt) **Created:** 5/3/2022 **Status:** ✅ Merged **Merged:** 5/3/2022 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `handle-corrupted-backups` --- ### 📝 Commits (1) - [`5ac342d`](https://github.com/advplyr/audiobookshelf/commit/5ac342defdf57c0962545587f28331554dd1ad81) Handle corrupted backups gracefully and continue loading other backups ### 📊 Changes **1 file changed** (+15 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `server/managers/BackupManager.js` (+15 -2) </details> ### 📄 Description I've been noticing that recent backups weren't being displayed in the UI, and was finally able to figure out why. When Audiobookshelf is finding backups, it has to load the archive to get info about the backup version etc. If the archive is corrupted, the following error is thrown and Audiobookshelf stops loading any remaining backups. ``` [ERROR: [BackupManager] Failed to load backups Error: Bad archive at FsRead.readUntilFoundCallback [as callback] (/node_modules/node-stream-zip/node_stream_zip.js:198:39) at FsRead.readCallback (/node_modules/node-stream-zip/node_stream_zip.js:996:25) at FSReqCallback.wrapper [as oncomplete] (node:fs:660:5) ``` To fix that issue, this PR adds an inner try/catch to handle that specific `Bad archive` error, log a message, and continue loading any other remaining backups. After applying that fix, --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:15:24 +02:00
adam closed this issue 2026-04-25 00:15:24 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3374