benetherington / node-TOM-discord-bot

MIT License
2 stars 0 forks source link

Fix bug in add suggestion by ID #30

Closed benetherington closed 2 years ago

benetherington commented 2 years ago

Incomplete log. Crashes server.

    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async ButtonInteraction.update (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:214:5) {
  method: 'post',
  path: '/interactions/962756702481027102/aW50ZXJhY3Rpb246OTYyNzU2NzAyNDgxMDI3MTAyOnd5UTRTUlp5dmxMT1BCbXo5dklyM3kyTUQ5cjY5dzVQVHlNYmpVS1NiMTVPSzUyOUEyUjkxd2Z1UTlvUXFOMHJEOWdFQjNxV0xhTjltRTcxaXJla2R6c2FOZWNmbUQ3QWhWb1hXNk1nOFVscnVOeU56ZmdWOVlxcE9aMWYyaWhT/callback',
  code: 50035,
  httpStatus: 400,
  requestData: {
    json: {
      type: 7,
      data: {
        content: undefined,
        tts: false,
        nonce: undefined,
        embeds: undefined,
        components: [ { components: [Array], type: 1 } ],
        username: undefined,
        avatar_url: undefined,
        allowed_mentions: undefined,
        flags: undefined,
        message_reference: undefined,
        attachments: undefined,
        sticker_ids: undefined
      }
    },
    files: []
  }
}
.env: line 5: T!@D@u!zBoMSQV: command not found
.env: line 5: H44: command not found
benetherington commented 2 years ago
/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/jsonwebtoken/verify.js:53
    return done(new JsonWebTokenError('jwt must be provided'));
                ^
JsonWebTokenError: jwt must be provided
    at Object.module.exports [as verify] (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/jsonwebtoken/verify.js:53:17)
at verifyToken (/app/src/sqlite/admin.js:94:30)
at module.exports.getAdminByToken (/app/src/sqlite/admin.js:120:19)
at module.exports.getAdminFromTokenOrRedirect (/app/src/routes/loginUtilities.js:9:25)
at Object.<anonymous> (/app/src/routes/monitor.js:20:9)
    at preHandlerCallback (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/fastify/lib/handleRequest.js:126:28)
    at preValidationCallback (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/fastify/lib/handleRequest.js:109:5)
    at handler (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/fastify/lib/handleRequest.js:72:7)
    at handleRequest (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/fastify/lib/handleRequest.js:20:5)
    at runPreParsing (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/fastify/lib/route.js:451:5)
.env: line 5: T!@D@u!zBoMSQV: command not found
.env: line 5: H44: command not found
benetherington commented 2 years ago
{"level":30,"time":1649616513220,"pid":956,"hostname":"9ee5b78063a2","reqId":"req-3y5","res":{"statusCode":200},"responseTime":1.9481773376464844,"msg":"request completed"}
/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/discord.js/src/rest/RequestHandler.js:350
      throw new DiscordAPIError(data, res.status, request);
            ^
DiscordAPIError: Invalid Form Body
components[0].components[0].custom_id: A custom id is required
components[0].components[1].custom_id: A custom id is required
components[0].components[2].custom_id: A custom id is required
components[0].components[3].custom_id: A custom id is required
components[0].components[4].custom_id: A custom id is required
    at RequestHandler.execute (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async ButtonInteraction.update (/rbd/pnpm-volume/1c3f4846-cb24-4db9-9b9d-30d0fb6a0f60/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:214:5) {
  method: 'post',
  path: '/interactions/962786180133445642/aW50ZXJhY3Rpb246OTYyNzg2MTgwMTMzNDQ1NjQyOmQ5QVJaM0VDNk5RakdaZ1UyYk5yd1R1amp6ZXBVQ0Y0cnNBcVUzTm81TVdrNUcwYlhvbjludTVhTWxtdUw4NFdxV2x0S1REd0VnMkNJd0FGOG44YVhqWWVmWnZnV1JsZ0RmUUh1cVN5Z0VBZ0x1VThlbmdaeFlJUm1jU3VvczRI/callback',
  code: 50035,
  httpStatus: 400,
  requestData: {
    json: {
      type: 7,
      data: {
        content: undefined,
        tts: false,
        nonce: undefined,
        embeds: undefined,
        components: [ { components: [Array], type: 1 } ],
        username: undefined,
        avatar_url: undefined,
        allowed_mentions: undefined,
        flags: undefined,
        message_reference: undefined,
        attachments: undefined,
        sticker_ids: undefined
      }
    },
    files: []
  }
}
.env: line 5: T!@D@u!zBoMSQV: command not found
.env: line 5: H44: command not found
SQLite
benetherington commented 2 years ago

Wouldja look at that, glitch is happy to log partial contents of .env, even when they're syntactically correct and interpreted properly elsewhere. Those are parts of one of the auth secrets.

benetherington commented 2 years ago

Opened bugvix/#30, but was unable to reproduce. However, 95c290591d957a854676a5f6827169ebc8c4bd6f was the result of a change to permissions requirements in the Discord API. This will be cherry-picked into main.