codetheweb / muse

🎧 a self-hosted midwestern Discord music bot that doesn't suck
MIT License
799 stars 200 forks source link

Unable to play any songs #1037

Open MintyFreshers opened 3 weeks ago

MintyFreshers commented 3 weeks ago

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:

Versions

im-trisha commented 3 weeks ago

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)

DrNefarius commented 3 weeks ago

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

bu3alwa commented 3 weeks ago

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?

im-trisha commented 3 weeks ago

@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

bu3alwa commented 3 weeks ago

@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?

MindHardt commented 3 weeks ago

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.

burntcookie90 commented 2 weeks ago

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

bu3alwa commented 2 weeks ago

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.

im-trisha commented 1 week ago

@bu3alwa mine still doesn't work.

lone-dancer commented 1 day ago

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

xxtensazenxx commented 21 hours ago

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

im-trisha commented 9 hours ago

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