mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-02 22:46:56 -05:00
[Bug]: Server crash on downloading episodes with big names #817
Labels
No labels
authentication
awaiting release
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/audiobookshelf#817
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kirillmukhin on GitHub (Dec 10, 2022).
Describe the issue
Server crashes when attempting to download a podcast episode with a long (cyrillic) title.
From what I understood Javascript is using UTF-16 encoding and, after a few tests, I am assuming that crash happens if name's size exceeds 256 bytes (I was using online calculator to determine string sizes):
Steps to reproduce the issue
Audiobookshelf version
v2.2.8
How are you running audiobookshelf?
Docker
@advplyr commented on GitHub (Dec 10, 2022):
Can you see what the error message is during the crash?
I just tested this with the longest one and it is not crashing for me. My guess is that the file system you are using is reaching a max file name length.
Abs will crop the filename if it exceeds 240 characters but none of these do.
@kirillmukhin commented on GitHub (Dec 11, 2022):
Log
Pod log from TrueNAS Scale
I got my brain working a bit better and tried to download episodes and place them manually. That did not work.
Trying to get latest episode with youtube-dl gives
ERROR: unable to open for writing: [Errno 36] File name too long.Error happens both on TrueNAS Scale server with zfs file system, where auidobookshelf is running, and on local Linux distribution with ext4 filesystem.
KDE Kasts was able to get the episode as it renames them to seemingly random strings of latin characters and numbers. The file I got was named
e5996abf273afa838bf5cffc1cba4b28, so I tried to rename the episode to the full original name gave following:Then I truncated the cyrillic string until the error disappears, which happened here:
Original string (with '.mp3' extension) has 172 individual characters (graphemes) and takes 322 bytes in UTF-8 encoding.
Truncated string (with '.mp3' extension) has 136 individual characters and takes 255 bytes in UTF-8.
As far as I understand, non-latin characters take more space, therefore they may cause this problem before reaching 240 characters count.
From Wikipedia:
So if people will start making podcasts episodes with titles made exclusively out of emojis - big trouble.
@advplyr commented on GitHub (Dec 13, 2022):
I updated the script to keep the filename under 255 bytes. I think this should cover it for a while even though Windows file system does allow for longer.
@advplyr commented on GitHub (Dec 18, 2022):
Fixed in v2.2.9