museofficial / muse

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

Error: could not find settings for guild #638

Closed Maxximou5 closed 2 years ago

Maxximou5 commented 2 years ago

What's happening? Deploying a new installation using docker results in the following errors on launch. Bot has been invited with the required permissions and tokens, ids, keys, and secrets have been set in docker-compose file. Previously running on v1.4.0 without any issues until after upgrade was performed. Going back a version results in the same problems.

Logs

musicbot | yarn run v1.22.15
musicbot | $ npm run env:set-database-url -- esmo src/scripts/migrate-and-start.ts
musicbot |
musicbot | > muse@1.9.0 env:set-database-url
musicbot | > esmo src/scripts/run-with-database-url.ts "esmo" "src/scripts/migrate-and-start.ts"
musicbot |
musicbot | (node:53) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
musicbot | (Use `node --trace-warnings ...` to show where the warning was created)
musicbot | (node:53) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
musicbot | (node:87) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
musicbot | (Use `node --trace-warnings ...` to show where the warning was created)
musicbot | (node:87) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
musicbot | 2022-04-28T02:39:05.232Z prisma:tryLoadEnv Environment variables not found at null
musicbot | 2022-04-28T02:39:05.233Z prisma:tryLoadEnv Environment variables not found at undefined
musicbot | 2022-04-28T02:39:05.233Z prisma:tryLoadEnv No Environment variables loaded
musicbot | 2022-04-28T02:39:05.611Z prisma:tryLoadEnv Environment variables not found at null
musicbot | 2022-04-28T02:39:05.612Z prisma:tryLoadEnv Environment variables not found at undefined
musicbot | 2022-04-28T02:39:05.612Z prisma:tryLoadEnv No Environment variables loaded
musicbot | 2022-04-28T02:39:05.619Z prisma:client clientVersion: 3.11.0
musicbot | 2022-04-28T02:39:05.619Z prisma:client clientEngineType: library
musicbot | 2022-04-28T02:39:05.621Z prisma:client:libraryEngine internalSetup
musicbot | 2022-04-28T02:39:06.212Z prisma:tryLoadEnv Environment variables not found at null
musicbot | 2022-04-28T02:39:06.212Z prisma:tryLoadEnv Environment variables not found at undefined
musicbot | 2022-04-28T02:39:06.212Z prisma:tryLoadEnv No Environment variables loaded
musicbot | 2022-04-28T02:39:06.214Z prisma:client clientVersion: 3.11.0
musicbot | 2022-04-28T02:39:06.214Z prisma:client clientEngineType: library
musicbot | 2022-04-28T02:39:06.214Z prisma:client:libraryEngine internalSetup
musicbot | ========================================
musicbot | ========================================
musicbot | ================= muse =================
musicbot | ========================================
musicbot | =========== Made with 🎶 by ============
musicbot | ==== https://github.com/codetheweb =====
musicbot | ========================================
musicbot | ========================================
musicbot |
musicbot | Running version 1.9.0 built on 4/23/2022 (commit 1ef05aba9d2e692ef365721f725be2d2a4e464d9)
musicbot |
musicbot | 🔧 Need help? https://github.com/codetheweb/muse/discussions/new
musicbot | 🐛 Bug? https://github.com/codetheweb/muse/issues/new
musicbot | ✨ New feature? https://github.com/codetheweb/muse/issues/new
musicbot | ☕ Discussion? https://github.com/codetheweb/muse/discussions/new
musicbot | 💰 Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codetheweb
musicbot |
musicbot |
musicbot | - Applying database migrations...
musicbot | 2022-04-28T02:39:06.308Z prisma:client prisma.queryRaw(SELECT COUNT(id) FROM _prisma_migrations, [])
musicbot | 2022-04-28T02:39:06.309Z prisma:client Prisma Client call:
musicbot | 2022-04-28T02:39:06.314Z prisma:client Prisma Client call:
musicbot | 2022-04-28T02:39:06.317Z prisma:client prisma.queryRaw({
musicbot |   query: 'SELECT COUNT(id) FROM _prisma_migrations',
musicbot |   parameters: {
musicbot |     values: '[]',
musicbot |     __prismaRawParamaters__: true
musicbot |   }
musicbot | })
musicbot | 2022-04-28T02:39:06.317Z prisma:client Generated request:
musicbot | 2022-04-28T02:39:06.317Z prisma:client mutation {
musicbot |   queryRaw(
musicbot |     query: "SELECT COUNT(id) FROM _prisma_migrations"
musicbot |     parameters: "[]"
musicbot |   )
musicbot | }
musicbot |
musicbot | 2022-04-28T02:39:06.318Z prisma:client:libraryEngine sending request, this.libraryStarted: false
musicbot | 2022-04-28T02:39:06.467Z prisma:client:libraryEngine Searching for Query Engine Library in /usr/app/node_modules/.prisma/client
musicbot | 2022-04-28T02:39:06.467Z prisma:client:libraryEngine loadEngine using /usr/app/node_modules/.prisma/client/libquery_engine-debian-openssl-1.1.x.so.node
musicbot | 2022-04-28T02:39:06.478Z prisma:client:libraryEngine library starting
musicbot | 2022-04-28T02:39:06.480Z prisma:client:libraryEngine Searching for Query Engine Library in /usr/app/node_modules/.prisma/client
musicbot | 2022-04-28T02:39:06.480Z prisma:client:libraryEngine loadEngine using /usr/app/node_modules/.prisma/client/libquery_engine-debian-openssl-1.1.x.so.node
musicbot | 2022-04-28T02:39:06.489Z prisma:client:libraryEngine library started
musicbot | ✔ Database migrations applied.
musicbot | 2022-04-28T02:39:08.328Z prisma:client Prisma Client call:
musicbot | 2022-04-28T02:39:08.328Z prisma:client prisma.fileCache.findMany({
musicbot |   where: undefined,
musicbot |   orderBy: {
musicbot |     createdAt: 'asc'
musicbot |   },
musicbot |   take: 50
musicbot | })
musicbot | 2022-04-28T02:39:08.329Z prisma:client Generated request:
musicbot | 2022-04-28T02:39:08.329Z prisma:client query {
musicbot |   findManyFileCache(
musicbot |     orderBy: [
musicbot |       {
musicbot |         createdAt: asc
musicbot |       }
musicbot |     ]
musicbot |     take: 50
musicbot |   ) {
musicbot |     hash
musicbot |     bytes
musicbot |     accessedAt
musicbot |     createdAt
musicbot |     updatedAt
musicbot |   }
musicbot | }
musicbot |
musicbot | 2022-04-28T02:39:08.329Z prisma:client:libraryEngine sending request, this.libraryStarted: false
musicbot | 2022-04-28T02:39:08.329Z prisma:client:libraryEngine library starting
musicbot | 2022-04-28T02:39:08.332Z prisma:client:libraryEngine library started
musicbot | 2022-04-28T02:39:08.336Z muse Evicting oldest files...
musicbot | 2022-04-28T02:39:08.338Z prisma:client Prisma Client call:
musicbot | 2022-04-28T02:39:08.338Z prisma:client prisma.fileCache.aggregate({
musicbot |   select: {
musicbot |     _sum: {
musicbot |       select: {
musicbot |         bytes: true
musicbot |       }
musicbot |     }
musicbot |   }
musicbot | })
musicbot | 2022-04-28T02:39:08.338Z prisma:client Generated request:
musicbot | 2022-04-28T02:39:08.338Z prisma:client query {
musicbot |   aggregateFileCache {
musicbot |     _sum {
musicbot |       bytes
musicbot |     }
musicbot |   }
musicbot | }
musicbot |
musicbot | 2022-04-28T02:39:08.338Z prisma:client:libraryEngine sending request, this.libraryStarted: true
musicbot | 2022-04-28T02:39:08.366Z superagent POST https://accounts.spotify.com/api/token
musicbot | 2022-04-28T02:39:08.373Z superagent POST https://accounts.spotify.com/api/token
musicbot | 2022-04-28T02:39:08.379Z superagent POST https://accounts.spotify.com/api/token
musicbot | - 📡 connecting to Discord...
musicbot | 2022-04-28T02:39:08.388Z muse Provided token: STUwMTcyODc1NjY1NTk2NDQ2.YiVDcg.***************************
musicbot | 2022-04-28T02:39:08.388Z muse Preparing to connect to the gateway...
musicbot | 2022-04-28T02:39:08.398Z muse No files needed to be evicted. Total size of the cache is currently 0 bytes, and the cache limit is 2000000000 bytes.
musicbot | 2022-04-28T02:39:08.547Z superagent POST https://accounts.spotify.com/api/token -> 200
musicbot | 2022-04-28T02:39:08.551Z superagent POST https://accounts.spotify.com/api/token -> 200
musicbot | 2022-04-28T02:39:08.609Z superagent POST https://accounts.spotify.com/api/token -> 200
musicbot | 2022-04-28T02:39:08.704Z muse [WS => Manager] Fetched Gateway Information
musicbot |     URL: wss://gateway.discord.gg
musicbot |     Recommended Shards: 1
musicbot | 2022-04-28T02:39:08.705Z muse [WS => Manager] Session Limit Information
musicbot |     Total: 1000
musicbot |     Remaining: 728
musicbot | 2022-04-28T02:39:08.705Z muse [WS => Manager] Spawning shards: 0
musicbot | 2022-04-28T02:39:08.705Z muse [WS => Shard 0] [CONNECT]
musicbot |     Gateway    : wss://gateway.discord.gg/
musicbot |     Version    : 9
musicbot |     Encoding   : json
musicbot |     Compression: none
musicbot | 2022-04-28T02:39:08.706Z muse [WS => Shard 0] Setting a HELLO timeout for 20s.
musicbot | 2022-04-28T02:39:08.956Z muse [WS => Shard 0] [CONNECTED] Took 250ms
musicbot | 2022-04-28T02:39:08.958Z muse [WS => Shard 0] Clearing the HELLO timeout.
musicbot | 2022-04-28T02:39:08.959Z muse [WS => Shard 0] Setting a heartbeat interval for 41250ms.
musicbot | 2022-04-28T02:39:08.959Z muse [WS => Shard 0] [IDENTIFY] Shard 0/1 with intents: 12929
musicbot | 2022-04-28T02:39:09.116Z muse [WS => Shard 0] [READY] Session c29d08c6affbde7ca29638754ea1c800.
musicbot | 2022-04-28T02:39:09.117Z muse [WS => Shard 0] [ReadyHeartbeat] Sending a heartbeat.
musicbot | 2022-04-28T02:39:09.152Z muse [WS => Shard 0] Shard received all its guilds. Marking as fully ready.
musicbot | 2022-04-28T02:39:09.156Z muse --------------------------------------------------
musicbot | Core Dependencies
musicbot | - @discordjs/voice: 0.8.0
musicbot | - prism-media: 1.3.2
musicbot |
musicbot | Opus Libraries
musicbot | - @discordjs/opus: 0.7.0
musicbot | - opusscript: not found
musicbot |
musicbot | Encryption Libraries
musicbot | - sodium: not found
musicbot | - libsodium-wrappers: 0.7.9
musicbot | - tweetnacl: not found
musicbot |
musicbot | FFmpeg
musicbot | - version: 4.1.8-0+deb10u1
musicbot | - libopus: yes
musicbot | --------------------------------------------------
musicbot | 2022-04-28T02:39:09.218Z muse [WS => Shard 0] Heartbeat acknowledged, latency of 101ms.
musicbot | 2022-04-28T02:39:50.211Z muse [WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
musicbot | 2022-04-28T02:39:50.290Z muse [WS => Shard 0] Heartbeat acknowledged, latency of 79ms.
musicbot | 2022-04-28T02:40:00.943Z prisma:client Prisma Client call:
musicbot | 2022-04-28T02:40:00.944Z prisma:client prisma.setting.findUnique({
musicbot |   where: {
musicbot |     guildId: '67475467019497470'
musicbot |   }
musicbot | })
musicbot | 2022-04-28T02:40:00.944Z prisma:client Generated request:
musicbot | 2022-04-28T02:40:00.944Z prisma:client query {
musicbot |   findUniqueSetting(where: {
musicbot |     guildId: "67475467019497470"
musicbot |   }) {
musicbot |     guildId
musicbot |     invitedByUserId
musicbot |     playlistLimit
musicbot |     secondsToWaitAfterQueueEmpties
musicbot |     leaveIfNoListeners
musicbot |     roleId
musicbot |     createdAt
musicbot |     updatedAt
musicbot |   }
musicbot | }
musicbot |
musicbot | 2022-04-28T02:40:00.945Z prisma:client:libraryEngine sending request, this.libraryStarted: true
musicbot | 2022-04-28T02:40:00.949Z prisma:client:libraryEngine hookProcess received: exit
musicbot | 2022-04-28T02:40:00.949Z prisma:client:libraryEngine runBeforeExit
musicbot | file:///usr/app/src/utils/update-permissions-for-guild.ts:10
musicbot |     throw new Error("could not find settings for guild");
musicbot |           ^
musicbot |
musicbot | Error: could not find settings for guild
musicbot |     at updatePermissionsForGuild (file:///usr/app/src/utils/update-permissions-for-guild.ts:10:11)
musicbot |     at async Promise.all (index 0)
musicbot |     at async Client.<anonymous> (file:///usr/app/src/bot.ts:129:7)
musicbot | file:///usr/app/node_modules/execa/lib/error.js:59
musicbot |              error = new Error(message);
musicbot |                      ^
musicbot |
musicbot | Error: Command failed with exit code 1: esmo src/scripts/migrate-and-start.ts
musicbot |     at makeError (file:///usr/app/node_modules/execa/lib/error.js:59:11)
musicbot |     at handlePromise (file:///usr/app/node_modules/execa/index.js:119:26)
musicbot |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
musicbot |     at async file:///usr/app/src/scripts/run-with-database-url.ts:5:3 {
musicbot |   shortMessage: 'Command failed with exit code 1: esmo src/scripts/migrate-and-start.ts',
musicbot |   command: 'esmo src/scripts/migrate-and-start.ts',
musicbot |   escapedCommand: 'esmo "src/scripts/migrate-and-start.ts"',
musicbot |   exitCode: 1,
musicbot |   signal: undefined,
musicbot |   signalDescription: undefined,
musicbot |   stdout: undefined,
musicbot |   stderr: undefined,
musicbot |   failed: true,
musicbot |   timedOut: false,
musicbot |   isCanceled: false,
musicbot |   killed: false
musicbot | }
musicbot | error Command failed with exit code 1.
musicbot | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Screenshots N/A

Additional context If a previous installation with data (db.sqlite) is used, the issue is then #637

Runtime I'm running Muse:

Versions

unixbird commented 2 years ago

I am also receiving this error as well. Bot will actually play music until it crashes with this error.

alvarosdev commented 2 years ago

Same error

muse_1  | yarn run v1.22.15
muse_1  | $ npm run env:set-database-url -- esmo src/scripts/migrate-and-start.ts
muse_1  |
muse_1  | > muse@1.9.0 env:set-database-url
muse_1  | > esmo src/scripts/run-with-database-url.ts "esmo" "src/scripts/migrate-and-start.ts"
muse_1  |
muse_1  | (node:52) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
muse_1  | (Use `node --trace-warnings ...` to show where the warning was created)
muse_1  | (node:52) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
muse_1  | (node:90) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
muse_1  | (Use `node --trace-warnings ...` to show where the warning was created)
muse_1  | (node:90) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
muse_1  | ========================================
muse_1  | ========================================
muse_1  | ================= muse =================
muse_1  | ========================================
muse_1  | =========== Made with 🎶 by ============
muse_1  | ==== https://github.com/codetheweb =====
muse_1  | ========================================
muse_1  | ========================================
muse_1  |
muse_1  | Running version 1.9.0 built on 4/23/2022 (commit 1ef05aba9d2e692ef365721f725be2d2a4e464d9)
muse_1  |
muse_1  | 🔧 Need help? https://github.com/codetheweb/muse/discussions/new
muse_1  | 🐛 Bug? https://github.com/codetheweb/muse/issues/new
muse_1  | ✨ New feature? https://github.com/codetheweb/muse/issues/new
muse_1  | ☕ Discussion? https://github.com/codetheweb/muse/discussions/new
muse_1  | 💰 Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codetheweb
muse_1  |
muse_1  |
muse_1  | - Applying database migrations...
muse_1  | ✔ Database migrations applied.
muse_1  | - 📡 connecting to Discord...
muse_1  | file:///usr/app/src/utils/update-permissions-for-guild.ts:10
muse_1  |     throw new Error("could not find settings for guild");
muse_1  |           ^
muse_1  |
muse_1  | Error: could not find settings for guild
muse_1  |     at updatePermissionsForGuild (file:///usr/app/src/utils/update-permissions-for-guild.ts:10:11)
muse_1  |     at async Promise.all (index 0)
muse_1  |     at async Client.<anonymous> (file:///usr/app/src/bot.ts:129:7)
muse_1  | file:///usr/app/node_modules/execa/lib/error.js:59
muse_1  |               error = new Error(message);
muse_1  |                       ^
muse_1  |
muse_1  | Error: Command failed with exit code 1: esmo src/scripts/migrate-and-start.ts
muse_1  |     at makeError (file:///usr/app/node_modules/execa/lib/error.js:59:11)
muse_1  |     at handlePromise (file:///usr/app/node_modules/execa/index.js:119:26)
muse_1  |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
muse_1  |     at async file:///usr/app/src/scripts/run-with-database-url.ts:5:3 {
muse_1  |   shortMessage: 'Command failed with exit code 1: esmo src/scripts/migrate-and-start.ts',
muse_1  |   command: 'esmo src/scripts/migrate-and-start.ts',
muse_1  |   escapedCommand: 'esmo "src/scripts/migrate-and-start.ts"',
muse_1  |   exitCode: 1,
muse_1  |   signal: undefined,
muse_1  |   signalDescription: undefined,
muse_1  |   stdout: undefined,
muse_1  |   stderr: undefined,
muse_1  |   failed: true,
muse_1  |   timedOut: false,
muse_1  |   isCanceled: false,
muse_1  |   killed: false
muse_1  | }
muse_1  | npm notice
muse_1  | npm notice New minor version of npm available! 8.1.0 -> 8.8.0
muse_1  | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.8.0>
muse_1  | npm notice Run `npm install -g npm@8.8.0` to update!
muse_1  | npm notice
muse_1  | error Command failed with exit code 1.
muse_1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
LostAndDead commented 2 years ago

Also the same error, first time using the bot for me


> muse@1.9.0 env:set-database-url
> esmo src/scripts/run-with-database-url.ts "esmo" "src/scripts/migrate-and-start.ts"
(node:52) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:52) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
(node:92) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:92) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, transformSource
========================================
========================================
================= muse =================
========================================
=========== Made with 🎶 by ============
==== https://github.com/codetheweb =====
========================================
========================================
Running version 1.9.0 built on 4/23/2022 (commit 1ef05aba9d2e692ef365721f725be2d2a4e464d9)
🔧 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
- Applying database migrations...
✔ Database migrations applied.
- 📡 connecting to Discord...
file:///usr/app/src/utils/update-permissions-for-guild.ts:10
    throw new Error("could not find settings for guild");
          ^
Error: could not find settings for guild
    at updatePermissionsForGuild (file:///usr/app/src/utils/update-permissions-for-guild.ts:10:11)
    at async Promise.all (index 0)
    at async Client.<anonymous> (file:///usr/app/src/bot.ts:129:7)
file:///usr/app/node_modules/execa/lib/error.js:59
        error = new Error(message);
                ^
Error: Command failed with exit code 1: esmo src/scripts/migrate-and-start.ts
    at makeError (file:///usr/app/node_modules/execa/lib/error.js:59:11)
    at handlePromise (file:///usr/app/node_modules/execa/index.js:119:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async file:///usr/app/src/scripts/run-with-database-url.ts:5:3 {
  shortMessage: 'Command failed with exit code 1: esmo src/scripts/migrate-and-start.ts',
  command: 'esmo src/scripts/migrate-and-start.ts',
  escapedCommand: 'esmo "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.```
codetheweb commented 2 years ago

Probably related to https://github.com/codetheweb/muse/issues/637.

See https://github.com/codetheweb/muse/pull/640.

codetheweb commented 2 years ago

This is fixed in https://github.com/codetheweb/muse/releases/tag/v2.0.0. Please reopen if you're still having issues.