Skip to content

Mongoose error with Buffering timeout when seeding database#10

Open
GregPetropoulos wants to merge 1 commit into
bradtraversy:mainfrom
GregPetropoulos:main
Open

Mongoose error with Buffering timeout when seeding database#10
GregPetropoulos wants to merge 1 commit into
bradtraversy:mainfrom
GregPetropoulos:main

Conversation

@GregPetropoulos

Copy link
Copy Markdown

When seeding the database running the npm run data:import command , an error surfaced MongooseError: Operation orders.deleteMany() buffering timed out after 10000ms.

Screenshot 2023-07-07 at 8 51 43 AM

The fix is I added await before the connectDB() function call in seeder.js

Screenshot 2023-07-07 at 8 51 18 AM

…rror MongooseError: Operation orders.deleteMany() buffering timed out after 10000ms. The fix is to add await before the connectDB function call in seeder.js
@HridoyHazard

Copy link
Copy Markdown

this is the only solution?

@elementWebDev elementWebDev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unneccesary since connectDB already awaits in the definition... see backend/config/db.js

I came across this issue as well when trying to seed data in local Mongo. I'm looking for an answer as well.

@DmytroLypovetskiy

DmytroLypovetskiy commented Jul 21, 2024

Copy link
Copy Markdown
Screenshot 2023-07-07 at 8 51 18 AM

TBH don't know how it works for you

await connectDB();
^^^^^

SyntaxError: await is only valid in async functions and the top level bodies of modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants