BUG: New books not automatically added to library #159

Closed
opened 2026-04-24 22:59:40 +02:00 by adam · 11 comments
Owner

Originally created by @feerlessleadr on GitHub (Jan 1, 2022).

Hi - I'm running 1.6.50 and I've noticed that whenever a new book is added to my library's folder structure, it isn't automatically added to my library in the app. In order for the new books to show up, I need to manually kick off a library scan in the settings. Once I do that, the books show up as they should.

Please let me know what I can provide to help debug this. Thanks!

Originally created by @feerlessleadr on GitHub (Jan 1, 2022). Hi - I'm running 1.6.50 and I've noticed that whenever a new book is added to my library's folder structure, it isn't automatically added to my library in the app. In order for the new books to show up, I need to manually kick off a library scan in the settings. Once I do that, the books show up as they should. Please let me know what I can provide to help debug this. Thanks!
adam closed this issue 2026-04-24 22:59:40 +02:00
Author
Owner

@advplyr commented on GitHub (Jan 1, 2022):

If you turn on debug logs in config -> logs, then add an audiobook while watching the logs, you should see debug logs that look like:

[Watcher] File Added

You don't need to copy in a full audiobook, it can just be 1 audio file inside of a folder.

@advplyr commented on GitHub (Jan 1, 2022): If you turn on debug logs in config -> logs, then add an audiobook while watching the logs, you should see debug logs that look like: ``` [Watcher] File Added ``` You don't need to copy in a full audiobook, it can just be 1 audio file inside of a folder.
Author
Owner

@feerlessleadr commented on GitHub (Jan 1, 2022):

ok thanks. So I turned on debug logging, added another book (I needed to add one anyway), and nothing in the log showed up. Here is what the log looked like while I added a book to the folder structure:

2022-01-01 18:12:34

DEBUG

Set Log Level to DEBUG

2022-01-01 18:12:34

DEBUG

[DB] Updated settings: 1

2022-01-01 18:15:12

DEBUG

[Stream] Update client current time 22:02:31.0

2022-01-01 18:15:12

DEBUG

[Stream] Update client current time 22:02:07.0

2022-01-01 18:15:12

DEBUG

[DB] Updated user: 1

2022-01-01 18:15:12

DEBUG

[DB] Updated user: 1

2022-01-01 18:15:19

DEBUG

[Stream] Update client current time 22:02:19.0

2022-01-01 18:15:19

DEBUG

[Stream] Update client current time 22:02:19.0

2022-01-01 18:15:19

DEBUG

[ApiController] syncStream for root -

2022-01-01 18:15:19

ERROR

[StreamManager] streamSyncFromApi stream not found

2022-01-01 18:15:19

DEBUG

[DB] Updated user: 1

2022-01-01 18:15:19

DEBUG

[DB] Updated user: 1

I played a book on my app just to make sure that there wasn't an issue with the log (so not sure what that streamsyncfromapi error means).

Could the issue be that my docker instance is running on my linux box, but the library folder is hosted on my windows box (and connected via a mounted cifs share mount into my linux box?

@feerlessleadr commented on GitHub (Jan 1, 2022): ok thanks. So I turned on debug logging, added another book (I needed to add one anyway), and nothing in the log showed up. Here is what the log looked like while I added a book to the folder structure: ``` 2022-01-01 18:12:34 DEBUG Set Log Level to DEBUG 2022-01-01 18:12:34 DEBUG [DB] Updated settings: 1 2022-01-01 18:15:12 DEBUG [Stream] Update client current time 22:02:31.0 2022-01-01 18:15:12 DEBUG [Stream] Update client current time 22:02:07.0 2022-01-01 18:15:12 DEBUG [DB] Updated user: 1 2022-01-01 18:15:12 DEBUG [DB] Updated user: 1 2022-01-01 18:15:19 DEBUG [Stream] Update client current time 22:02:19.0 2022-01-01 18:15:19 DEBUG [Stream] Update client current time 22:02:19.0 2022-01-01 18:15:19 DEBUG [ApiController] syncStream for root - 2022-01-01 18:15:19 ERROR [StreamManager] streamSyncFromApi stream not found 2022-01-01 18:15:19 DEBUG [DB] Updated user: 1 2022-01-01 18:15:19 DEBUG [DB] Updated user: 1 ``` I played a book on my app just to make sure that there wasn't an issue with the log (so not sure what that streamsyncfromapi error means). Could the issue be that my docker instance is running on my linux box, but the library folder is hosted on my windows box (and connected via a mounted cifs share mount into my linux box?
Author
Owner

@advplyr commented on GitHub (Jan 1, 2022):

Yeah it could be that, but I'm also aware of a bug with the watcher and libraries with many folders.
How many folders does the library folder contain?

@advplyr commented on GitHub (Jan 1, 2022): Yeah it could be that, but I'm also aware of a bug with the watcher and libraries with many folders. How many folders does the library folder contain?
Author
Owner

@feerlessleadr commented on GitHub (Jan 1, 2022):

There are currently 113 folders with multiple subdirectories within each folder.

@feerlessleadr commented on GitHub (Jan 1, 2022): There are currently 113 folders with multiple subdirectories within each folder.
Author
Owner

@advplyr commented on GitHub (Jan 1, 2022):

When you startup the server there should be 2 logs for each library:

[2022-01-01T18:25:56.628Z]  INFO: [Watcher] Initializing watcher for "Audiobooks".
[2022-01-01T18:25:56.629Z] DEBUG: [Watcher] Init watcher for library folder path "<Your library path>"

Let me know if you see these 2 logs on a server restart

@advplyr commented on GitHub (Jan 1, 2022): When you startup the server there should be 2 logs for each library: ``` [2022-01-01T18:25:56.628Z] INFO: [Watcher] Initializing watcher for "Audiobooks". [2022-01-01T18:25:56.629Z] DEBUG: [Watcher] Init watcher for library folder path "<Your library path>" ``` Let me know if you see these 2 logs on a server restart
Author
Owner

@feerlessleadr commented on GitHub (Jan 1, 2022):

Yep - those are present:

2022-01-01 18:31:15

INFO

[Watcher] Initializing watcher for "Main".

2022-01-01 18:31:15

DEBUG

[Watcher] Init watcher for library folder path "/audiobooks"
@feerlessleadr commented on GitHub (Jan 1, 2022): Yep - those are present: ``` 2022-01-01 18:31:15 INFO [Watcher] Initializing watcher for "Main". 2022-01-01 18:31:15 DEBUG [Watcher] Init watcher for library folder path "/audiobooks" ```
Author
Owner

@advplyr commented on GitHub (Jan 1, 2022):

In that case it isn't the bug that I mentioned. It most likely has to do with the remote file system.

Do you use other servers that are able to automatically detect updates?

@advplyr commented on GitHub (Jan 1, 2022): In that case it isn't the bug that I mentioned. It most likely has to do with the remote file system. Do you use other servers that are able to automatically detect updates?
Author
Owner

@feerlessleadr commented on GitHub (Jan 1, 2022):

hmm - good question. On this box, I don't think I do (I'm running sonarr, radarr, prowlarr, etc., and I don't think any of those services need to auto detect updates on my remote file system).

Perhaps once things are feature complete, a task scheduler of sorts can be added in where I can schedule the server to run a scan on a schedule (like once an hour, or something similar).

@feerlessleadr commented on GitHub (Jan 1, 2022): hmm - good question. On this box, I don't think I do (I'm running sonarr, radarr, prowlarr, etc., and I don't think any of those services need to auto detect updates on my remote file system). Perhaps once things are feature complete, a task scheduler of sorts can be added in where I can schedule the server to run a scan on a schedule (like once an hour, or something similar).
Author
Owner

@advplyr commented on GitHub (Jan 1, 2022):

The watcher used is: https://github.com/fabiospampinato/watcher
which is OS specific, so it could be the Linux/Windows combo. There might be a workaround using the watcher settings, but we would need to add additional ENV variables to configure these.

@advplyr commented on GitHub (Jan 1, 2022): The watcher used is: https://github.com/fabiospampinato/watcher which is OS specific, so it could be the Linux/Windows combo. There might be a workaround using the watcher settings, but we would need to add additional ENV variables to configure these.
Author
Owner

@feerlessleadr commented on GitHub (Jan 1, 2022):

Ok thanks - I'm in no rush but happy to test anything you come up with. In the meantime, hitting scan when I add a book is easy enough.

@feerlessleadr commented on GitHub (Jan 1, 2022): Ok thanks - I'm in no rush but happy to test anything you come up with. In the meantime, hitting scan when I add a book is easy enough.
Author
Owner

@MidnightSnowleopard commented on GitHub (Jan 2, 2022):

advplyr is right. This is an issue known with network file systems and docker. There is likely something that can be done to work around it at the language level that could be added but I wouldn't hold my breath on it being fixed in containers any time soon.

https://forums.docker.com/t/file-system-watch-does-not-work-with-mounted-volumes/12038/7

@MidnightSnowleopard commented on GitHub (Jan 2, 2022): advplyr is right. This is an issue known with network file systems and docker. There is likely something that can be done to work around it at the language level that could be added but I wouldn't hold my breath on it being fixed in containers any time soon. [https://forums.docker.com/t/file-system-watch-does-not-work-with-mounted-volumes/12038/7](https://forums.docker.com/t/file-system-watch-does-not-work-with-mounted-volumes/12038/7)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#159