muse icon indicating copy to clipboard operation
muse copied to clipboard

Unable to play any songs

Open MintyFreshers opened this issue 1 year ago • 9 comments

What's happening? I am currently getting an error when trying to play any songs, the bot says "ope: No playing song found".

Logs

 +0ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +6ms
  prisma:client  Prisma Client call: +6ms
  prisma:client  prisma.fileCache.findUnique({
  where: {
    hash: 'afd225007a8561b11ff551d42cd062fead6b66e44d920fc0b2f6a45c37871fce1b7539264a0409f3076aa27ecffb54de11d2466a86c939714632e50c9d55c7ae'
  }
}) +0ms
  prisma:client  Generated request: +0ms
  prisma:client  query {
  findUniqueFileCache(where: {
    hash: "afd225007a8561b11ff551d42cd062fead6b66e44d920fc0b2f6a45c37871fce1b7539264a0409f3076aa27ecffb54de11d2466a86c939714632e50c9d55c7ae"
  }) {
    hash
    bytes
    accessedAt
    createdAt
    updatedAt
  }
}
 +0ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +6ms
  muse [VOICE] received voice state update: {"member":{"user":{"username":"SwoftBot","public_flags":0,"id":"985127745015128084","global_name":null,"display_name":null,"discriminator":"3140","clan":null,"bot":true,"avatar_decoration_data":null,"avatar":"9eb046c7d270f2fa7e83394af0e2b30c"},"roles":["987505496963555339"],"premium_since":null,"pending":false,"nick":null,"mute":false,"joined_at":"2022-06-17T23:54:17.468000+00:00","flags":0,"deaf":false,"communication_disabled_until":null,"avatar":null},"user_id":"985127745015128084","suppress":false,"session_id":"b8c909325b5757be574d3d2486b4988a","self_video":false,"self_mute":false,"self_deaf":true,"request_to_speak_timestamp":null,"mute":false,"guild_id":"136921565056073728","deaf":false,"channel_id":"505091962995474446"} +109ms
  prisma:client  Prisma Client call: +101ms
  prisma:client  prisma.setting.findUnique({
  where: {
    guildId: '136921565056073728'
  }
}) +1ms
  prisma:client  Generated request: +0ms
  prisma:client  query {
  findUniqueSetting(where: {
    guildId: "136921565056073728"
  }) {
    guildId
    playlistLimit
    secondsToWaitAfterQueueEmpties
    leaveIfNoListeners
    queueAddResponseEphemeral
    autoAnnounceNextSong
    defaultVolume
    createdAt
    updatedAt
  }
}
 +0ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +103ms
  muse [VOICE] received voice server: {"t":"VOICE_SERVER_UPDATE","s":8,"op":0,"d":{"token":"621e7999a1fccdaa","guild_id":"136921565056073728","endpoint":"us-east7654.discord.media:443"}} +25ms
  prisma:client  Prisma Client call: +1s
  prisma:client  prisma.setting.findUnique({
  where: {
    guildId: '136921565056073728'
  }
}) +0ms
  prisma:client  Generated request: +1ms
  prisma:client  query {
  findUniqueSetting(where: {
    guildId: "136921565056073728"
  }) {
    guildId
    playlistLimit
    secondsToWaitAfterQueueEmpties
    leaveIfNoListeners
    queueAddResponseEphemeral
    autoAnnounceNextSong
    defaultVolume
    createdAt
    updatedAt
  }
}
 +0ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +1s
  muse Rick Astley - Never Gonna Give You Up (Official Music Video) is unavailable +1s
  muse Error: No playing song found
  muse     at buildPlayingMessageEmbed (file:///opt/bot/src/utils/build-embed.ts:1:1533)
  muse     at AddQueryToQueue.addToQueue (file:///opt/bot/src/services/add-query-to-queue.ts:1:3628)
  muse     at async play_default.execute (file:///opt/bot/src/commands/play.ts:1:1604)
  muse     at async Client.<anonymous> (file:///opt/bot/src/bot.ts:1:2354) +1ms

Screenshots image

Runtime I'm running Muse:

  • [x] Directly from the cloned repository
  • [ ] Inside a Docker container
  • [ ] Something else (please elaborate)

Versions

  • Muse: v2.8.1
  • Docker (if applicable): N/A
  • OS: Debian GNU/Linux 12
  • Node.js: v18.19.0
  • ffmpeg: ffmpeg version 5.1.4-0+deb12u1

MintyFreshers avatar Jun 13 '24 21:06 MintyFreshers

Same issue, even with dockerized environment. Sometimes the bot joins and tells that the song is playing, but it isn't. (even with /nowplaying it says there aren't any songs playing)

im-trisha avatar Jun 14 '24 12:06 im-trisha

Same thing here, also running in a docker container. What I found is that some youtube videos actually do play, like Rick Astleys Never gonna give you up, when using the autocomplete feature and selecting the Spotify result:

query: spotify:track:4PTG3Z6ehGkBFwjybzWkR8

Though the youtube query also works for this song:

query: https://www.youtube.com/watch?v=dQw4w9WgXcQ

However for example "Never Gonna Stop" also from Rick Astley, doesn't work and gives the result as stated by the issue:

query: https://www.youtube.com/watch?v=qWNQUvIk954 or query: spotify:track:7koIUHBD4AZoEP8Wuu9xQf

DrNefarius avatar Jun 14 '24 14:06 DrNefarius

I am getting the same thing and I just started using the project with the dockerized container. The bot comes in muted on spotify as well.

Edit: ah I think youtube is throttling certain ips. is everyone running on a vps?

bu3alwa avatar Jun 16 '24 00:06 bu3alwa

@bu3alwa Yes I am, however, this is not the problem I think, because in the google cloud console the API requests are successful, so it'd have no sense to be a youtube's problem

im-trisha avatar Jun 16 '24 12:06 im-trisha

@bu3alwa Yes I am, however, this is not the problem I think, because in the google cloud console the API requests are successful, so it'd have no sense to be a youtube's problem

I was ablw to get it to work locally but not on vps. Same docker container. So my assumption is some sort of limiting.

Are you able to try your bot locally and see if it works vs on a vps?

bu3alwa avatar Jun 16 '24 16:06 bu3alwa

I also faced this issue when deployed bot to my new VPS. But when I instead deployed it on my local server it worked fine.

MindHardt avatar Jun 19 '24 15:06 MindHardt

I have it deployed locally and it's running into this issue

burntcookie90 avatar Jun 25 '24 11:06 burntcookie90

Mine started working on vps after I stopped it for a while. For my case I am pretty sure it was throttling from youtubes side on my ip.

bu3alwa avatar Jun 25 '24 21:06 bu3alwa

@bu3alwa mine still doesn't work.

im-trisha avatar Jun 30 '24 13:06 im-trisha

I'm running into a similar issue (Docker container) where after working just fine, it suddenly stopped working and while you can add songs, they do not play and the queue/now-playing say they are empty

lone-dancer avatar Jul 09 '24 21:07 lone-dancer

Same issue here. I was using a docker container and had the bot up and running for over a year - not a single issue. Now this :l image Now it queues up , the bot joins the channel but never plays it

xxtensazenxx avatar Jul 10 '24 03:07 xxtensazenxx

With a quick glance at the code, it seems that the problem is what it appears to be, the song isn't queue'd:

await player.play();

if (wasPlayingSong) {
  statusMsg = 'resuming playback';
}

await interaction.editReply({
  embeds: [buildPlayingMessageEmbed(player)],
});

Here, player.play runs the function this.getCurrent() successfully and finds a song, or else he'd be the one throwing the error (See here)

But right after, buildPlayingMessageEmbed throws "No playing sound found" (See here).

At least, it seems to be like this. I don't have a chance to try the code myself

This seems like just a logical error, I could be totally wrong thought. @codetheweb I think this isn't an impossible/long fix. Hope I can help with a PR soon

im-trisha avatar Jul 10 '24 14:07 im-trisha

thought id try the bot, this is all im getting from the get go, using docker image with all tokens set. i tried 2.8.1 and latest muse. the bot joins the VC, displays the Now Playing but then never plays anything and just disconnects. I cant find any logs.

running on debian 12 locally, fresh install

zylinx avatar Jul 11 '24 17:07 zylinx

Same issue, running docker image in Unraid locally. Song adds, but queue is empty.

1215-tech avatar Jul 11 '24 23:07 1215-tech

+1 also not working via docker on Linux or Windows.

leshicodes avatar Jul 12 '24 02:07 leshicodes

+1 the bot now won't play anything, I'm running on docker linux

Wek-mad avatar Jul 12 '24 04:07 Wek-mad

+1 also not working on Linux using docker

leo283 avatar Jul 12 '24 04:07 leo283

+1 from me as well. Running with docker compose in Ubuntu 22.04.4 LTS and it's adding songs but nothing is playing. Logs aren't displaying any errors either.

Azmekk avatar Jul 12 '24 16:07 Azmekk

I tried deploying the container using a 2.7.1 and it's still not playing.

This may be an issue with the spotify and/or youtube api?

frunkAF avatar Jul 12 '24 17:07 frunkAF

Yeah it was a breaking change by Youtube, it broke everything. The easiest solution is to switch to https://github.com/distubejs/ytdl-core, which already released a fix. This is what this PR https://github.com/codetheweb/muse/pull/1042 proposes, but it has not been accepted yet.

In the mean time, if anyone want to fix their own Docker installation, you can add this to your Dockerfile:

# Temporary fix for https://github.com/codetheweb/muse/issues/1037
entrypoint: bash 
command: -c "npm install @distube/ytdl-core@latest && sed -i 's%ytdl-core%@distube/ytdl-core%g' src/services/player.ts && tini -- yarn start"

It installs @distube/ytdl-core and replaces imports in the code.

EugeneLeclerc avatar Jul 12 '24 19:07 EugeneLeclerc

Yeah it was a breaking change by Youtube, it broke everything. The easiest solution is to switch to https://github.com/distubejs/ytdl-core, which already released a fix. This is what this PR #1042 proposes, but it has not been accepted yet.

In the mean time, if anyone want to fix their own Docker installation, you can add this to your Dockerfile:

# Temporary fix for https://github.com/codetheweb/muse/issues/1037
entrypoint: bash 
command: -c "npm install @distube/ytdl-core@latest && sed -i 's%ytdl-core%@distube/ytdl-core%g' src/services/player.ts && tini -- yarn start"

It installs @distube/ytdl-core and replaces imports in the code.

I did the following in my compose file...

services:
  muse:
    container_name: muse
    image: codetheweb/muse:latest
    deploy:
      resources:
        limits:
          cpus: '2'
    user: 423:423
    environment:
      - SPOTIFY_CLIENT_ID=<REDACTED>
      - SPOTIFY_CLIENT_SECRET=<REDACTED>
      - YOUTUBE_API_KEY=<REDACTED>
      - DISCORD_TOKEN=<REDACTED>
    entrypoint: /bin/bash 
    command: -c "npm install @distube/ytdl-core@latest && sed -i 's%ytdl-core%@distube/ytdl-core%g' src/services/player.ts && tini -- yarn start"
    network_mode: bridge
    volumes:
      - /docker/muse-mn:/data:rw
    restart: unless-stopped

the container creates but doesn't seem to be functioning. absolutely no messages in the stdout

frunkAF avatar Jul 12 '24 19:07 frunkAF

I did the following in my compose file...

the container creates but doesn't seem to be functioning. absolutely no messages in the stdout

No error at all in the container output? Does the node process start correctly?

EugeneLeclerc avatar Jul 12 '24 19:07 EugeneLeclerc

This is what I get when I try adding it in my compose file:

[+] Running 2/2
 ✔ Network muse_default   Created                                                                                  0.1s
 ✔ Container muse-muse-1  Created                                                                                  0.0s
Attaching to muse-1
muse-1  | 2024-07-12T19:51:19.172Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] create, timeout 300001ms
muse-1  | 2024-07-12T19:51:19.673Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 1, finished: 1) free
muse-1  | 2024-07-12T19:51:19.832Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] reset timeout to 300001ms
muse-1  | 2024-07-12T19:51:19.832Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 2, finished: 1) reuse on addRequest, timeout 300001ms
muse-1  | 2024-07-12T19:51:19.917Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 2, finished: 2) free
muse-1  | 2024-07-12T19:51:19.932Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] reset timeout to 300001ms
muse-1  | 2024-07-12T19:51:19.932Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 3, finished: 2) reuse on addRequest, timeout 300001ms
muse-1  | 2024-07-12T19:51:20.991Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 3, finished: 3) free
muse-1  | 2024-07-12T19:51:20.999Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] reset timeout to 300001ms
muse-1  | 2024-07-12T19:51:20.999Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 4, finished: 3) reuse on addRequest, timeout 300001ms
muse-1  | 2024-07-12T19:51:21.121Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 4, finished: 4) free
muse-1  | 2024-07-12T19:51:21.139Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] reset timeout to 300001ms
muse-1  | 2024-07-12T19:51:21.139Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 5, finished: 4) reuse on addRequest, timeout 300001ms
muse-1  | 2024-07-12T19:51:21.200Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 5, finished: 5) free

And this is the output when I try it locally:

npm install @distube/ytdl-core@latest && sed -i 's%ytdl-core%@distube/ytdl-core%g' src/services/player.ts && tini -- yarn start
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.17' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }

up to date, audited 716 packages in 2s

166 packages are looking for funding
  run `npm fund` for details

27 vulnerabilities (1 low, 9 moderate, 15 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
[WARN  tini (198939)] Tini is not running as PID 1 and isn't registered as a child subreaper.
Zombie processes will not be re-parented to Tini, so zombie reaping won't work.
To fix the problem, use the -s option or set the environment variable TINI_SUBREAPER to register Tini as a child subreaper, or run Tini as PID 1.
yarn run v1.22.22
$ npm run env:set-database-url -- tsx src/scripts/migrate-and-start.ts

> [email protected] env:set-database-url
> tsx src/scripts/run-with-database-url.ts tsx src/scripts/migrate-and-start.ts

node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@distube/@distube' imported from /home/xxxxx/projects/github/muse/src/services/player.ts
    at __node_internal_captureLargerStackTrace (node:internal/errors:478:5)
    at new NodeError (node:internal/errors:387:5)
    at packageResolve (node:internal/modules/esm/resolve:852:9)
    at moduleResolve (node:internal/modules/esm/resolve:901:20)
    at defaultResolve (node:internal/modules/esm/resolve:1115:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at h (file:///home/xxxxx/projects/github/muse/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:2279)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async U (file:///home/xxxxx/projects/github/muse/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:1344)
    at async h (file:///home/xxxxx/projects/github/muse/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:2429)
    at async nextResolve (node:internal/modules/esm/loader:163:22)
    at async ESMLoader.resolve (node:internal/modules/esm/loader:841:24)
    at async ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:7)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:78:21)
    at async Promise.all (index 1)
    at async link (node:internal/modules/esm/module_job:83:9) {
  code: 'ERR_MODULE_NOT_FOUND'
}
Error: Command failed with exit code 1: tsx src/scripts/migrate-and-start.ts
    at makeError (/home/xxxxx/projects/github/muse/node_modules/execa/lib/null:59:11)
    at handlePromise (/home/xxxxx/projects/github/muse/node_modules/execa/null:119:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at <anonymous> (/home/xxxxx/projects/github/muse/src/scripts/run-with-database-url.ts:6:3) {
  shortMessage: 'Command failed with exit code 1: tsx src/scripts/migrate-and-start.ts',
  command: 'tsx src/scripts/migrate-and-start.ts',
  escapedCommand: 'tsx "src/scripts/migrate-and-start.ts"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

DeadlyVirez avatar Jul 12 '24 19:07 DeadlyVirez

Another workaround while waiting for #1042 to be merged, is to use codetheweb/muse:pr-1042 or codetheweb/muse:584bb17b73594b8fcfad6a9aefb2abe3d17f3ce8 instead of codetheweb/muse:latest.

Works fine for me.

Renaud11232 avatar Jul 12 '24 20:07 Renaud11232

Yep, switched to it and it seems to work

DeadlyVirez avatar Jul 12 '24 20:07 DeadlyVirez

This is what I get when I try adding it in my compose file:

[+] Running 2/2
 ✔ Network muse_default   Created                                                                                  0.1s
 ✔ Container muse-muse-1  Created                                                                                  0.0s
Attaching to muse-1
muse-1  | 2024-07-12T19:51:19.172Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] create, timeout 300001ms
muse-1  | 2024-07-12T19:51:19.673Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 1, finished: 1) free
muse-1  | 2024-07-12T19:51:19.832Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] reset timeout to 300001ms
muse-1  | 2024-07-12T19:51:19.832Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 2, finished: 1) reuse on addRequest, timeout 300001ms
muse-1  | 2024-07-12T19:51:19.917Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 2, finished: 2) free
muse-1  | 2024-07-12T19:51:19.932Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] reset timeout to 300001ms
muse-1  | 2024-07-12T19:51:19.932Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 3, finished: 2) reuse on addRequest, timeout 300001ms
muse-1  | 2024-07-12T19:51:20.991Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 3, finished: 3) free
muse-1  | 2024-07-12T19:51:20.999Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] reset timeout to 300001ms
muse-1  | 2024-07-12T19:51:20.999Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 4, finished: 3) reuse on addRequest, timeout 300001ms
muse-1  | 2024-07-12T19:51:21.121Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 4, finished: 4) free
muse-1  | 2024-07-12T19:51:21.139Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::] reset timeout to 300001ms
muse-1  | 2024-07-12T19:51:21.139Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 5, finished: 4) reuse on addRequest, timeout 300001ms
muse-1  | 2024-07-12T19:51:21.200Z agentkeepalive sock[0#registry.npmjs.org:443::::::::true:::::::::::::](requests: 5, finished: 5) free

This is normal output for my method, its just downloading the new packages. It could take a while depending on the quality of your connection.

And this is the output when I try it locally:

npm install @distube/ytdl-core@latest && sed -i 's%ytdl-core%@distube/ytdl-core%g' src/services/player.ts && tini -- yarn start
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.17' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }

up to date, audited 716 packages in 2s

166 packages are looking for funding
  run `npm fund` for details

27 vulnerabilities (1 low, 9 moderate, 15 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Your version of node is too old. It has been unsupported for quite a while now, you should upgrade 😄

EugeneLeclerc avatar Jul 12 '24 20:07 EugeneLeclerc

Another workaround while waiting for #1042 to be merged, is to use codetheweb/muse:pr-1042 or codetheweb/muse:584bb17b73594b8fcfad6a9aefb2abe3d17f3ce8 instead of codetheweb/muse:latest.

Works fine for me.

Did not know PR published a docker image, nice. This is definetely better than my workaround 😉

EugeneLeclerc avatar Jul 12 '24 20:07 EugeneLeclerc

Yep, was on the wrong node version because it's recommended in the README:

Node.js (16.x is recommended because it's the current LTS version)

DeadlyVirez avatar Jul 12 '24 20:07 DeadlyVirez

Yep, was on the wrong node version because it's recommended in the README:

Node.js (16.x is recommended because it's the current LTS version)

Yeah the README is wrong, Node 16 has not been LTS for quite a while, this should be updated too I guess ^^

EugeneLeclerc avatar Jul 12 '24 20:07 EugeneLeclerc

codetheweb/muse:pr-1042

can confirm switching to codetheweb/muse:pr-1042 works

Heiwa03 avatar Jul 12 '24 21:07 Heiwa03