[Bug]: Audiobookshelf does not restore metadata properly, causing a crash #1810

Closed
opened 2026-04-24 23:58:49 +02:00 by adam · 8 comments
Owner

Originally created by @moozhub on GitHub (Mar 15, 2024).

Describe the issue

Audiobookshelf will crash if attempting to restore a backup on a new install, seemingly because metadata was not included in the initial backup file. Manually copying the authors folder to the new install allows me to get around the crash, however thumbnail / covers are broken which makes me believe there are other portions of the metadata that were not included.

Backup from 2.8.0 on Debian to manual built version 2.8.0 on BSD.

Server output:

# npm run dev

> audiobookshelf@2.8.0 dev
> nodemon --watch server index.js

[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): server/**/*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node index.js`
Config /root/audiobookshelf/config /root/audiobookshelf/metadata
[2024-03-14 21:39:22.480] INFO: === Starting Server ===
[2024-03-14 21:39:22.482] INFO: [Server] Init v2.8.0
[2024-03-14 21:39:22.486] INFO: [Database] Initializing db at "/root/audiobookshelf/config/absdatabase.sqlite"
[2024-03-14 21:39:22.590] INFO: [Database] Db connection was successful
[2024-03-14 21:39:22.779] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting, customMetadataProvider
[2024-03-14 21:39:22.830] INFO: [LogManager] Init current daily log filename: 2024-03-14.txt
[2024-03-14 21:39:22.881] INFO: [BackupManager] 1 Backups Found
[2024-03-14 21:39:22.903] INFO: [BinaryManager] Skipping check for binaries
[2024-03-14 21:39:22.904] INFO: [Watcher] Initializing watcher for "Audiobooks".
[2024-03-14 21:39:22.906] INFO: [Watcher] Initializing watcher for "eBooks".
[2024-03-14 21:39:22.920] INFO: Listening on port :3333
[2024-03-14 21:39:23.183] INFO: [Watcher] "eBooks" Ready
[2024-03-14 21:39:23.342] INFO: [Watcher] "Audiobooks" Ready
[2024-03-14 21:39:40.056] INFO: [SocketAuthority] Socket Connected jGWeNTxYFRGER8grAAAB
[2024-03-14 21:39:51.739] INFO: [SocketAuthority] Socket Connected Xgx6iL49rlnfetq2AAAD
[2024-03-14 21:40:14.108] INFO: [Database] Disconnecting sqlite db
[2024-03-14 21:40:14.692] FATAL: [Server] Unhandled rejection: Error: ENOENT: no such file or directory, open '/root/audiobookshelf/metadata/authors/aut_35mmqn3zymu4n1x18w.jpg', promise: Promise {
  <rejected> [Error: ENOENT: no such file or directory, open '/root/audiobookshelf/metadata/authors/aut_35mmqn3zymu4n1x18w.jpg'] {
    errno: -2,
    code: 'ENOENT',
    syscall: 'open',
    path: '/root/audiobookshelf/metadata/authors/aut_35mmqn3zymu4n1x18w.jpg'
  }
} (Server.js:164)
[nodemon] app crashed - waiting for file changes before starting...

Attached image of audiobookshelf dashboard after manually copying the authors metadata

Screenshot_20240314-220444_Firefox Nightly

Steps to reproduce the issue

  1. Start server
  2. Attempt to apply backup from old instance
  3. Observe crash
  4. Manually apply authors metadata
  5. Start server
  6. View dashboard
  7. Observe second issue

Audiobookshelf version

v.2.8.0

How are you running audiobookshelf?

Built from source

Originally created by @moozhub on GitHub (Mar 15, 2024). ### Describe the issue Audiobookshelf will crash if attempting to restore a backup on a new install, seemingly because metadata was not included in the initial backup file. Manually copying the authors folder to the new install allows me to get around the crash, however thumbnail / covers are broken which makes me believe there are other portions of the metadata that were not included. Backup from 2.8.0 on Debian to manual built version 2.8.0 on BSD. Server output: ``` # npm run dev > audiobookshelf@2.8.0 dev > nodemon --watch server index.js [nodemon] 2.0.22 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): server/**/* [nodemon] watching extensions: js,mjs,json [nodemon] starting `node index.js` Config /root/audiobookshelf/config /root/audiobookshelf/metadata [2024-03-14 21:39:22.480] INFO: === Starting Server === [2024-03-14 21:39:22.482] INFO: [Server] Init v2.8.0 [2024-03-14 21:39:22.486] INFO: [Database] Initializing db at "/root/audiobookshelf/config/absdatabase.sqlite" [2024-03-14 21:39:22.590] INFO: [Database] Db connection was successful [2024-03-14 21:39:22.779] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting, customMetadataProvider [2024-03-14 21:39:22.830] INFO: [LogManager] Init current daily log filename: 2024-03-14.txt [2024-03-14 21:39:22.881] INFO: [BackupManager] 1 Backups Found [2024-03-14 21:39:22.903] INFO: [BinaryManager] Skipping check for binaries [2024-03-14 21:39:22.904] INFO: [Watcher] Initializing watcher for "Audiobooks". [2024-03-14 21:39:22.906] INFO: [Watcher] Initializing watcher for "eBooks". [2024-03-14 21:39:22.920] INFO: Listening on port :3333 [2024-03-14 21:39:23.183] INFO: [Watcher] "eBooks" Ready [2024-03-14 21:39:23.342] INFO: [Watcher] "Audiobooks" Ready [2024-03-14 21:39:40.056] INFO: [SocketAuthority] Socket Connected jGWeNTxYFRGER8grAAAB [2024-03-14 21:39:51.739] INFO: [SocketAuthority] Socket Connected Xgx6iL49rlnfetq2AAAD [2024-03-14 21:40:14.108] INFO: [Database] Disconnecting sqlite db [2024-03-14 21:40:14.692] FATAL: [Server] Unhandled rejection: Error: ENOENT: no such file or directory, open '/root/audiobookshelf/metadata/authors/aut_35mmqn3zymu4n1x18w.jpg', promise: Promise { <rejected> [Error: ENOENT: no such file or directory, open '/root/audiobookshelf/metadata/authors/aut_35mmqn3zymu4n1x18w.jpg'] { errno: -2, code: 'ENOENT', syscall: 'open', path: '/root/audiobookshelf/metadata/authors/aut_35mmqn3zymu4n1x18w.jpg' } } (Server.js:164) [nodemon] app crashed - waiting for file changes before starting... ``` Attached image of audiobookshelf dashboard after manually copying the authors metadata ![Screenshot_20240314-220444_Firefox Nightly](https://github.com/advplyr/audiobookshelf/assets/22420841/2760891e-0f4b-4a9a-a2fe-15d8e1c2b3b2) ### Steps to reproduce the issue 1. Start server 2. Attempt to apply backup from old instance 3. Observe crash 4. Manually apply authors metadata 5. Start server 6. View dashboard 7. Observe second issue ### Audiobookshelf version v.2.8.0 ### How are you running audiobookshelf? Built from source
adam added the bug label 2026-04-24 23:58:49 +02:00
adam closed this issue 2026-04-24 23:58:50 +02:00
Author
Owner

@nichwall commented on GitHub (Mar 15, 2024):

Are you using the restore from backup in the web browser or manually restoring by extracting the zip file?

@nichwall commented on GitHub (Mar 15, 2024): Are you using the restore from backup in the web browser or manually restoring by extracting the zip file?
Author
Owner

@moozhub commented on GitHub (Mar 15, 2024):

I'm backing up from the old instances' web UI, downloading the backup, uploading to the new via the web UI, and clicking restore.

@moozhub commented on GitHub (Mar 15, 2024): I'm backing up from the old instances' web UI, downloading the backup, uploading to the new via the web UI, and clicking restore.
Author
Owner

@advplyr commented on GitHub (Mar 16, 2024):

Are the library folder paths the same? If the server you backed up from had different file paths then it's not going to work

@advplyr commented on GitHub (Mar 16, 2024): Are the library folder paths the same? If the server you backed up from had different file paths then it's not going to work
Author
Owner

@moozhub commented on GitHub (Mar 17, 2024):

Are the library folder paths the same? If the server you backed up from had different file paths then it's not going to work

Yeah that must be it. I'll test and let you know.

Thanks

@moozhub commented on GitHub (Mar 17, 2024): > Are the library folder paths the same? If the server you backed up from had different file paths then it's not going to work Yeah that must be it. I'll test and let you know. Thanks
Author
Owner

@CaptainLexington commented on GitHub (May 11, 2024):

I don't think the root of this issue is library folder paths differing; at least, I have the same behavior and my folder paths are the same (well, they're aliased to the same paths in their respective containers). I'm 2.9.0, source and destination instances.

I can stream a book or download its MP3s just fine, but every HTTP request for a cover fails with a 404 unless I reconfigure the cover manually. I can confirm the metadata was included in the backup and was restored to disk correctly on the new instance. The logs don't report anything untoward except for a similar issue about missing author images, but I don't really maintain my author metadata well so that could be anything.

@CaptainLexington commented on GitHub (May 11, 2024): I don't think the root of this issue is library folder paths differing; at least, I have the same behavior and my folder paths are the same (well, they're aliased to the same paths in their respective containers). I'm 2.9.0, source and destination instances. I can stream a book or download its MP3s just fine, but every HTTP request for a cover fails with a 404 unless I reconfigure the cover manually. I can confirm the metadata was included in the backup and was restored to disk correctly on the new instance. The logs don't report anything untoward except for a similar issue about missing author images, but I don't really maintain my author metadata well so that could be anything.
Author
Owner

@advplyr commented on GitHub (May 11, 2024):

What does it mean to reconfigure the cover manually?

@advplyr commented on GitHub (May 11, 2024): What does it mean to reconfigure the cover manually?
Author
Owner

@CaptainLexington commented on GitHub (May 11, 2024):

Like, if I upload a cover from disk, or download it from a metadata provider. Once I manually set the cover again, it works.

@CaptainLexington commented on GitHub (May 11, 2024): Like, if I upload a cover from disk, or download it from a metadata provider. Once I manually set the cover again, it works.
Author
Owner

@CaptainLexington commented on GitHub (May 11, 2024):

Nevermind, I think I figured it out. The metadata directory was not being mapped to the same place in the new container. My bad.

@CaptainLexington commented on GitHub (May 11, 2024): Nevermind, I think I figured it out. The metadata directory was _not_ being mapped to the same place in the new container. My bad.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1810