Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

307
Views
MongooseError: Operation `muted-members.insertOne()` buffering timed out after 10000ms

Please help me I want to make an Automute but I have a problem

When a muted user left the server the console gives me this error:

/Users/Fred/Desktop/Papera Bot/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:149
          const err = new MongooseError(message);
                      ^

MongooseError: Operation `muted-members.insertOne()` buffering timed out after 10000ms
    at Timeout.<anonymous> (/Users/badreddinelaghlid/Desktop/Papera Bot/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:149:23)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7)

then when the user join the server again the bot don't give the mute role to the user

I try to make this codes with mongoose

the schema code of the model:

const client = require("../index");
const Schema = require("../models/muted");

client.on("guildMemberAdd", async(member) => {
    const data = await Schema.findOne({Guild:member.guild.id});
    if (!data) return;
    const user = data.User.findIndex((prop) => prop === member.id);
    if (user == -1) return;
    let muteRole = message.guild.roles.cache.find(role => role.name === 'muted');

    member.roles.add(muteRole.id);
});

the code of guildMemberAdd:

const client = require("../index");
const Schema = require("../models/muted");

client.on("guildMemberAdd", async(member) => {
    const data = await Schema.findOne({Guild:member.guild.id});
    if (!data) return;
    const user = data.User.findIndex((prop) => prop === member.id);
    if (user == -1) return;
    let muteRole = message.guild.roles.cache.find(role => role.name === 'muted');

    member.roles.add(muteRole.id);
});

if you need any information from my code/bot to help me you can tell me guys

thanks for attention!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I had a similar issue sometime last year when I worked with Mongoose. I ran the .findOne query and I got this error MongooseError: Operation projects.findOne() buffering timed out after 10000ms

I found out I was missing the .exec() function which is supposed to execute the query. Added it and my query was executed.

You can read up on it on the Mongoose docs here: https://mongoosejs.com/docs/api.html#query_Query-exec

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!