[Bug]: M4B Merging not completing. Fails and does not notify of failure. #1126

Closed
opened 2026-04-24 23:33:32 +02:00 by adam · 4 comments
Owner

Originally created by @untitled-operator on GitHub (May 9, 2023).

Describe the issue

This seems like a permission issue, but It was working over the past week until today. It shows that it couldn't move to /usr/share, but it also failed to move the m4b file where the media drive as well. Here are the logs:

2023-05-09 16:22:50

ERROR

[AbMergeManager] Failed to move track "/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/25_Chapter_24.mp3" to "/usr/share/audiobookshelf/metadata/cache/items/li_2n5go3apektxa6hyc7/25_Chapter_24.mp3" Error: EACCES: permission denied, unlink '/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/25_Chapter_24.mp3'

2023-05-09 16:22:50

DEBUG

[AbMergeManager] Backing up original track "/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/26_Chapter_25.mp3" to /usr/share/audiobookshelf/metadata/cache/items/li_2n5go3apektxa6hyc7/26_Chapter_25.mp3

2023-05-09 16:22:50

ERROR

[AbMergeManager] Failed to move track "/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/26_Chapter_25.mp3" to "/usr/share/audiobookshelf/metadata/cache/items/li_2n5go3apektxa6hyc7/26_Chapter_25.mp3" Error: EACCES: permission denied, unlink '/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/26_Chapter_25.mp3'

2023-05-09 16:22:50

DEBUG

[AbMergeManager] Moving m4b from /usr/share/audiobookshelf/metadata/cache/items/li_2n5go3apektxa6hyc7/Wiseguy.m4b to /home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/Wiseguy.m4b

Steps to reproduce the issue

  1. Select a book to merge
  2. Let process run
  3. Merging fails with no indication to the user without checking logs.
  4. All .mp3 files are untouched and an m4b file has not been created.

Audiobookshelf version

v2.2.20

How are you running audiobookshelf?

Debian/PPA

Originally created by @untitled-operator on GitHub (May 9, 2023). ### Describe the issue This seems like a permission issue, but It was working over the past week until today. It shows that it couldn't move to /usr/share, but it also failed to move the m4b file where the media drive as well. Here are the logs: 2023-05-09 16:22:50 ERROR [AbMergeManager] Failed to move track "/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/25_Chapter_24.mp3" to "/usr/share/audiobookshelf/metadata/cache/items/li_2n5go3apektxa6hyc7/25_Chapter_24.mp3" Error: EACCES: permission denied, unlink '/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/25_Chapter_24.mp3' 2023-05-09 16:22:50 DEBUG [AbMergeManager] Backing up original track "/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/26_Chapter_25.mp3" to /usr/share/audiobookshelf/metadata/cache/items/li_2n5go3apektxa6hyc7/26_Chapter_25.mp3 2023-05-09 16:22:50 ERROR [AbMergeManager] Failed to move track "/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/26_Chapter_25.mp3" to "/usr/share/audiobookshelf/metadata/cache/items/li_2n5go3apektxa6hyc7/26_Chapter_25.mp3" Error: EACCES: permission denied, unlink '/home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/26_Chapter_25.mp3' 2023-05-09 16:22:50 DEBUG [AbMergeManager] Moving m4b from /usr/share/audiobookshelf/metadata/cache/items/li_2n5go3apektxa6hyc7/Wiseguy.m4b to /home/ubuntu/Internal-HDD/Books/audiobooks/Nicholas Pileggi/Wiseguy/Wiseguy.m4b ### Steps to reproduce the issue 1. Select a book to merge 2. Let process run 3. Merging fails with no indication to the user without checking logs. 4. All .mp3 files are untouched and an m4b file has not been created. ### Audiobookshelf version v2.2.20 ### How are you running audiobookshelf? Debian/PPA
adam added the bug label 2026-04-24 23:33:32 +02:00
adam closed this issue 2026-04-24 23:33:32 +02:00
Author
Owner

@untitled-operator commented on GitHub (May 19, 2023):

I have done an incredible amount of troubleshooting and have a ton of info to post if requested. I'm not extremely experienced, but through gpt 4 I believe I have done all I can do on my end. Let me know what is needed from me at this stage.

Something I have noticed is that the file M4B file is created, the files are backed up to the items cache directory, but nothing is moved over. Both the M4B, and the MP3 files just sit in the directory. Here's a little of what I've done to ensure that permissions aren't the issue. These could be completely off base, just let me know what I can do further.

This is showing my permissions in the audiobookshelf directory

ls -ld /usr/share/audiobookshelf/metadata/cache/items/
drwxr-xr-x 4 audiobookshelf audiobookshelf 4096 May 19 02:11

2. ps aux | grep audiobookshelf
audiobo+    9350  0.8  0.4 908912 73236 ?        Ssl  02:20   0:01 /usr/share/audiobookshelf/audiobookshelf
ubuntu      9401  0.0  0.0  17864  2400 pts/2    S+   02:23   0:00 grep --color=auto audiobookshelf

This is showing a book that isn't working (Please note, that every book fails.) I've shortened this folder name since this command, but I had the same issue.

sudo chmod -R 770 /home/ubuntu/Internal-HDD/Books/
ubuntu@ubuntu-desktop:~$ ls -ld /home/ubuntu/Internal-HDD/Books/audiobooks/
ls -ld /home/ubuntu/Internal-HDD/Books/audiobooks/Forte\ Tiago/
ls -ld /home/ubuntu/Internal-HDD/Books/audiobooks/Forte\ Tiago/Building\ a\ Second\ Brain/
ls -ld /home/ubuntu/Internal-HDD/Books/audiobooks/Forte\ Tiago/Building\ a\ Second\ Brain/Forte\ Tiago\ Building\ a\ Second\ Brain\ A\ Proven\ Method\ \(64kbps\ mp3+pdf\)\ 2022/
drwxrwx---+ 181 ubuntu ubuntu 12288 May  9 15:13 /home/ubuntu/Internal-HDD/Books/audiobooks/
drwxrwx---+ 3 ubuntu ubuntu 4096 May  9 15:03 '/home/ubuntu/Internal-HDD/Books/audiobooks/Forte Tiago/'
drwxrwx---+ 3 ubuntu ubuntu 4096 May  9 15:03 '/home/ubuntu/Internal-HDD/Books/audiobooks/Forte Tiago/Building a Second Brain/'
ls: cannot access '/home/ubuntu/Internal-HDD/Books/audiobooks/Forte Tiago/Building a Second Brain/Forte Tiago Building a Second Brain A Proven Method (64kbps mp3+pdf) 2022/': No such file or directory
@untitled-operator commented on GitHub (May 19, 2023): I have done an incredible amount of troubleshooting and have a ton of info to post if requested. I'm not extremely experienced, but through gpt 4 I believe I have done all I can do on my end. Let me know what is needed from me at this stage. Something I have noticed is that the file M4B file is created, the files are backed up to the items cache directory, but nothing is moved over. Both the M4B, and the MP3 files just sit in the directory. Here's a little of what I've done to ensure that permissions aren't the issue. These could be completely off base, just let me know what I can do further. This is showing my permissions in the audiobookshelf directory ``` ls -ld /usr/share/audiobookshelf/metadata/cache/items/ drwxr-xr-x 4 audiobookshelf audiobookshelf 4096 May 19 02:11 2. ps aux | grep audiobookshelf audiobo+ 9350 0.8 0.4 908912 73236 ? Ssl 02:20 0:01 /usr/share/audiobookshelf/audiobookshelf ubuntu 9401 0.0 0.0 17864 2400 pts/2 S+ 02:23 0:00 grep --color=auto audiobookshelf ``` This is showing a book that isn't working (Please note, that every book fails.) I've shortened this folder name since this command, but I had the same issue. ``` sudo chmod -R 770 /home/ubuntu/Internal-HDD/Books/ ubuntu@ubuntu-desktop:~$ ls -ld /home/ubuntu/Internal-HDD/Books/audiobooks/ ls -ld /home/ubuntu/Internal-HDD/Books/audiobooks/Forte\ Tiago/ ls -ld /home/ubuntu/Internal-HDD/Books/audiobooks/Forte\ Tiago/Building\ a\ Second\ Brain/ ls -ld /home/ubuntu/Internal-HDD/Books/audiobooks/Forte\ Tiago/Building\ a\ Second\ Brain/Forte\ Tiago\ Building\ a\ Second\ Brain\ A\ Proven\ Method\ \(64kbps\ mp3+pdf\)\ 2022/ drwxrwx---+ 181 ubuntu ubuntu 12288 May 9 15:13 /home/ubuntu/Internal-HDD/Books/audiobooks/ drwxrwx---+ 3 ubuntu ubuntu 4096 May 9 15:03 '/home/ubuntu/Internal-HDD/Books/audiobooks/Forte Tiago/' drwxrwx---+ 3 ubuntu ubuntu 4096 May 9 15:03 '/home/ubuntu/Internal-HDD/Books/audiobooks/Forte Tiago/Building a Second Brain/' ls: cannot access '/home/ubuntu/Internal-HDD/Books/audiobooks/Forte Tiago/Building a Second Brain/Forte Tiago Building a Second Brain A Proven Method (64kbps mp3+pdf) 2022/': No such file or directory ```
Author
Owner

@advplyr commented on GitHub (May 19, 2023):

Were you having a conversation with me in Discord yesterday?

@advplyr commented on GitHub (May 19, 2023): Were you having a conversation with me in Discord yesterday?
Author
Owner

@untitled-operator commented on GitHub (May 19, 2023):

No, that wasn't me, but any insight into this issue would be amazing.

@untitled-operator commented on GitHub (May 19, 2023): No, that wasn't me, but any insight into this issue would be amazing.
Author
Owner

@advplyr commented on GitHub (May 19, 2023):

Am I right in seeing the user and group of the file is ubuntu:ubuntu?
The Debian package uses the user and group audibookshelf:audiobookshelf

That user/group must have permissions to those files/folders

@advplyr commented on GitHub (May 19, 2023): Am I right in seeing the user and group of the file is ubuntu:ubuntu? The Debian package uses the user and group audibookshelf:audiobookshelf That user/group must have permissions to those files/folders
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1126