[Bug]: Duplicate audio file entries in ABS DB pointing to the same path [after using ffmpeg to clip out extraneous material] #2846

Open
opened 2026-04-25 00:11:16 +02:00 by adam · 0 comments
Owner

Originally created by @iconoclasthero on GitHub (Jun 17, 2025).

What happened?

I was clipping out extraneous material from an audiobook with ffmpeg using -ss and -to to create part files and then recombining* them with ffmpeg -f concat via my indexopus script and copying them back over the original audiobook file. This resulted in abs reporting the sum of these multiple audio file durations as the audiobook duration and showed multiple (3) copies of the audiobook at the same path.

Rescanning via the edit modal didn't fix this.

Image

After discussing on Discord, I am logging the issue with the steps I used to reproduce this as well as the log for the reproduction and how resolved.

* NB: Mentioned for completeness and not to introduce a red herring: the recombination is unnecessary, just trimming 0.001 seconds from the beginning of the book is sufficient as shown below.

What did you expect to happen?

That ABS would correct for there only being one file after rescanning regardless of the multiple inode numbers (this is an assumption I did not verify) for the audiofile in the database.

Steps to reproduce the issue

Simplified command history:

pwd: /library/books/audiobooks/Dominique, Dean; Hayes, James/One Hell of a War: General Patton's 317th Infantry Regiment in WWII (2014)
20042  mkdir c; ffmpeg -ss 00:00:00.001 -i One\ Hell\ of\ a\ War\ --\ Audiobook.opus -acodec copy -y c/One\ Hell\ of\ a\ War\ --\ Audiobook.opus 
20056  mv c/One\ Hell\ of\ a\ War\ --\ Audiobook.opus .
20057  ll
20059  rm -r c

resulted in

Image

with a total duration of:

Image

Audiobookshelf version

v.2.24.0 -- running https://github.com/advplyr/audiobookshelf/pull/4384

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?

I use Chrome, but this is a server rather than a UI issue.

Logs

2025-06-17.txt

Additional Notes/Resolution

To fix the duplicate entries and double (or triple) duration, I moved the file to the tmpfs mount at /dev/shm/cache, gave ABS a moment to update the removal, confirmed the removal in the web UI,* then moved it back (thus clearing the inode numbers in ABS DB and giving the file a new inode number).

* This is relevant because just moving it back and forth in two subsequent commands without allowing the db to update does not resolve the problem.

2025-06-17-2.txt

Originally created by @iconoclasthero on GitHub (Jun 17, 2025). ### What happened? I was clipping out extraneous material from an audiobook with `ffmpeg` using `-ss` and `-to` to create part files and then recombining* them with `ffmpeg -f concat` via my `indexopus` script and copying them back over the original audiobook file. This resulted in abs reporting the sum of these multiple audio file durations as the audiobook duration and showed multiple (3) copies of the audiobook at the same path. Rescanning via the edit modal didn't fix this. ![Image](https://github.com/user-attachments/assets/4a0ce8ed-98eb-4678-ac99-97e05809dcd3) [After discussing on Discord](https://discord.com/channels/942908292873723984/942914154254176257/1384564072954986577), I am logging the issue with the steps I used to reproduce this as well as the log for the reproduction and how resolved. \* NB: Mentioned for completeness and not to introduce a red herring: the recombination is unnecessary, just trimming 0.001 seconds from the beginning of the book is sufficient as shown below. ### What did you expect to happen? That ABS would correct for there only being one file after rescanning regardless of the multiple inode numbers (this is an assumption I did not verify) for the audiofile in the database. ### Steps to reproduce the issue _Simplified command history:_ ``` pwd: /library/books/audiobooks/Dominique, Dean; Hayes, James/One Hell of a War: General Patton's 317th Infantry Regiment in WWII (2014) 20042 mkdir c; ffmpeg -ss 00:00:00.001 -i One\ Hell\ of\ a\ War\ --\ Audiobook.opus -acodec copy -y c/One\ Hell\ of\ a\ War\ --\ Audiobook.opus 20056 mv c/One\ Hell\ of\ a\ War\ --\ Audiobook.opus . 20057 ll 20059 rm -r c ``` --- resulted in ![Image](https://github.com/user-attachments/assets/0921df69-d985-46cf-86a2-5c3174558d71) with a total duration of: ![Image](https://github.com/user-attachments/assets/d78d2103-ba85-4309-99ce-1e7dc3225041) ### Audiobookshelf version v.2.24.0 -- running https://github.com/advplyr/audiobookshelf/pull/4384 ### 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? I use Chrome, but this is a server rather than a UI issue. ### Logs [2025-06-17.txt](https://github.com/user-attachments/files/20779651/2025-06-17.txt) ### Additional Notes/Resolution To fix the duplicate entries and double (or triple) duration, I moved the file to the tmpfs mount at /dev/shm/cache, gave ABS a moment to update the removal, confirmed the removal in the web UI,* then moved it back (thus clearing the inode numbers in ABS DB and giving the file a new inode number). \* This is relevant because just moving it back and forth in two subsequent commands without allowing the db to update does not resolve the problem. [2025-06-17-2.txt](https://github.com/user-attachments/files/20779875/2025-06-17-2.txt)
adam added the bug label 2026-04-25 00:11:16 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2846