Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: a single "bad archive" anywhere in backups folder unregisters all backups (bad or good) #1961

Closed
wtanksleyjr opened this issue Jul 24, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@wtanksleyjr
Copy link

Describe the issue

Backups will always deleted on next reboot with "Bad archive" error. See message below.

Steps to reproduce the issue

  1. I don't know how I got in this situation, so I can't give any steps. But here's the error message I get on every restart if a backup was made, or anytime I try to do anything with an existing backup.
  2. This happens with all backups, whether automatic or manually triggered.
  3. I knew this was happening as of my previous version installed (I think it was the last released version of 2.2.x, but I'm not absolutely sure). So it's not a new bug.
audiobookshelf_1  | [2023-07-24 23:25:29] INFO: [Database] Db data loaded in 16.84s
audiobookshelf_1  | [2023-07-24 23:25:30] ERROR: [BackupManager] Failed to unzip backup "/metadata/backups/2022-08-03T0130.audiobookshelf" Error: Bad archive
audiobookshelf_1  |     at FsRead.readUntilFoundCallback [as callback] (/server/libs/nodeStreamZip/index.js:198:33)
audiobookshelf_1  |     at FsRead.readCallback (/server/libs/nodeStreamZip/index.js:996:19)
audiobookshelf_1  |     at FSReqCallback.wrapper [as oncomplete] (node:fs:671:5) (BackupManager.js:174)
audiobookshelf_1  | [2023-07-24 23:25:30] ERROR: [BackupManager] Failed to load backups Error: Bad archive
audiobookshelf_1  |     at FsRead.readUntilFoundCallback [as callback] (/server/libs/nodeStreamZip/index.js:198:33)
audiobookshelf_1  |     at FsRead.readCallback (/server/libs/nodeStreamZip/index.js:996:19)
audiobookshelf_1  |     at FSReqCallback.wrapper [as oncomplete] (node:fs:671:5) (BackupManager.js:203)

Audiobookshelf version

2.3.3

How are you running audiobookshelf?

Docker

@wtanksleyjr wtanksleyjr added the bug Something isn't working label Jul 24, 2023
@advplyr
Copy link
Owner

advplyr commented Jul 26, 2023

The error you are showing is a backup from 2022-08-03. Is this error still happening on backups created with v2.3.3?

You can test if you can extract that backup file yourself

@wtanksleyjr
Copy link
Author

Wow, that's odd, I manually created that backup just that day. Let me check again (of course the backup file is always deleted when it's detected as bad).

@wtanksleyjr
Copy link
Author

OK, so after confirming there were a reasonable number of automatic backups (3), all produced at 1:30AM on each day. I restarted the docker-compose service. Once it came up it said this:

audiobookshelf_1  | [2023-07-28 01:07:09] INFO: [Database] Db data loaded in 17.43s
audiobookshelf_1  | [2023-07-28 01:07:09] ERROR: [BackupManager] Failed to unzip backup "/metadata/backups/2022-08-03T0130.audiobookshelf" Error: Bad archive
audiobookshelf_1  |     at FsRead.readUntilFoundCallback [as callback] (/server/libs/nodeStreamZip/index.js:198:33)
audiobookshelf_1  |     at FsRead.readCallback (/server/libs/nodeStreamZip/index.js:996:19)
audiobookshelf_1  |     at FSReqCallback.wrapper [as oncomplete] (node:fs:671:5) (BackupManager.js:174)
audiobookshelf_1  | [2023-07-28 01:07:09] ERROR: [BackupManager] Failed to load backups Error: Bad archive
audiobookshelf_1  |     at FsRead.readUntilFoundCallback [as callback] (/server/libs/nodeStreamZip/index.js:198:33)
audiobookshelf_1  |     at FsRead.readCallback (/server/libs/nodeStreamZip/index.js:996:19)
audiobookshelf_1  |     at FSReqCallback.wrapper [as oncomplete] (node:fs:671:5) (BackupManager.js:203)

Now all three are gone, and there's nothing in the log that might pertain to all three being checked - only that one record.

I'll send this and then create a backup archive followed by manually unzipping it.

@wtanksleyjr
Copy link
Author

OK, this was very simple. ABS wasn't deleting anything at all; what it was doing is finding one bad archive from a long time ago (as you see), and for some reason responding to that by removing all of my backups from its list. Then next time it restarted, it'd do the same thing.

The result is that my backups folder was absolutely stuffed with backups, what seemed like hundreds of them. I trimmed them down and reloaded them into the list so that hopefully it'll manage them per the configuration (I expected it only to keep 5).

If there's a bug here, it might be removing all backups from its list when any invalid backup is found. Aside from that, workaround is simple, all of the backups are right where they should be so can be loaded into the list manually.

@wtanksleyjr wtanksleyjr changed the title [Bug]: "Bad archive" error on all backups [Bug]: a single "bad archive" anywhere in backups folder unregisters all backups (bad or good) Jul 30, 2023
@advplyr
Copy link
Owner

advplyr commented Sep 30, 2023

Fixed in v2.4.4

@advplyr advplyr closed this as completed Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants