Closed AemonCao closed 1 week ago
You are rate-limited. Unfortunately this is something that happens for unauthenticated API calls to GitHub…
It's a regression caused by: https://github.com/advplyr/audiobookshelf/commit/329e9c9eb211ead325ae15c16e9b6d267d38297c#diff-4699c7a67ec78e60e1158c6809e244b0c927674d0d7fb340e582eae313069aacL9
It changes the https://ffbinaries.com/api/v1
API to GitHub's unauthenticated API, which is rate-limited.
My own curiosity question, why is Audiobookshelf downloading the ffmpeg binary instead of including it in the container image?
I've hit this as well but I'm running on VM. The reason it gets rate limited seems to be because of a loop...
Aug 12 12:33:09 [2024-08-12 12:33:09.413] ERROR: [Binary] Failed to check version of ffmpeg (BinaryManager.js:248)
Aug 12 12:33:09 [2024-08-12 12:33:09.417] INFO: [BinaryManager] ffmpeg not found or version too old
Aug 12 12:33:09 [2024-08-12 12:33:09.420] ERROR: [Binary] Failed to check version of ffprobe (BinaryManager.js:248)
Aug 12 12:33:09 [2024-08-12 12:33:09.423] INFO: [BinaryManager] ffprobe not found or version too old
Aug 12 12:33:09 [2024-08-12 12:33:09.424] INFO: [BinaryManager] Installing binaries: ffmpeg, ffprobe
If I monitor /usr/share/audiobookshelf/ I can it downloading temp.zip and extracting ffmpeg and ffprobe, then it appears to fail the version check deletes the binaries and downloads again. Over and over until you get rate limited and hit the 403. Then you finally get a failed status on the AudioBookshef service.
I have also tried downloading the binaries manually and specifying the path in the config.
downgrading to 2.11 solved the problem
Yeah, thanks wangzhili888. I've already done that too. Just been trying different things to try and narrow it down in case any of the info was helpful.
This is the code throwing the error:
async isGood(binaryPath) {
if (!binaryPath || !(await fs.pathExists(binaryPath))) return false
if (!this.validVersions.length) return true
if (this.type === 'library') return true
try {
const { stdout } = await this.exec('"' + binaryPath + '"' + ' -version')
const version = stdout.match(/version\s([\d\.]+)/)?.[1]
if (!version) return false
return this.validVersions.some((validVersion) => version.startsWith(validVersion))
} catch (err) {
Logger.error(`[Binary] Failed to check version of ${binaryPath}`)
return false
}
}
Which is being called by new Binary('ffmpeg', 'executable', 'FFMPEG_PATH', ['5.1'], ffbinaries)
For the life of me I cannot see why the version check is failing. The response from ffmpeg -version is "ffmpeg version 5.1.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2022 the FFmpeg developers" which should match perfectly.
Only thing I can think of is failing execute access on within the scope of this function. Perhaps passing through the exception would be helpful rather than only returning the custom error message.
--- Edit ---
It was fapolicy (facepalm)
so solution for me was this:
sudo systemctl stop audiobookshelf
sudo chown audiobookshelf:audiobookshelf /usr/share/audiobookshelf/ -R
sudo vi /etc/fapolicyd/rules.d/80-myapps.rules
Add the following lines and save:
allow perm=execute exe=/usr/bin/bash trust=1 : path=/usr/share/audiobookshelf/ffmpeg ftype=application/x-executable trust=0
allow perm=execute exe=/usr/bin/bash trust=1 : path=/usr/share/audiobookshelf/ffprobe ftype=application/x-executable trust=0
sudo systemctl restart fapolicyd
sudo systemctl restart audiobookshelf
Done working on latest 2.12.3
This is updated for the next release already so that docker skips the binary manager step. The binaries are included in the image.
You can use edge
docker image to use it before the next release
Thank you @advplyr ! (And other maintainers)
My own curiosity question, why is Audiobookshelf downloading the ffmpeg binary instead of including it in the container image?
Same thoughts... I do have ffmpeg installed and somehow it sill misses it (but actually tries to unlink it from /usr/bin/ffmpeg ????) EDIT: works fine on 2.11.0... didn't care to check other vers
Fixed in v2.13.0.
What happened?
After updating to versions 2.12.0, 2.12.1, 2.12.2, and 2.12.3, I encountered an issue where the container fails to start. Below is the content of my crash_logs.txt file. Please let me know if you need any additional information.
What did you expect to happen?
The container can start normally.
Steps to reproduce the issue
After encountering the issue described in https://github.com/advplyr/audiobookshelf/issues/3251, I upgraded to version 2.12.2, and the container failed to start properly. I then downgraded to version 2.11.0, which is currently working fine.
Audiobookshelf version
v2.12.x
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