-
Notifications
You must be signed in to change notification settings - Fork 450
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]: Recurring crash #2686
Comments
I've set log level to debug. First thing I did was to run docker-compose, but I don't think it upgraded, I think it was already on latest release (2.8.0) |
So there used to be a file at that location, but then you moved it and now it's crashing the server? |
Funny thing is, this crash is recent, but those changes were made quite a while ago. |
Does the book exist in your ABS library (shows up without scanning)? If so, does it show up as missing or let you interact with it? |
No. I searched for it when I saw the error. No registration of it. Which is
also strange, I haven’t deleted anything. Or I don’t think I have?
…On Wed, 28 Feb 2024 at 13:55, Nicholas W ***@***.***> wrote:
Does the book exist in your ABS library (shows up without scanning)? If
so, does it show up as missing or let you interact with it?
—
Reply to this email directly, view it on GitHub
<#2686 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABY7EL3W5YXPWQZRNRIBTY3YV4ZOJAVCNFSM6AAAAABD6ARPHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRZGAZTONBXGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
There's another thing I don't understand about the logs above
Who initiated the forced library scan? As far as I understand, the force-rescan option doesn't even exist anymore on the client in recent versions, it's only available through the API. The round hour (13:00:00) on the log entry maybe suggests that the scan was started by the CronManager (although AFAIK the CronManager does not start a forced scan either).
|
It scans every hour according to settings. I can't remember if I pressed the scan button in Settings > Libraries. Here's the log, hope hit helps? |
Sorry for nagging again, but the unfortunately crash the logs didn't provide me with much additional info. Can you please also attach the crashed library scan log? Hopefully it will provide me with some more info regarding what happened right before the crash. Also, since the crash most probably happens during an automated scan, then as a workaround until we figure the root cause, you can disable the automatic scans for that library. This will most likely stop the recurring crashes. Also, if the folders for this library are local (i.e. not network mounted), then the watcher is capable of detecting new additions to the library, and there's no need for an automated scan at all. However if the library folders are remote, you indeed need the scan, since watchers will likely not detect changes. |
I have a similar issue. I moved some epubs to a different directory and now scan crashes. The logs/scan file doesn't show the errors; similar to the OP I get the logged error about failure to extract with "no such file or directory" and then it becomes FATAL immediately after. I haven't finished setting up a dev environment but suspect that on this line, the
|
Thanks for the info. I will try to reproduce the way you described. Regarding |
Ah, great, I was able to reproduce this. The crash happens during a library scan when all the follwoing conditions are met:
Due to a bug somewhere, although the book path changes, the code tries to open it in its original location, which likely causes the crash (I haven't identified exactly where the crash happens, but at least I understand the root of the problem). I will work on a fix. |
So you don't need the log? I have found it but I'd be happy to skip it :) |
No, thank you, I don't need the log anymore |
@advplyr, I dug into what happens when you move library files into a different folder in the same library. It looks like the code that handles these kind of changes seems quite buggy at this point, so I'd like to understand better the considerations behind the organization of the data in LibraryItem records and their associated media (Book/Podcast/PodcastEpisode) records, before I implement a fix.
The paths in In this case, inside So, my questions, before trying to fix:
|
Of course, another possibility of fixing this is to remove the clever ino matching code, in which case a folder move would just be identified as a missing book and a new book. I understand you'd rather keep the existing behavior - it's very nice, and takes burden off the user (if it works :) And in any case, we also need to fix the existing database corruption for users that encountered this bug. |
Thanks for digging into that. The issue with the data model you pointed out is something I've wanted to solve for a while now. Originally when transitioning to sqlite from the JSON db I mapped out a data model that associated audioFiles, ebooks and images with library files but the queries became too complex while we still need to map everything to the old data model. I'm open to ways to bridge that gap though since changing the data model at this point will be a large project. When I re-wrote the scanner this last time I must have missed updating the other file paths because that used to be handled. Removing the inode check would cause a lot of issues since users would lose their media progress when renaming a folder. |
The approach I was thinking about is the following:
I understand doing this is a serious piece of work, but this is also quite a serious issue.
Yes, I understand that's not an ideal solution. They would also lose any metadata changes they made. |
Right now if you have multiple cover images you can switch between them in the Cover tab. Library files are used for those other covers. I like your approach and would prefer that but like you said it is a large project. Excluding media files from the library files array would probably require some refactoring of the mobile apps but I will have to dig into that to see. |
Fixed in v2.9.0 |
Describe the issue
I'm not really sure what else I can add except these two things from the log.
Here's the log, the crash is in bold:
2024-02-28 12:53:39.090
INFO
=== Starting Server ===
2024-02-28 12:53:39.091
INFO
[Server] Init v2.8.0
2024-02-28 12:53:39.104
INFO
[Database] Initializing db at "/config/absdatabase.sqlite"
2024-02-28 12:53:39.183
INFO
[Database] Db connection was successful
2024-02-28 12:53:39.379
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-02-28 12:53:40.117
WARN
Removed 1 sessions that were 3 seconds or less
2024-02-28 12:53:40.124
INFO
[LogManager] Removed daily log: 2024-02-21.txt
2024-02-28 12:53:40.125
INFO
[LogManager] Init current daily log filename: 2024-02-28.txt
2024-02-28 12:53:40.222
INFO
[BackupManager] 0 Backups Found
2024-02-28 12:53:40.223
INFO
[BackupManager] Auto Backups are disabled
2024-02-28 12:53:40.248
INFO
[Watcher] Initializing watcher for "Fiction".
2024-02-28 12:53:40.251
INFO
[Watcher] Initializing watcher for "Podcasts".
2024-02-28 12:53:40.252
INFO
[Watcher] Initializing watcher for "Comedy".
2024-02-28 12:53:40.252
INFO
[Watcher] Initializing watcher for "non-fiction".
2024-02-28 12:53:40.252
INFO
[Watcher] Initializing watcher for "History & Biography".
2024-02-28 12:53:40.265
INFO
Listening on port :80
2024-02-28 12:53:40.381
INFO
[Watcher] "Podcasts" Ready
2024-02-28 12:53:40.770
INFO
[Watcher] "Comedy" Ready
2024-02-28 12:53:40.940
INFO
[Watcher] "non-fiction" Ready
2024-02-28 12:53:40.981
INFO
[Watcher] "History & Biography" Ready
2024-02-28 12:53:42.313
INFO
[Watcher] "Fiction" Ready
2024-02-28 13:00:00.649
INFO
[LibraryScanner] Library metadata precedence changed since last scan. From [folderStructure,audioMetatags,txtFiles,opfFile,absMetadata] to [audioMetatags,txtFiles,opfFile,absMetadata,folderStructure]
2024-02-28 13:00:00.651
INFO
[LibraryScanner] Starting (forced) library scan 05246d51-dacf-4a88-aafd-9b90c897b4de for Fiction
2024-02-28 13:00:20.746
ERROR
[parseEpubMetadata] Failed to extract META-INF/container.xml from epub at "/audiobooks/Author Name/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion]/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion].epub" Error: ENOENT: no such file or directory, open '/audiobooks/Author Name/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion]/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion].epub'
2024-02-28 13:00:20.749
FATAL
[Server] Unhandled rejection: Error: ENOENT: no such file or directory, open '/audiobooks/Author Name/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion]/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion].epub', promise: Promise { [Error: ENOENT: no such file or directory, open '/audiobooks/Author Name/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion]/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion].epub'] { errno: -2, code: 'ENOENT', syscall: 'open', path: '/audiobooks/Author Name/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion]/Redacted The Step By Step Guide To Redacted by Works, Companion [Works, Companion].epub' } }
Steps to reproduce the issue
I'm not interacting with app or server when this happens. Or I don't think I am? I may have opened the app at those times? Will add to this if that turns out to be the case.
Audiobookshelf version
v2.8.0
How are you running audiobookshelf?
Docker
The text was updated successfully, but these errors were encountered: