evobot icon indicating copy to clipboard operation
evobot copied to clipboard

Bug: When the bot is playing a song, it stops randomly

Open KimPig opened this issue 3 years ago • 9 comments

Describe the bug A description of what the bug is.

When the bot is playing a song, it stops randomly and quits the vioce channel. After that, it can be loaded before I reboot the bot

How To Reproduce Steps to reproduce the behavior:

Actually I don't know under what conditions this bug occurs, but it's pretty common. It happens about once in 8 times.

Expected behavior A description of what you expected to happen.

Environment (add if possible)

  • Node.js version:

Additional information & screenshots Add any other context or screenshots about the problem here.

KimPig avatar Jun 08 '22 06:06 KimPig

Same here

renanluiz avatar Jun 10 '22 23:06 renanluiz

Can't help debug this by just saying it's "random", you could help by getting the error from terminal, watching your ram usage, etc...

eritislami avatar Jun 15 '22 08:06 eritislami

Where are you hosting the bot? If the bot is being hosted on heroku or replit, the bot may reboot unexpectedly.

mozzi-berilinky avatar Jun 19 '22 04:06 mozzi-berilinky

same, there is no kind of error in the log. hosting on a private linux server.

villagerrrrrrrrr avatar Jun 25 '22 18:06 villagerrrrrrrrr

Also running into the same issue. Running the bot inside of a docker container on a small digital ocean droplet. Used to work without this issue before the typescript upgrade so if it's a memory issue I think it's a newly introduced one. If someone points me to which logs would be useful I'd be happy to post them here once it happens again. For us it happens every single time a long mix is playing (> 1 hour) and usually at around the same time.

stephensilber avatar Jun 30 '22 13:06 stephensilber

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 30 '22 16:07 stale[bot]

Having the same issue:

This is what appeared in the terminal log:

> [email protected] start
> ts-node index.ts

*** Bot ready!
AudioPlayerError: aborted
    at connResetException (node:internal/errors:691:14)
    at TLSSocket.socketCloseListener (node:_http_client:402:19)
    at TLSSocket.emit (node:events:538:35)
    at TLSSocket.emit (node:domain:475:12)
    at node:net:687:12
    at TCP.done (node:_tls_wrap:580:7) {
  resource: AudioResource {
    playStream: Encoder {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: true,
      encoder: null,
      _options: [Object],
      _required: 3840,
      _buffer: null,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: [Function: bound onwrite]
    },
    edges: [ [Object], [Object], [Object] ],
    metadata: Song {
      url: 'https://www.youtube.com/watch?v=lovYZqGVPBQ',
      title: '6 Hours of The Best Epic Inspirational Music for Studying and Working',
      duration: 21614
    },
    volume: VolumeTransformer {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: true,
      _readInt: [Function (anonymous)],
      _writeInt: [Function (anonymous)],
      _bits: 16,
      _bytes: 2,
      _extremum: 32768,
      volume: 1,
      _chunk: null,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: [Function: bound onwrite]
    },
    encoder: Encoder {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: true,
      encoder: null,
      _options: [Object],
      _required: 3840,
      _buffer: null,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: [Function: bound onwrite]
    },
    audioPlayer: AudioPlayer {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      _state: [Object],
      subscribers: [Array],
      behaviors: [Object],
      debug: [Function (anonymous)],
      [Symbol(kCapture)]: false
    },
    playbackDuration: 2034420,
    started: true,
    silencePaddingFrames: 5,
    silenceRemaining: -1
  }
}

Running the Docker Container in Kubernetes.

Did not see any extreme increase in Memory or CPU Usage.

Sharrnah avatar Aug 10 '22 16:08 Sharrnah

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 20 '22 19:09 stale[bot]

Not stale, having the same issue as @Sharrnah.

zPanic avatar Sep 22 '22 15:09 zPanic

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 22 '22 18:10 stale[bot]

Not stale, having the same issue as @Sharrnah. Seems to always happen with longer songs >10minutes.

frenchtoasters avatar Oct 29 '22 15:10 frenchtoasters

I've put the progress label so stale bot won't touch this issue anymore, the thing is that I have played 1-2 hour videos with my bot and haven't had an issue, this is quite difficult to debug and determine why it's happening

eritislami avatar Nov 04 '22 11:11 eritislami

I've put the progress label so stale bot won't touch this issue anymore, the thing is that I have played 1-2 hour videos with my bot and haven't had an issue, this is quite difficult to debug and determine why it's happening

I do know that I would hit the issue when running this in a container, for me its in a kubernetes cluster. The behavior that I have seen is that it will play for 1-2 hours a video. Then after that video has run it will start to fail on the next few videos. I can try and get some kubernetes logs from my setup if you think that would help.

TBH I forked and moved to play-dl instead and have not run into this issue any more, not sure if that is an option for this project though https://github.com/frenchtoasters/evobot/commit/63666ba84c542908645aa8f195b4fc37d8dcee6d

frenchtoasters avatar Nov 04 '22 18:11 frenchtoasters

I've put the progress label so stale bot won't touch this issue anymore, the thing is that I have played 1-2 hour videos with my bot and haven't had an issue, this is quite difficult to debug and determine why it's happening

I do know that I would hit the issue when running this in a container, for me its in a kubernetes cluster. The behavior that I have seen is that it will play for 1-2 hours a video. Then after that video has run it will start to fail on the next few videos. I can try and get some kubernetes logs from my setup if you think that would help.

TBH I forked and moved to play-dl instead and have not run into this issue any more, not sure if that is an option for this project though frenchtoasters@63666ba

The problem is not random, it happens with some videos about more than 1h duration, we just don't know what's the common thing about those videos. this is an example -> https://www.youtube.com/watch?v=c4LqKf9dxPY

The fix might be as @frenchtoasters says to moved to play-dl instead ytdl-core. I have read about other similar issues and the problem is ytdl-core. This is one of the repositories with similar isssues -> https://github.com/Androz2091/discord-player/issues/892

diespinozah avatar Dec 02 '22 19:12 diespinozah

No its not just doing this or 1h duration videos. I have opened this https://www.youtube.com/watch?v=YdW6n8Leznc and still same error. bot stops before the duration ends. every time the stop point changing randonly and no terminal error. Just bot says Music ended.

nanoeray avatar Feb 26 '23 13:02 nanoeray

We have now moved to play-dl with the help of @diespinozah I will let this issue stay open for a bit longer to see if anyone has feedback about it.

eritislami avatar Apr 04 '23 18:04 eritislami

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 18 '23 23:05 stale[bot]