[Bug]: Server fails to start after successful build on *BSD #1812

Closed
opened 2026-04-24 23:58:50 +02:00 by adam · 12 comments
Owner

Originally created by @moozhub on GitHub (Mar 14, 2024).

Describe the issue

Server fails to start when trying to find ffmpeg / ffprobe and / or attempting to grab static ffmpeg.

dev.js:

// Using port 3333 is important when running the client web app separately
const Path = require('path')
module.exports.config = {
   Port: 3333,
   ConfigPath: Path.resolve('config'),
   MetadataPath: Path.resolve('metadata'),
   FFmpegPath: '/usr/local/bin/ffmpeg',
   FFProbePath: '/usr/local/bin/ffprobe'
}

npm run dev:

[root@audiobookshelf ~/audiobookshelf]# npm run dev
> audiobookshelf@2.8.0 dev
> nodemon --watch server index.js
[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): server/**/*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node index.js`
Config /root/audiobookshelf/config /root/audiobookshelf/metadata
[2024-03-14 01:37:41.708] INFO: === Starting Server ===
[2024-03-14 01:37:41.712] INFO: [Server] Init v2.8.0
[2024-03-14 01:37:41.716] INFO: [Database] Initializing db at "/root/audiobookshelf/config/absdatabase.sqlite"
[2024-03-14 01:37:41.765] INFO: [Database] Db connection was successful
[2024-03-14 01:37:41.935] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting, customMetadataProvider
[2024-03-14 01:37:41.964] DEBUG: Daily Log file found 2024-03-14.txt (LogManager.js:94)
[2024-03-14 01:37:41.965] INFO: [LogManager] Init current daily log filename: 2024-03-14.txt
[2024-03-14 01:37:41.965] DEBUG: [LogManager] Daily log file already exists - set in Logger (LogManager.js:71)
[2024-03-14 01:37:41.969] DEBUG: [DailyLog] 2024-03-14: Loaded 104 Logs (DailyLog.js:132)
[2024-03-14 01:37:41.977] INFO: [BackupManager] 0 Backups Found
[2024-03-14 01:37:41.978] INFO: [BackupManager] Auto Backups are disabled
[2024-03-14 01:37:42.091] INFO: [BinaryManager] ffmpeg not found or version too old
[2024-03-14 01:37:42.189] INFO: [BinaryManager] ffprobe not found or version too old
[2024-03-14 01:37:42.194] INFO: [BinaryManager] Installing binaries: ffmpeg, ffprobe
[2024-03-14 01:37:42.345] FATAL: [Server] Unhandled rejection: Error: No URLs!, promise: Promise {
    <rejected> Error: No URLs!
        at Object.downloadBinaries (/root/audiobookshelf/server/libs/ffbinaries/index.js:301:11)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async BinaryManager.install (/root/audiobookshelf/server/managers/BinaryManager.js:138:5)
        at async BinaryManager.init (/root/audiobookshelf/server/managers/BinaryManager.js:31:5)
        at async Server.init (/root/audiobookshelf/server/Server.js:126:7)
        at async Server.start (/root/audiobookshelf/server/Server.js:172:5)
} (Server.js:164)
[nodemon] app crashed - waiting for file changes before starting...

ffmpeg:

[root@audiobookshelf ~/audiobookshelf]# which ffmpeg
/usr/local/bin/ffmpeg
[root@audiobookshelf ~/audiobookshelf]# ffmpeg -version
ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
built with FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --docdir=/usr/local/share/doc/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --disable-static --disable-libcelt --enable-shared --enable-pic --enable-gpl --cc=cc --cxx=c++ --disable-alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --enable-libaom --disable-libaribb24 --disable-libaribcaption --enable-asm --enable-libass --disable-libbs2b --disable-libcaca --disable-libcdio --disable-libcodec2 --enable-libdav1d --disable-libdavs2 --disable-libdc1394 --disable-debug --enable-htmlpages --enable-libdrm --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --disable-libfribidi --disable-gcrypt --disable-libglslang --disable-libgme --enable-gmp --enable-gnutls --enable-version3 --disable-libgsm --enable-libharfbuzz --enable-iconv --disable-libilbc --disable-libjack --enable-libjxl --disable-libklvanc --disable-libkvazaar --disable-ladspa --enable-libmp3lame --enable-lcms2 --disable-liblensfun --disable-libbluray --enable-libplacebo --disable-librsvg --disable-librtmp --enable-libxml2 --disable-lv2 --disable-mbedtls --disable-libmfx --disable-libmodplug --disable-libmysofa --enable-network --disable-nonfree --enable-nvenc --disable-openal --disable-opencl --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --disable-libopenvino --enable-optimizations --enable-libopus --disable-pocketsphinx --disable-libpulse --disable-librabbitmq --disable-librav1e --disable-librist --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --enable-libshaderc --disable-libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-libspeex --disable-libsrt --disable-libssh --enable-libsvtav1 --disable-libtensorflow --disable-libtesseract --disable-lib

Steps to reproduce the issue

  1. Configure system as described in Readme
  2. Build using described method in Readme
  3. Attempt to start server
  4. Observe errors

Audiobookshelf version

v2.8.0

How are you running audiobookshelf?

Built from source

Originally created by @moozhub on GitHub (Mar 14, 2024). ### Describe the issue Server fails to start when trying to find ffmpeg / ffprobe and / or attempting to grab static ffmpeg. dev.js: ``` // Using port 3333 is important when running the client web app separately const Path = require('path') module.exports.config = { Port: 3333, ConfigPath: Path.resolve('config'), MetadataPath: Path.resolve('metadata'), FFmpegPath: '/usr/local/bin/ffmpeg', FFProbePath: '/usr/local/bin/ffprobe' } ``` npm run dev: ``` [root@audiobookshelf ~/audiobookshelf]# npm run dev > audiobookshelf@2.8.0 dev > nodemon --watch server index.js [nodemon] 2.0.22 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): server/**/* [nodemon] watching extensions: js,mjs,json [nodemon] starting `node index.js` Config /root/audiobookshelf/config /root/audiobookshelf/metadata [2024-03-14 01:37:41.708] INFO: === Starting Server === [2024-03-14 01:37:41.712] INFO: [Server] Init v2.8.0 [2024-03-14 01:37:41.716] INFO: [Database] Initializing db at "/root/audiobookshelf/config/absdatabase.sqlite" [2024-03-14 01:37:41.765] INFO: [Database] Db connection was successful [2024-03-14 01:37:41.935] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting, customMetadataProvider [2024-03-14 01:37:41.964] DEBUG: Daily Log file found 2024-03-14.txt (LogManager.js:94) [2024-03-14 01:37:41.965] INFO: [LogManager] Init current daily log filename: 2024-03-14.txt [2024-03-14 01:37:41.965] DEBUG: [LogManager] Daily log file already exists - set in Logger (LogManager.js:71) [2024-03-14 01:37:41.969] DEBUG: [DailyLog] 2024-03-14: Loaded 104 Logs (DailyLog.js:132) [2024-03-14 01:37:41.977] INFO: [BackupManager] 0 Backups Found [2024-03-14 01:37:41.978] INFO: [BackupManager] Auto Backups are disabled [2024-03-14 01:37:42.091] INFO: [BinaryManager] ffmpeg not found or version too old [2024-03-14 01:37:42.189] INFO: [BinaryManager] ffprobe not found or version too old [2024-03-14 01:37:42.194] INFO: [BinaryManager] Installing binaries: ffmpeg, ffprobe [2024-03-14 01:37:42.345] FATAL: [Server] Unhandled rejection: Error: No URLs!, promise: Promise { <rejected> Error: No URLs! at Object.downloadBinaries (/root/audiobookshelf/server/libs/ffbinaries/index.js:301:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async BinaryManager.install (/root/audiobookshelf/server/managers/BinaryManager.js:138:5) at async BinaryManager.init (/root/audiobookshelf/server/managers/BinaryManager.js:31:5) at async Server.init (/root/audiobookshelf/server/Server.js:126:7) at async Server.start (/root/audiobookshelf/server/Server.js:172:5) } (Server.js:164) [nodemon] app crashed - waiting for file changes before starting... ``` ffmpeg: ``` [root@audiobookshelf ~/audiobookshelf]# which ffmpeg /usr/local/bin/ffmpeg [root@audiobookshelf ~/audiobookshelf]# ffmpeg -version ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers built with FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152) configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --docdir=/usr/local/share/doc/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --disable-static --disable-libcelt --enable-shared --enable-pic --enable-gpl --cc=cc --cxx=c++ --disable-alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --enable-libaom --disable-libaribb24 --disable-libaribcaption --enable-asm --enable-libass --disable-libbs2b --disable-libcaca --disable-libcdio --disable-libcodec2 --enable-libdav1d --disable-libdavs2 --disable-libdc1394 --disable-debug --enable-htmlpages --enable-libdrm --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --disable-libfribidi --disable-gcrypt --disable-libglslang --disable-libgme --enable-gmp --enable-gnutls --enable-version3 --disable-libgsm --enable-libharfbuzz --enable-iconv --disable-libilbc --disable-libjack --enable-libjxl --disable-libklvanc --disable-libkvazaar --disable-ladspa --enable-libmp3lame --enable-lcms2 --disable-liblensfun --disable-libbluray --enable-libplacebo --disable-librsvg --disable-librtmp --enable-libxml2 --disable-lv2 --disable-mbedtls --disable-libmfx --disable-libmodplug --disable-libmysofa --enable-network --disable-nonfree --enable-nvenc --disable-openal --disable-opencl --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --disable-libopenvino --enable-optimizations --enable-libopus --disable-pocketsphinx --disable-libpulse --disable-librabbitmq --disable-librav1e --disable-librist --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --enable-libshaderc --disable-libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-libspeex --disable-libsrt --disable-libssh --enable-libsvtav1 --disable-libtensorflow --disable-libtesseract --disable-lib ``` ### Steps to reproduce the issue 1. Configure system as described in Readme 2. Build using described method in Readme 3. Attempt to start server 4. Observe errors ### Audiobookshelf version v2.8.0 ### How are you running audiobookshelf? Built from source
adam added the bug label 2026-04-24 23:58:50 +02:00
adam closed this issue 2026-04-24 23:58:51 +02:00
Author
Owner

@nichwall commented on GitHub (Mar 14, 2024):

Do you have an IPv4 address? It may be related to https://github.com/advplyr/audiobookshelf/issues/2151

@nichwall commented on GitHub (Mar 14, 2024): Do you have an IPv4 address? It may be related to https://github.com/advplyr/audiobookshelf/issues/2151
Author
Owner

@advplyr commented on GitHub (Mar 14, 2024):

The binary manager is making a request to https://ffbinaries.com/api/v1 that returns the URLs to the available ffmpeg binaries. The error you are seeing suggests that the request is not able to be made. Make sure that the request can be made

@advplyr commented on GitHub (Mar 14, 2024): The binary manager is making a request to `https://ffbinaries.com/api/v1` that returns the URLs to the available ffmpeg binaries. The error you are seeing suggests that the request is not able to be made. Make sure that the request can be made
Author
Owner

@moozhub commented on GitHub (Mar 14, 2024):

IPv4 only.

@advplyr

Yeah I can grab the URL, dumb question maybe but why is it trying to grab a precompiled binary when I'm defining where ffmpeg is already installed in dev.js?

[root@audiobookshelf ~]# curl https://ffbinaries.com/api/v1
{"versions":{"latest":"https://ffbinaries.com/api/v1/version/latest","3.2":"https://ffbinaries.com/api/v1/version/3.2","3.3":"https://ffbinaries.com/api/v1/version/3.3","3.4":"https://ffbinaries.com/api/v1/version/3.4","4.0":"https://ffbinaries.com/api/v1/version/4.0","4.1":"https://ffbinaries.com/api/v1/version/4.1","4.2":"https://ffbinaries.com/api/v1/version/4.2","4.2.1":"https://ffbinaries.com/api/v1/version/4.2.1","4.4.1":"https://ffbinaries.com/api/v1/version/4.4.1","5.1":"https://ffbinaries.com/api/v1/version/5.1","6.1":"https://ffbinaries.com/api/v1/version/6.1"}}

If it makes any difference most installed binaries for BSD are in /usr/local/bin, is there a static variable assigned to /usr/bin somewhere?

@moozhub commented on GitHub (Mar 14, 2024): IPv4 only. @advplyr Yeah I can grab the URL, dumb question maybe but why is it trying to grab a precompiled binary when I'm defining where ffmpeg is already installed in dev.js? ``` [root@audiobookshelf ~]# curl https://ffbinaries.com/api/v1 {"versions":{"latest":"https://ffbinaries.com/api/v1/version/latest","3.2":"https://ffbinaries.com/api/v1/version/3.2","3.3":"https://ffbinaries.com/api/v1/version/3.3","3.4":"https://ffbinaries.com/api/v1/version/3.4","4.0":"https://ffbinaries.com/api/v1/version/4.0","4.1":"https://ffbinaries.com/api/v1/version/4.1","4.2":"https://ffbinaries.com/api/v1/version/4.2","4.2.1":"https://ffbinaries.com/api/v1/version/4.2.1","4.4.1":"https://ffbinaries.com/api/v1/version/4.4.1","5.1":"https://ffbinaries.com/api/v1/version/5.1","6.1":"https://ffbinaries.com/api/v1/version/6.1"}} ``` If it makes any difference most installed binaries for BSD are in /usr/local/bin, is there a static variable assigned to /usr/bin somewhere?
Author
Owner

@advplyr commented on GitHub (Mar 14, 2024):

Most likely because the version you have installed isn't v5.1

https://github.com/advplyr/audiobookshelf/blob/e6c21c5be170b2749834231cfd59590d33f050a5/server/managers/BinaryManager.js#L92-L107

If you want to workaround it without further debugging on why that request is not successful you could download ffmpeg/ffprobe v5.1 from the link and set it FFMPEG_PATH env vars.

@advplyr commented on GitHub (Mar 14, 2024): Most likely because the version you have installed isn't v5.1 https://github.com/advplyr/audiobookshelf/blob/e6c21c5be170b2749834231cfd59590d33f050a5/server/managers/BinaryManager.js#L92-L107 If you want to workaround it without further debugging on why that request is not successful you could download ffmpeg/ffprobe v5.1 from the link and set it FFMPEG_PATH env vars.
Author
Owner

@moozhub commented on GitHub (Mar 14, 2024):

I see.. it indeed isn't, it's 6.1.1. Is 5.1 a requirement?

I can give the environment variable a try, but trying to understand why it would be failing, is it a tool in node trying to make the request or is it trying to use wget/curl/something?

@moozhub commented on GitHub (Mar 14, 2024): I see.. it indeed isn't, it's 6.1.1. Is 5.1 a requirement? I can give the environment variable a try, but trying to understand why it would be failing, is it a tool in node trying to make the request or is it trying to use wget/curl/something?
Author
Owner

@advplyr commented on GitHub (Mar 14, 2024):

5.1 is a requirement right now until we figure out why 6.1 is failing to ffprobe some mp3 files.

The request is made with axios here:

https://github.com/advplyr/audiobookshelf/blob/e6c21c5be170b2749834231cfd59590d33f050a5/server/libs/ffbinaries/index.js#L141-L165

You will get a better error message by adding a console.log like this:

  return axios.get(`${API_URL}${url}`).then((res) => {
    RUNTIME_CACHE[version] = res.data
    return res.data
  }).catch((error) => {
  console.log('ffbinaries error:', error)
    if (error.response?.status == 404) {
      throw new Error(errorMsgs.notFound)
    } else {
      throw new Error(errorMsgs.connectionIssues)
    }
  })

I can update that to log better, this issue hasn't come up before

@advplyr commented on GitHub (Mar 14, 2024): 5.1 is a requirement right now until we figure out why 6.1 is failing to ffprobe some mp3 files. The request is made with axios here: https://github.com/advplyr/audiobookshelf/blob/e6c21c5be170b2749834231cfd59590d33f050a5/server/libs/ffbinaries/index.js#L141-L165 You will get a better error message by adding a console.log like this: ```js return axios.get(`${API_URL}${url}`).then((res) => { RUNTIME_CACHE[version] = res.data return res.data }).catch((error) => { console.log('ffbinaries error:', error) if (error.response?.status == 404) { throw new Error(errorMsgs.notFound) } else { throw new Error(errorMsgs.connectionIssues) } }) ``` I can update that to log better, this issue hasn't come up before
Author
Owner

@moozhub commented on GitHub (Mar 14, 2024):

Assuming I don't have to recompile anything (I reran the steps in the wiki to recompile anyway), adding the console.log line into that file doesn't appear to be logging anything extra to console.log.

@moozhub commented on GitHub (Mar 14, 2024): Assuming I don't have to recompile anything (I reran the steps in the wiki to recompile anyway), adding the console.log line into that file doesn't appear to be logging anything extra to console.log.
Author
Owner

@moozhub commented on GitHub (Mar 14, 2024):

Also would like to point out, that even if the binary were able to be downloaded, that the binaries that are included on that website don't compile binaries for BSD, so unless I was using Linux compatibility or something (I don't, since this is a jail), trying to execute the binary it would have downloaded would fail anyway.

In the pkg tree, the only available way outside recompiling ffmpeg to match the 5.1 version, is to either use v4 (specifically ffmpeg4-4.4.4_9) or v6 in 14.0-RELEASE version of FreeBSD.

@moozhub commented on GitHub (Mar 14, 2024): Also would like to point out, that even if the binary were able to be downloaded, that the binaries that are included on that website don't compile binaries for BSD, so unless I was using Linux compatibility or something (I don't, since this is a jail), trying to execute the binary it would have downloaded would fail anyway. In the pkg tree, the only available way outside recompiling ffmpeg to match the 5.1 version, is to either use v4 (specifically ffmpeg4-4.4.4_9) or v6 in 14.0-RELEASE version of FreeBSD.
Author
Owner

@advplyr commented on GitHub (Mar 14, 2024):

Ah okay I understand, thanks for explaining. In this case it makes sense to add an additional env variable to allow for skipping the binaries check process.

I updated the sample dev.js to include this new flag. Set to true to skip it.

https://github.com/advplyr/audiobookshelf/blob/5fcd23409ab10738359d0b1d6790e5cd78d5aa9e/.devcontainer/dev.js#L3-L10

Or manually set the environment variable SKIP_BINARIES_CHECK to "1" before running the node server.

Let me know if that works for you

@advplyr commented on GitHub (Mar 14, 2024): Ah okay I understand, thanks for explaining. In this case it makes sense to add an additional env variable to allow for skipping the binaries check process. I updated the sample dev.js to include this new flag. Set to true to skip it. https://github.com/advplyr/audiobookshelf/blob/5fcd23409ab10738359d0b1d6790e5cd78d5aa9e/.devcontainer/dev.js#L3-L10 Or manually set the environment variable SKIP_BINARIES_CHECK to "1" before running the node server. Let me know if that works for you
Author
Owner

@moozhub commented on GitHub (Mar 14, 2024):

Yep that worked, compiled started and logged in. Thanks for all the prompt replies. Not sure if I'll run into the ffmpeg bug on BSD using 6.1, but if I do I'll post a new bug. Appreciate it.

@moozhub commented on GitHub (Mar 14, 2024): Yep that worked, compiled started and logged in. Thanks for all the prompt replies. Not sure if I'll run into the ffmpeg bug on BSD using 6.1, but if I do I'll post a new bug. Appreciate it.
Author
Owner

@advplyr commented on GitHub (Mar 14, 2024):

The specific issue that was hit with 6.1 is here https://github.com/advplyr/audiobookshelf/issues/2689

You can add to that one if you hit it

@advplyr commented on GitHub (Mar 14, 2024): The specific issue that was hit with 6.1 is here https://github.com/advplyr/audiobookshelf/issues/2689 You can add to that one if you hit it
Author
Owner

@advplyr commented on GitHub (Mar 17, 2024):

Updated in v2.8.1

@advplyr commented on GitHub (Mar 17, 2024): Updated in [v2.8.1](https://github.com/advplyr/audiobookshelf/releases/tag/v2.8.1)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1812