0

"Operation users.findOne() buffering timed out after 10000ms. Operation products.distinct() buffering timed out after 10000m."

I'm not succeeding in solving this error, I've been stuck here for more than a week now:(

The backend is not working at all when deploying my app to Heroku (locally it works fine). I'm using MERN.

I'm really frustrated because of this problem, I'm so close to getting my app to production but this is making it impossible.

If anyone could give me a hand I would really appreciate it, and if you'd like to see any other file just let me know!

Sever.js

import express from 'express';
import mongoose from 'mongoose';
import dotenv from 'dotenv';
import path from 'path';

dotenv.config();

const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
mongoose.connect(`mongodb+srv://${process.env.DB_USER}:${process.env.DB_PASS}@name.0xzkc.mongodb.net/${process.env.DB_NAME}?retryWrites=true&w=majority&ssl=true`,{
  useNewUrlParser: true,
  useUnifiedTopology: true,
  useCreateIndex: true,
}).then(console.log('working'));

app.use('/api/uploads', uploadRouter);
app.use('/api/users', userRouter);
app.use('/api/products', productRouter);
app.use('/api/orders', orderRouter);
pop
  • 217
  • 1
  • 3
  • 11
  • https://stackoverflow.com/questions/65408618/mongooseerror-operation-users-findone-buffering-timed-out-after-10000ms – raina77ow Jun 18 '21 at 07:17
  • Does this answer your question? [MongooseError - Operation \`users.findOne()\` buffering timed out after 10000ms](https://stackoverflow.com/questions/65408618/mongooseerror-operation-users-findone-buffering-timed-out-after-10000ms) – thelovekesh Jun 18 '21 at 14:09
  • @LovekeshKumar hey there. not really, i've seen that and I tried everything but I didn't succeed :( – pop Jun 18 '21 at 14:53

0 Answers0