Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GuildMembersTimeout - Members didn't arrive in time #9304

Closed
EbenKouao opened this issue Mar 30, 2023 · 3 comments
Closed

GuildMembersTimeout - Members didn't arrive in time #9304

EbenKouao opened this issue Mar 30, 2023 · 3 comments

Comments

@EbenKouao
Copy link

EbenKouao commented Mar 30, 2023

Which package is this bug report for?

discord.js

Issue description

  1. Call on the guild.members.fetch() with a large guild 30K+ members code: await guild. members.fetch();
  2. Expect Error: Members didn't arrive in time.\n at Timeout._onTimeout (/app/node_modules/discord.js/src/managers/GuildMemberManager.js:267:16)\n at listOnTimeout (node:internal/timers:569:17)\n at process.processTimers (node:internal/timers:512:7)"}

Having looked into similar issues, the common issue appears to be either:
1 Developer Portal: SERVER MEMBERS INTENT has not been enabled
2 GUILD_MEMBERS has not been included in the Intents
 
Source: #3774 (comment)
 
This error happens to occur intermittently, however, this error has significantly increased in frequency when updating to Discord.JS v14.8.0: https://github.com/discordjs/discord.js/releases

A similar thread suggested that a guild with a large amount of member could lead to a timeout. I would like to know if there is a better way to scale to fetch members of a large amount in a guild. Or is there any changes unknown when upgrading 14.8.0
 
The Error in question: https://github.dev/discordjs/discord.js/blob/db8df104c5e70a12f35b54e5f3f7c897068dde6f/packages/discord.js/src/managers/GuildMemberManager.js#L267-L268

Code sample

await guild. members.fetch();

Package version

14.8.0

Node.js version

18.15.0

Operating system

Linux

Priority this issue should have

High (immediate attention needed)

Which partials do you have configured?

Channel, GuildMember, Message, Reaction

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildVoiceStates, GuildMessages, GuildMessageReactions

I have tested this issue on a development release

No response

@Jiralite
Copy link
Member

Jiralite commented Mar 30, 2023

I tested this on a server with ~19,017 members and it took ~676.158 milliseconds to fetch (using your code sample):

console.time("fetch");
await guild.members.fetch();
console.timeEnd("fetch"); // fetch: 676.158ms

I attempted this about 20 times before commenting.

If you do not receive anything for 2 minutes, the Promise rejects. If a chunk is received, the timeout is refreshed. This is important because it means that you received nothing for 2 whole minutes rather than slowly receiving payloads for 2 minutes.

Are you sure this is not just a connectivity issue on your behalf? Regardless, you can increase the timeout, but I'm not sure that will resolve your issue. I'd be interested to see if anyone else is suddenly having this issue on 14.8.0 as some minor WebSocket changes were made...

@Jiralite
Copy link
Member

Jiralite commented Apr 1, 2023

@Jiralite Jiralite closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2023
@EbenKouao
Copy link
Author

EbenKouao commented Apr 3, 2023

Updating this issue for others who may face a similar issue.
The error appears to show when calling await guild.members.fetch() a high number of times.

Follow the thread on the DiscordJS Server:
https://discord.com/channels/222078108977594368/1091139218740363306/1091139218740363306

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants