[Bug]: Item directory missing, rescan fixes it, appears again at next scan #3272

Closed
opened 2026-04-25 00:14:40 +02:00 by adam · 5 comments
Owner

Originally created by @Zaelnorth on GitHub (Mar 20, 2026).

What happened?

Greetings, I just had ABS scan my library and am facing the same problem as person here https://www.reddit.com/r/audiobookshelf/comments/1jm0hx0/item_directory_missing_but_the_directory_isnt/

Basically in Issues, it's telling me that for 15 of my books, the Item Directory is Missing however the directory isn't missing. Clicking individually Re-Scan fixes it, however the problem happens again at the next library scan.

What did you expect to happen?

All the directories are there, nothing is missing.

Steps to reproduce the issue

  1. No idea why it's happening for 15 of my books only (out of 125)
  2. After scanning the library, they are shown in issues with "Item Directory is Missing"

Audiobookshelf version

2.33.1

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs


Additional Notes

No response

Originally created by @Zaelnorth on GitHub (Mar 20, 2026). ### What happened? Greetings, I just had ABS scan my library and am facing the same problem as person here https://www.reddit.com/r/audiobookshelf/comments/1jm0hx0/item_directory_missing_but_the_directory_isnt/ Basically in Issues, it's telling me that for 15 of my books, the **Item Directory is Missing** however the directory isn't missing. Clicking individually Re-Scan fixes it, however the problem happens again at the next library scan. ### What did you expect to happen? All the directories are there, nothing is missing. ### Steps to reproduce the issue 1. No idea why it's happening for 15 of my books only (out of 125) 2. After scanning the library, they are shown in issues with "Item Directory is Missing" ### Audiobookshelf version 2.33.1 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```shell ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:14:40 +02:00
adam closed this issue 2026-04-25 00:14:40 +02:00
Author
Owner

@nichwall commented on GitHub (Mar 20, 2026):

This is almost always caused by incorrect directory structure in your library. Every book must be in its own folder.

If you have something like

Library/
  Author/
    Bad.mp3
    Book1/
      Book1 files
    Book2/
      Book2 files

where there is a media file (audiobook or ebook) not in its own folder, the other books there will be combined. When you scan the book individually, it will find the files and appear correct, but then when you scan the entire library, the book in the highest directory is detected and everything below it is combined, so the other books are "missing" because they are already associated with Bad.mp3

@nichwall commented on GitHub (Mar 20, 2026): This is almost always caused by incorrect directory structure in your library. Every book must be in its own folder. If you have something like ``` Library/ Author/ Bad.mp3 Book1/ Book1 files Book2/ Book2 files ``` where there is a media file (audiobook or ebook) not in its own folder, the other books there will be combined. When you scan the book individually, it will find the files and appear correct, but then when you scan the entire library, the book in the highest directory is detected and everything below it is combined, so the other books are "missing" because they are already associated with `Bad.mp3`
Author
Owner

@Zaelnorth commented on GitHub (Mar 20, 2026):

Thanks for that, you're right, it was in 2 directories deep e.g. Audio Book X/Audiobook X/mp3 files. But there was just one book there, not two - it somehow confused the system.

Now I removed the 2nd level so it's just Audio Book X/mp3 files, but it's stuck in some odd loop, can't get it to rescan and identify the new structure and it's showing multiple books there. Very strange. Restarted docker, rescanned the library, same problem.

I'll play with this a bit more, but seems super confusing. THanks

@Zaelnorth commented on GitHub (Mar 20, 2026): Thanks for that, you're right, it was in 2 directories deep e.g. Audio Book X/Audiobook X/mp3 files. But there was just one book there, not two - it somehow confused the system. Now I removed the 2nd level so it's just Audio Book X/mp3 files, but it's stuck in some odd loop, can't get it to rescan and identify the new structure and it's showing multiple books there. Very strange. Restarted docker, rescanned the library, same problem. I'll play with this a bit more, but seems super confusing. THanks
Author
Owner

@nichwall commented on GitHub (Mar 20, 2026):

Even if your directory structure is now correct, the server will attempt to detect file moves, so if it was incorrect at any point in the past it may still happen. You'll want to look at whether the files of a book that goes missing is being included in the Files list for another book. A simple check you can do is to sort your library by Duration and see if something is much longer than it should be.

@nichwall commented on GitHub (Mar 20, 2026): Even if your directory structure is now correct, the server will attempt to detect file moves, so if it was incorrect at any point in the past it may still happen. You'll want to look at whether the files of a book that goes missing is being included in the Files list for another book. A simple check you can do is to sort your library by Duration and see if something is much longer than it should be.
Author
Owner

@Zaelnorth commented on GitHub (Mar 20, 2026):

Yeah I just deleted all the books with issues and scanned again and now it's working well, thanks again.

@Zaelnorth commented on GitHub (Mar 20, 2026): Yeah I just deleted all the books with issues and scanned again and now it's working well, thanks again.
Author
Owner

@Zaelnorth commented on GitHub (Mar 20, 2026):

Working well now, thanks a lot for your help - but please check the scenario where Book1/Book1/Audio Files exist, no other audio files in the whole structure apart from the one folder. It confuses the scanning process, whereas it shouldn't...

@Zaelnorth commented on GitHub (Mar 20, 2026): Working well now, thanks a lot for your help - but please check the scenario where Book1/Book1/Audio Files exist, no other audio files in the whole structure apart from the one folder. It confuses the scanning process, whereas it shouldn't...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3272