Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firing Error in a Docker container #245

Open
matous-volf opened this issue Aug 10, 2024 · 4 comments
Open

Firing Error in a Docker container #245

matous-volf opened this issue Aug 10, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@matous-volf
Copy link

matous-volf commented Aug 10, 2024

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.

@matous-volf matous-volf added the bug Something isn't working label Aug 10, 2024
@matous-volf
Copy link
Author

I've just tried this with a File instead of a YoutubeDl and the result is the same.

@matous-volf
Copy link
Author

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.

@FelixMcFelix
Copy link
Member

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?

@matous-volf
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants