Error [GUILD_MEMBERS_TIMEOUT] Members didn't arrive in time.

Hi, I'm getting this err when bot starts & it does not execute any event (including ready event) when this err arrives. It's not happening all the time.. err:
Error [GUILD_MEMBERS_TIMEOUT]: Members didn't arrive in time.
at Timeout._onTimeout (/home/booster-bot/booster-bot/node_modules/discord.js/src/managers/GuildMemberManager.js:454:16)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7) {
[Symbol(code)]: 'GUILD_MEMBERS_TIMEOUT'
}
Error [GUILD_MEMBERS_TIMEOUT]: Members didn't arrive in time.
at Timeout._onTimeout (/home/booster-bot/booster-bot/node_modules/discord.js/src/managers/GuildMemberManager.js:454:16)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7) {
[Symbol(code)]: 'GUILD_MEMBERS_TIMEOUT'
}
33 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
DiabolusGX
DiabolusGXOP3y ago
djs version - 13.6.0
chewie
chewie3y ago
you are missing the GUILD_MEMBERS intent
DiabolusGX
DiabolusGXOP3y ago
@thehairy Hi, sorry for late reply I have these intents:
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS
],
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS
],
and weird part is that it's not happening every time that error ^
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
조아오
조아오3y ago
This error can be thrown if the guild you are trying to fetch is too big And you have a slow connection https://discordjs.guide/popular-topics/errors.html#members-didn-t-arrive-in-time
MoonlightCapital
same error here, hmm i think it may be related to connection or something, but the discord status page doesn't say anything
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
MoonlightCapital
api issue ig
조아오
조아오3y ago
Guild.fetch() when fetching all members use the WS not the Api, it's a wierd behavior it not responding, since if the gateway isn't working I don't think only will fail the fetch but the whole connection instead
MoonlightCapital
I know, my bot seems to connect for a while (even sets playing status) but then goes offline with that error This started happening after a reboot because it wouldn't detect member joins/leaves
DiabolusGX
DiabolusGXOP3y ago
yes it is I saw this error multiple times when the bot starts and only when the bot starts... but not every time I did not completely understand this line but I think when bot goes online & fetches guilds & members to set cache it fails connection and ready event is not being called in these cases Bot's activity status is not updated (that is being set in ready event)
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
조아오
조아오3y ago
Do you, in anyway, fetch the members manually? Bc this is the only way this error is throw
https://github.com/discordjs/discord.js/search?q=GuildMembersTimeout
DiabolusGX
DiabolusGXOP3y ago
yes, I do I fetch guild member using id stored in db for vote reminder when the bot starts.. Also I fetch at some other places but I don't think they're relevant here
조아오
조아오3y ago
I fetch guild member using id stored in db for vote reminder when the bot starts.
Can you show the code?
DiabolusGX
DiabolusGXOP3y ago
조아오
조아오3y ago
Oh, your id My bad I'm talking about <Guild>.members.fetch() with no options Or just the time option
DiabolusGX
DiabolusGXOP3y ago
no i don't fetch guild anywhere, I read it from cache, as seen in above screenshot ^
조아오
조아오3y ago
Sorry See the edit lol
DiabolusGX
DiabolusGXOP3y ago
as far as I can remember I don't, lemme verify yes I do
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
DiabolusGX
DiabolusGXOP3y ago
I fetch all members when bot joins a server to see active boosters thanks 😄
조아오
조아오3y ago
Your bot might have been added to a fairly large server Like 100k members or more Thats what probably causing the issue Try setting the time option to smt bigger The default iirc is two minutes (in ms) Yeah 120e3 ms
DiabolusGX
DiabolusGXOP3y ago
okay, thanks for the help, I'll try this but I'm still confused that somehow bot does not responds to and msg or updates activity status when I restart it (rare but happens some times) I thought it was due to this err ^ but I guess these things are not related?
조아오
조아오3y ago
Also you can't fetch more than one guild member at the time If you seen fit You can add some type of async queue and error handler You can use the @sapphire/async-queue for this
DiabolusGX
DiabolusGXOP3y ago
Thanks a lot, I'll run async process for this.. Also, If I decide to run this async process every day for all guilds, do you think it should be an issue? thinKappa
조아오
조아오3y ago
There is a large_guild threshold on discord, on those giant guilds discord only sends online members on the ready event That might be the issue, uncached members I don't think you should fetch every member of all your guilds your bot is in everyday Try to restart as few as possible
DiabolusGX
DiabolusGXOP3y ago
how will un-cached members be an issue here?
조아오
조아오3y ago
The guild member update event will send an partial member on the first argument and a full member on the second And you cant fetch this old member
DiabolusGX
DiabolusGXOP3y ago
yes, that's what I thought but bot misses role remove events of un-cached members (partial event) and not able to detect if someone removed boost or it was some normal role removed.. I was planning to run a cron but this sounded bad in my head.. I'll try to come up with something else but I think issue occurs before ready event.. guild member update event is irrelevant in this case right?
조아오
조아오3y ago
Roles are always cached But you use roles to detect bosts? You can use the member properties They are more reliable
DiabolusGX
DiabolusGXOP3y ago
to detect boost remove event member who removed boost is not always cached
Want results from more Discord servers?
Add your server