boly38 / botEnSky

BlueSky bot account that bring happiness to BlueSky users
https://bsky.app/profile/botensky.bsky.social
MIT License
0 stars 0 forks source link

Error on blsky login 500 #11

Closed boly38 closed 4 months ago

boly38 commented 4 months ago

On bluesky login issue 500, the bot dont catch the reject and the bot crash


[2024-05-23T20:20:00.017] [INFO] BlueSkyService - login botensky.bsky.social@https://bsky.social
[2024-05-23T20:20:10.503] [ERROR] BlueSkyService - XRPCError: Internal Server Error
    at ServiceClient.call (/opt/render/project/src/node_modules/@atproto/xrpc/dist/client.js:106:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async BskyAgent.login (/opt/render/project/src/node_modules/@atproto/api/dist/agent.js:214:25) {
  status: 500,
  error: 'InternalServerError',
  success: false,
  (...)
  [2024-05-23T20:20:10.504] [WARN] BotService - plugin response status:undefined msg:Failed to log in — double check your credentials and try again.
    node:_http_server:352
    throw new ERR_HTTP_INVALID_STATUS_CODE(originalStatusCode);
          ^
RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined
    at ServerResponse.writeHead (node:_http_server:352:11)
    at ServerResponse._implicitHeader (node:_http_server:338:8)
    at write_ (node:_http_outgoing:945:9)
    at ServerResponse.end (node:_http_outgoing:1056:5)
    at ServerResponse.send (/opt/render/project/src/node_modules/express/lib/response.js:233:10)
    at ServerResponse.json (/opt/render/project/src/node_modules/express/lib/response.js:279:15)
    at file:///opt/render/project/src/src/services/ExpressServer.js:85:58
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_HTTP_INVALID_STATUS_CODE'
boly38 commented 4 months ago

the second time (without 500 on login), the job succeed

boly38 commented 4 months ago

ExpressServer is trying to send status(undefined) in .catch(err => res.status(err.status)