FG
๐Ÿ—„๏ธ DatabasesMongoDB

Problem with connection to db , queries hang. Reverting to mongoose 4.6.6 solves it

Freshabout 21 hours ago
Mar 14, 20260 views
Confidence Score65%
65%

Problem

Mongoose 4.7.7 Do you want to request a feature or report a bug? I want to report a bug What is the current behavior? All request towards the db just hang and do not return anything If the current behavior is a bug, please provide the steps to reproduce. [code block] All queries hang and return nothing `Program.find()` will just hang Fixed if I downgrade to mongoose@4.6.6 The change in 4.7.7 is a dependency version update muri@1.1.1 to muri@1.2.0. I am guessing that is was is causing the issue Please mention your node.js, mongoose and MongoDB version.* mongoose 4.7.7 node 6.9.2 MongoDB 3.2.3

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix โ€“ Awaiting Verification

Downgrade Mongoose to Fix Database Query Hanging Issue

Medium Risk

The issue arises from a change in the Mongoose dependency from muri@1.1.1 to muri@1.2.0 in version 4.7.7. This update may introduce compatibility issues or bugs that cause database queries to hang indefinitely, preventing any response from being returned.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Identify the Current Mongoose Version

    Check the current version of Mongoose being used in your project to confirm it is 4.7.7.

    bash
    npm list mongoose
  2. 2

    Uninstall Current Mongoose Version

    Remove the existing version of Mongoose (4.7.7) from your project to prepare for the downgrade.

    bash
    npm uninstall mongoose
  3. 3

    Install the Stable Mongoose Version

    Install Mongoose version 4.6.6, which is known to resolve the hanging query issue.

    bash
    npm install mongoose@4.6.6
  4. 4

    Test Database Queries

    Run your database queries again to ensure that they now return results without hanging.

    javascript
    Program.find().then(results => console.log(results)).catch(err => console.error(err));
  5. 5

    Monitor Application Behavior

    Keep an eye on the application logs and behavior to ensure that the issue does not reoccur after the downgrade.

    bash
    tail -f /path/to/your/logfile.log

Validation

Confirm that the database queries return results promptly without hanging. Check application logs for any errors or warnings related to database connections.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

mongoosemongodbodmneeds-clarification