`Firing Error` in a Docker container
matous-volf opened this issue · 4 comments
Songbird version: 0.4.3
Rust version (rustc -V
): 1.80.1
Serenity/Twilight version: Serenity 0.12.2
Output of ffmpeg -version
, yt-dlp --version
(if relevant): yt-dlp 2024.08.06
Description:
I'm running Call::play_only_input()
with a YoutubeDl
source inside a Docker container. In case of interest, the code is here.
This is my Dockerfile (tranzistorak is the bot):
FROM rust:1.80-bullseye AS builder
RUN apt-get update
RUN apt-get install -y cmake
WORKDIR /usr/src/tranzistorak
COPY . .
RUN cargo install --path .
FROM debian:bullseye-slim AS runner
RUN apt-get update
RUN apt-get install -y python3-pip
RUN python3 -m pip install -U yt-dlp
RUN apt-get install -y libopus-dev
COPY --from=builder /usr/local/cargo/bin/tranzistorak /usr/local/bin/tranzistorak
COPY ./.env /usr/local/bin/.env
WORKDIR /usr/local/bin
CMD ["tranzistorak"]
When I build the image and run a container locally (Arch Linux), it works as expected with no problems:
INFO start:start_connection{start_shard=0 end_shard=0 total_shards=1}:initialize:boot{shard_info=[ShardId(0), ShardId(1)]}: serenity::gateway::bridge::shard_manager: Telling shard queuer to start shard 0
INFO run: serenity::gateway::bridge::shard_runner: [ShardRunner ShardInfo { id: ShardId(0), total: 1 }] Running
INFO runner{config=Config { crypto_mode: Normal, gateway_timeout: Some(10s), mix_mode: Stereo, preallocated_tracks: 1, driver_retry: Retry { strategy: Backoff(ExponentialBackoff { min: 250ms, max: 10s, jitter: 0.1 }), retry_limit: Some(5) }, use_softclip: true, driver_timeout: Some(10s), disposer: Some(DisposalThread(Sender)), scheduler: None }}: songbird::driver::connection: Connected to: frankfurt9728.discord.media:443
INFO runner{config=Config { crypto_mode: Normal, gateway_timeout: Some(10s), mix_mode: Stereo, preallocated_tracks: 1, driver_retry: Retry { strategy: Backoff(ExponentialBackoff { min: 250ms, max: 10s, jitter: 0.1 }), retry_limit: Some(5) }, use_softclip: true, driver_timeout: Some(10s), disposer: Some(DisposalThread(Sender)), scheduler: None }}: songbird::driver::connection: WS heartbeat duration 13750ms.
INFO runner: songbird::driver::tasks::events: Global event added.
INFO runner: songbird::driver::tasks::events: Global event added.
INFO runner: songbird::driver::tasks::events: Event state for all tracks removed.
INFO runner: songbird::driver::tasks::events: Event state for all tracks removed.
INFO runner: songbird::driver::tasks::events: Event state for track 1 added
INFO runner:run{interconnect=Interconnect { core: Sender, events: Sender, mixer: Sender }}: songbird::driver::tasks::ws: Changing to SpeakingState(MICROPHONE)
INFO runner: songbird::events::store: Firing Preparing for [0]
INFO symphonia_core::probe: found the format marker [1a, 45, df, a3] @ 0+2 bytes.
INFO runner: songbird::events::store: Firing Playable for [0]
INFO runner: songbird::events::store: Firing End for [0]
INFO runner: songbird::driver::tasks::events: Event state for track 0 of 1 removed.
INFO runner:run{interconnect=Interconnect { core: Sender, events: Sender, mixer: Sender }}: songbird::driver::tasks::ws: Changing to SpeakingState(0x0)
When I do the same (build and run a container) in a different environment (a VPS with Debian), there is an error:
INFO start:start_connection{start_shard=0 end_shard=0 total_shards=1}:initialize:boot{shard_info=[ShardId(0), ShardId(1)]}: serenity::gateway::bridge::shard_manager: Telling shard queuer to start shard 0
INFO run: serenity::gateway::bridge::shard_runner: [ShardRunner ShardInfo { id: ShardId(0), total: 1 }] Running
INFO runner{config=Config { crypto_mode: Normal, gateway_timeout: Some(10s), mix_mode: Stereo, preallocated_tracks: 1, driver_retry: Retry { strategy: Backoff(ExponentialBackoff { min: 250ms, max: 10s, jitter: 0.1 }), retry_limit: Some(5) }, use_softclip: true, driver_timeout: Some(10s), disposer: Some(DisposalThread(Sender)), scheduler: None }}: songbird::driver::connection: Connected to: frankfurt9728.discord.media:443
INFO runner{config=Config { crypto_mode: Normal, gateway_timeout: Some(10s), mix_mode: Stereo, preallocated_tracks: 1, driver_retry: Retry { strategy: Backoff(ExponentialBackoff { min: 250ms, max: 10s, jitter: 0.1 }), retry_limit: Some(5) }, use_softclip: true, driver_timeout: Some(10s), disposer: Some(DisposalThread(Sender)), scheduler: None }}: songbird::driver::connection: WS heartbeat duration 13750ms.
INFO runner: songbird::driver::tasks::events: Global event added.
INFO runner: songbird::driver::tasks::events: Global event added.
INFO runner:run{interconnect=Interconnect { core: Sender, events: Sender, mixer: Sender }}: songbird::driver::tasks::ws: Changing to SpeakingState(MICROPHONE)
INFO runner: songbird::driver::tasks::events: Event state for all tracks removed.
INFO runner: songbird::driver::tasks::events: Event state for all tracks removed.
INFO runner: songbird::driver::tasks::events: Event state for track 1 added
INFO runner: songbird::events::store: Firing Preparing for [0]
INFO runner: songbird::events::store: Firing End for [0]
INFO runner: songbird::events::store: Firing Error for [0]
INFO runner: songbird::driver::tasks::events: Event state for track 0 of 1 removed.
INFO runner:run{interconnect=Interconnect { core: Sender, events: Sender, mixer: Sender }}: songbird::driver::tasks::ws: Changing to SpeakingState(0x0)
I even tried not building the image on the VPS and rather copying the local one – no difference. For me, this is really unexpected, weird and maybe more of a Docker issue.
Still, please, is there a way to enable more logging? How to find out what is going on? My guess is some dependencies could be missing. Or is it possible that it is caused by the performance difference between my PC and the VPS?
Steps to reproduce:
Run Call::play_only_input()
with a YoutubeDl
in a container built from the mentioned Dockerfile.
I've just tried this with a File
instead of a YoutubeDl
and the result is the same.
I have also tried to run it on another PC and there is a new line in the logs:
ERROR symphonia_core::probe: reached probe limit of 1048576 bytes.
just above the Firing Error
line.
That error message implies that songbird/symphonia has no idea how to parse whatever you were served from the URL you supplied -- either you're missing a codec, or the link was not actually valid. What website were you querying, and what codecs do you have enabled?
I'm playing a YouTube video through a regular link, e.g. https://www.youtube.com/watch?v=7T_YtklLyyo.
You were right – a codec was probably missing – enabling all of them in Symphonia with
[dependencies.symphonia]
version = "0.5.4"
features = ["all"]
solves the new error line that appeared on the second PC:
I have also tried to run it on another PC and there is a new line in the logs:
ERROR symphonia_core::probe: reached probe limit of 1048576 bytes.
just above the
Firing Error
line.
And on the second PC everything is now working.
Running it on the VPS results in the same log as before, though:
... INFO runner:run{interconnect=Interconnect { core: Sender, events: Sender, mixer: Sender }}: songbird::driver::tasks::ws: Changing to SpeakingState(MICROPHONE) INFO runner: songbird::driver::tasks::events: Event state for all tracks removed. INFO runner: songbird::driver::tasks::events: Event state for all tracks removed. INFO runner: songbird::driver::tasks::events: Event state for track 1 added INFO runner: songbird::events::store: Firing Preparing for [0] INFO runner: songbird::events::store: Firing End for [0] INFO runner: songbird::events::store: Firing Error for [0] INFO runner: songbird::driver::tasks::events: Event state for track 0 of 1 removed. INFO runner:run{interconnect=Interconnect { core: Sender, events: Sender, mixer: Sender }}: songbird::driver::tasks::ws: Changing to SpeakingState(0x0)