Open ledlamp opened 1 month ago
Are you on 0.3.6? I fixed some ratelimit-related issues in the latest update. If not, try updating and let me know if you still run into this.
Yes, it is 0.3.6.
Got it, can you try 0.3.7-beta.0 and see if this continues to happen?
Still happening
Error: Failed to send messages.
at file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:1019:19
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Bot.sendMessages (file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:1016:26)
at async Bot.<anonymous> (file:///home/ubuntu/bskychatbot/index.mjs:61:3) {
[cause]: XRPCError: RateLimitExceeded > Rate Limit Exceeded
at RateLimitedAgent.request (file:///home/ubuntu/bskychatbot/node_modules/@atcute/client/dist/rpc.js:82:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Bot.sendMessages (file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:1016:26)
at async Bot.<anonymous> (file:///home/ubuntu/bskychatbot/index.mjs:61:3) {
status: 429,
kind: 'RateLimitExceeded',
description: 'Rate Limit Exceeded',
headers: {
'access-control-allow-origin': '*',
'cache-control': 'private',
'content-length': '61',
'content-type': 'application/json; charset=utf-8',
date: 'Sat, 26 Oct 2024 04:06:11 GMT',
etag: 'W/"3d-egyFOcXCrKQFzoI7522/4+PpxIk"',
'keep-alive': 'timeout=90',
'ratelimit-limit': '3000',
'ratelimit-policy': '3000;w=300',
'ratelimit-remaining': '2995',
'ratelimit-reset': '1729915865',
'strict-transport-security': 'max-age=63072000',
vary: 'Authorization, Accept-Encoding',
'x-powered-by': 'Express'
},
[cause]: undefined
}
}
Error: Failed to send messages.
at file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:1019:19
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Bot.sendMessages (file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:1016:26)
at async Bot.<anonymous> (file:///home/ubuntu/bskychatbot/index.mjs:61:3) {
[cause]: XRPCError: RateLimitExceeded > Rate Limit Exceeded
at RateLimitedAgent.request (file:///home/ubuntu/bskychatbot/node_modules/@atcute/client/dist/rpc.js:82:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Bot.sendMessages (file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:1016:26)
at async Bot.<anonymous> (file:///home/ubuntu/bskychatbot/index.mjs:61:3) {
status: 429,
kind: 'RateLimitExceeded',
description: 'Rate Limit Exceeded',
headers: {
'access-control-allow-origin': '*',
'cache-control': 'private',
'content-length': '61',
'content-type': 'application/json; charset=utf-8',
date: 'Sat, 26 Oct 2024 04:06:11 GMT',
etag: 'W/"3d-egyFOcXCrKQFzoI7522/4+PpxIk"',
'keep-alive': 'timeout=90',
'ratelimit-limit': '3000',
'ratelimit-policy': '3000;w=300',
'ratelimit-remaining': '2994',
'ratelimit-reset': '1729915865',
'strict-transport-security': 'max-age=63072000',
vary: 'Authorization, Accept-Encoding',
'x-powered-by': 'Express'
},
[cause]: undefined
}
}
Weird, I'll have to see if I can reproduce.
Can you give beta.1 a shot? Apologies, this is tough to pin down.
Fix is published in 0.3.7, let me know if you continue to run into this.
Happened again
2024-11-04T20:52:52.712Z,did:plc:icwasmy7mggrjaw4k5yam2nt,luizzeroxis,luizzeroxis.bsky.social,that before might not happen because you could assume people didnt see the thin
g at all at least
Error: Failed to send messages.
at file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:1017:19
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Bot.sendMessages (file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:1014:26)
at async Bot.<anonymous> (file:///home/ubuntu/bskychatbot/index.mjs:94:3) {
[cause]: XRPCError: RateLimitExceeded > Rate Limit Exceeded
at RateLimitedAgent.request (file:///home/ubuntu/bskychatbot/node_modules/@atcute/client/dist/rpc.js:82:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Bot.sendMessages (file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:1014:26)
at async Bot.<anonymous> (file:///home/ubuntu/bskychatbot/index.mjs:94:3) {
status: 429,
kind: 'RateLimitExceeded',
description: 'Rate Limit Exceeded',
headers: {
'access-control-allow-origin': '*',
'cache-control': 'private',
'content-length': '61',
'content-type': 'application/json; charset=utf-8',
date: 'Mon, 04 Nov 2024 20:52:56 GMT',
etag: 'W/"3d-egyFOcXCrKQFzoI7522/4+PpxIk"',
'keep-alive': 'timeout=90',
'ratelimit-limit': '3000',
'ratelimit-policy': '3000;w=300',
'ratelimit-remaining': '2950',
'ratelimit-reset': '1730753700',
'strict-transport-security': 'max-age=63072000',
vary: 'Authorization, Accept-Encoding',
'x-powered-by': 'Express'
},
[cause]: undefined
}
}
Error: Failed to send message.
at file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:968:19
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Bot.sendMessage (file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:956:26) {
[cause]: XRPCError: RateLimitExceeded > Rate Limit Exceeded
at RateLimitedAgent.request (file:///home/ubuntu/bskychatbot/node_modules/@atcute/client/dist/rpc.js:82:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Bot.sendMessage (file:///home/ubuntu/bskychatbot/node_modules/@skyware/bot/dist/bot/Bot.js:956:26) {
status: 429,
kind: 'RateLimitExceeded',
description: 'Rate Limit Exceeded',
headers: {
'access-control-allow-origin': '*',
'cache-control': 'private',
'content-length': '61',
'content-type': 'application/json; charset=utf-8',
date: 'Mon, 04 Nov 2024 20:52:56 GMT',
etag: 'W/"3d-egyFOcXCrKQFzoI7522/4+PpxIk"',
'keep-alive': 'timeout=90',
'ratelimit-limit': '3000',
'ratelimit-policy': '3000;w=300',
'ratelimit-remaining': '2949',
'ratelimit-reset': '1730753700',
'strict-transport-security': 'max-age=63072000',
vary: 'Authorization, Accept-Encoding',
'x-powered-by': 'Express'
},
[cause]: undefined
}
}
Version was 0.3.7-beta.1, but it's the same right?
Weird, the headers indicate you've still got 2950 requests remaining. What's the other process running on your server (i.e. is it also running @skyware bot? Is it only using chat endpoints or others as well?)
it's running in my house so the other client would be me using the bluesky chat
Actually, I'm on a different network with different IP so it must be just the bot but it still happens.
I'm using .sendMessages() with more than a dozen people, could it be that this rate limit is for the individual messages and not the HTTP requests? https://gitea.moe/lamp/bluesky-groupchat-bot/src/commit/da34c1012123a6f8d536a24625eec1d8b5cad975/index.mjs#L97
Well I don't know, I changed it to use separate sendMessage but it works the same.
I don't understand these ratelimit headers.. Policy is 3000 requests per 300 seconds? 2722 remaining? Quota resets in 1732343848 seconds? What?
That's a timestamp, not a length of time. Really not sure though, my best guess is that the chat service has its own rate limits that aren't actually being exposed — will need to ask about it.
Thought this library was supposed to handle rate limits but I got "Failed to send message(s)." errors after using bot.sendMessages() a bunch of times.