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

Bot erroring out on startup #1062

Open
2 tasks done
petegilb opened this issue Aug 7, 2024 · 7 comments
Open
2 tasks done

Bot erroring out on startup #1062

petegilb opened this issue Aug 7, 2024 · 7 comments
Labels

Comments

@petegilb
Copy link

petegilb commented Aug 7, 2024

After updating the bot to latest it keeps failing on startup. I even double checked the discord bot token and generated a new one. Is there something I'm missing?

Logs

muse-1  |   prisma:client:libraryEngine  sending request, this.libraryStarted: true +3ms
muse-1  |   superagent POST https://accounts.spotify.com/api/token +0ms
muse-1  |   superagent POST https://accounts.spotify.com/api/token +4ms
⠋ 📡 connecting to Discord...  muse Provided token: redacted +24ms
muse-1  |   muse Preparing to connect to the gateway... +0ms
muse-1  |   muse No files needed to be evicted. Total size of the cache is currently 0 bytes, and the cache limit is 2000000000 bytes. +8ms
⠋ 📡 connecting to Discord...  superagent POST https://accounts.spotify.com/api/token +25s
muse-1  |   superagent POST https://accounts.spotify.com/api/token +2ms
⠼ 📡 connecting to Discord...  muse [WS => Manager] Manager was destroyed. Called by:
muse-1  |   muse Error
muse-1  |   muse     at WebSocketManager.destroy (/usr/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:326:54)
muse-1  |   muse     at Client.destroy (/usr/app/node_modules/discord.js/src/client/Client.js:251:13)
muse-1  |   muse     at Client.login (/usr/app/node_modules/discord.js/src/client/Client.js:229:12)
muse-1  |   muse     at default_1.register (/usr/app/src/bot.ts:166:5)
muse-1  |   muse     at startBot (/usr/app/src/index.ts:21:3)
muse-1  |   muse     at <anonymous> (/usr/app/src/scripts/migrate-and-start.ts:84:3) +1m
muse-1  |   prisma:client:libraryEngine:exitHooks  exit event received: 1 +0ms
muse-1  | /usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:10
muse-1  |     self.onError(new RequestAbortedError())
muse-1  |                  ^
muse-1  |
muse-1  | RequestAbortedError [AbortError]: Request aborted
muse-1  |     at abort (/usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:10:18)
muse-1  |     at self.<computed> (/usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:29:5)
muse-1  |     at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20)
muse-1  |     at EventTarget.dispatchEvent (node:internal/event_target:721:26)
muse-1  |     at abortSignal (node:internal/abort_controller:369:10)
muse-1  |     at AbortController.abort (node:internal/abort_controller:403:5)
muse-1  |     at Timeout.<anonymous> (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:68:46)
muse-1  |     at listOnTimeout (node:internal/timers:569:17)
muse-1  |     at process.processTimers (node:internal/timers:512:7) {
muse-1  |   code: 'UND_ERR_ABORTED'
muse-1  | }
muse-1  |
muse-1  | Node.js v18.20.4

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

Runtime
I'm running Muse:

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

Versions

  • Muse: 2.9.1
  • Docker (if applicable): 26.1.0
  • OS: Debian
@codetheweb
Copy link
Collaborator

Does this seem like a timeout (does it take a few seconds for this error to appear)?

@rblaine95
Copy link
Contributor

@codetheweb yes, it seems like the container runs the DB migrations, hangs for a few seconds, and then prints the above error.

Running docker exec -ti muse npm update seems to resolve the issue, so it looks like it could be an outdated node package

@petegilb
Copy link
Author

Confirmed that doing an npm update on the container fixed it

@rblaine95
Copy link
Contributor

rblaine95 commented Aug 19, 2024

This looks like it's been resolved with the release of v2.9.3

Edit to reduce spam:
Looks like it's happening again

$ docker logs -f muse
========================================
========================================
================= muse =================
========================================
=========== Made with 🎶 by ============
==== https://github.com/codetheweb =====
========================================
========================================

Running version 2.9.3 built on 8/19/2024 (commit 1e17b94321744ffbe4a6176a900286a834c952d1)

🔧 Need help? https://github.com/codetheweb/muse/discussions/new
🐛 Bug? https://github.com/codetheweb/muse/issues/new
✨ New feature? https://github.com/codetheweb/muse/issues/new
☕ Discussion? https://github.com/codetheweb/muse/discussions/new
💰 Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codetheweb


✔ Database migrations applied.
⠇ 📡 connecting to Discord.../usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:10
    self.onError(new RequestAbortedError())
                 ^

RequestAbortedError [AbortError]: Request aborted
    at abort (/usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:10:18)
    at self.<computed> (/usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:29:5)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20)
    at EventTarget.dispatchEvent (node:internal/event_target:721:26)
    at abortSignal (node:internal/abort_controller:369:10)
    at AbortController.abort (node:internal/abort_controller:403:5)
    at Timeout.<anonymous> (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:68:46)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7) {
  code: 'UND_ERR_ABORTED'
}

Edit again to prevent spam:
Looks like it's fixed again in v2.9.4

========================================
========================================
================= muse =================
========================================
=========== Made with 🎶 by ============
==== https://github.com/codetheweb =====
========================================
========================================

Running version 2.9.4 built on 8/28/2024 (commit 534d8fafaa7f09f7ba940d044b08e6c48f800c7a)

🔧 Need help? https://github.com/codetheweb/muse/discussions/new
🐛 Bug? https://github.com/codetheweb/muse/issues/new
✨ New feature? https://github.com/codetheweb/muse/issues/new
☕ Discussion? https://github.com/codetheweb/muse/discussions/new
💰 Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codetheweb


✔ Database migrations applied.
✔ Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=redacted&scope=bot%20applications.commands&permissions=36700160

@Hazzajenko
Copy link
Contributor

This looks like it's been resolved with the release of v2.9.3

Edit to reduce spam: Looks like it's happening again

$ docker logs -f muse
========================================
========================================
================= muse =================
========================================
=========== Made with 🎶 by ============
==== https://github.com/codetheweb =====
========================================
========================================

Running version 2.9.3 built on 8/19/2024 (commit 1e17b94321744ffbe4a6176a900286a834c952d1)

🔧 Need help? https://github.com/codetheweb/muse/discussions/new
🐛 Bug? https://github.com/codetheweb/muse/issues/new
✨ New feature? https://github.com/codetheweb/muse/issues/new
☕ Discussion? https://github.com/codetheweb/muse/discussions/new
💰 Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codetheweb


✔ Database migrations applied.
⠇ 📡 connecting to Discord.../usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:10
    self.onError(new RequestAbortedError())
                 ^

RequestAbortedError [AbortError]: Request aborted
    at abort (/usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:10:18)
    at self.<computed> (/usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:29:5)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20)
    at EventTarget.dispatchEvent (node:internal/event_target:721:26)
    at abortSignal (node:internal/abort_controller:369:10)
    at AbortController.abort (node:internal/abort_controller:403:5)
    at Timeout.<anonymous> (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:68:46)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7) {
  code: 'UND_ERR_ABORTED'
}

Edit again to prevent spam: Looks like it's fixed again in v2.9.4

========================================
========================================
================= muse =================
========================================
=========== Made with 🎶 by ============
==== https://github.com/codetheweb =====
========================================
========================================

Running version 2.9.4 built on 8/28/2024 (commit 534d8fafaa7f09f7ba940d044b08e6c48f800c7a)

🔧 Need help? https://github.com/codetheweb/muse/discussions/new
🐛 Bug? https://github.com/codetheweb/muse/issues/new
✨ New feature? https://github.com/codetheweb/muse/issues/new
☕ Discussion? https://github.com/codetheweb/muse/discussions/new
💰 Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codetheweb


✔ Database migrations applied.
✔ Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=redacted&scope=bot%20applications.commands&permissions=36700160

A fresh build could be fixing your issue.

If it happens again and you are using docker compose, delete the volume folder ./muse (the one containing the cache and db.sqlite).

If this fixes the issue, we can investigate further into the db or cache files.

@rblaine95
Copy link
Contributor

rblaine95 commented Sep 5, 2024

@Hazzajenko, thank you for that, it happened again, I've deleted the cache (but kept the db.sqlite) and restarted muse.

It happened again.

So I moved the db.sqlite to db.sqlite.bak and restarted muse again.

It happened again.

So I mv ./muse ./muse.bak && mkdir ./muse and restarted muse again.

It happened again.

This is my docker run command:

docker run -itd --restart=always --name=muse \
        -v /data/muse:/data \
        -e DISCORD_CLIENT_ID='redacted' \
        -e DISCORD_CLIENT_SECRET='redacted' \
        -e DISCORD_TOKEN='redacted' \
        -e SPOTIFY_CLIENT_ID='redacted' \
        -e SPOTIFY_CLIENT_SECRET='redacted' \
        -e YOUTUBE_API_KEY='redacted' \
        -e BOT_STATUS=online \
        -e BOT_ACTIVITY_TYPE=STREAMING \
        -e BOT_ACTIVITY_URL=https://www.twitch.tv/marinemammalrescue \
        -e BOT_ACTIVITY=MarineMammalRescue \
        ghcr.io/museofficial/muse
$ docker logs muse
========================================
========================================
================= muse =================
========================================
=========== Made with 🎶 by ============
==== https://github.com/codetheweb =====
========================================
========================================

Running version 2.9.4 built on 8/28/2024 (commit 534d8fafaa7f09f7ba940d044b08e6c48f800c7a)

🔧 Need help? https://github.com/codetheweb/muse/discussions/new
🐛 Bug? https://github.com/codetheweb/muse/issues/new
✨ New feature? https://github.com/codetheweb/muse/issues/new
☕ Discussion? https://github.com/codetheweb/muse/discussions/new
💰 Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codetheweb


✔ Database migrations applied.
⠇ 📡 connecting to Discord.../usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:10
    self.onError(new RequestAbortedError())
                 ^

RequestAbortedError [AbortError]: Request aborted
    at abort (/usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:10:18)
    at self.<computed> (/usr/app/node_modules/discord.js/node_modules/undici/lib/api/abort-signal.js:29:5)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20)
    at EventTarget.dispatchEvent (node:internal/event_target:721:26)
    at abortSignal (node:internal/abort_controller:369:10)
    at AbortController.abort (node:internal/abort_controller:403:5)
    at Timeout.<anonymous> (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:68:46)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7) {
  code: 'UND_ERR_ABORTED'
}

Node.js v18.20.4

@rblaine95
Copy link
Contributor

Not sure if related, but after not running the bot for ±2 weeks and starting it up again today (same tag, same run command, same db, etc) it worked 🤔

After playing a few songs and keeping a close eye on it, I saw a warning about a memory leak come up:

(node:8) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 stateChange listeners added to [Networking]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants