Problem with connection to db , queries hang. Reverting to mongoose 4.6.6 solves it
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
Downgrade Mongoose to Fix Database Query Hanging Issue
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
Identify the Current Mongoose Version
Check the current version of Mongoose being used in your project to confirm it is 4.7.7.
bashnpm list mongoose - 2
Uninstall Current Mongoose Version
Remove the existing version of Mongoose (4.7.7) from your project to prepare for the downgrade.
bashnpm uninstall mongoose - 3
Install the Stable Mongoose Version
Install Mongoose version 4.6.6, which is known to resolve the hanging query issue.
bashnpm install mongoose@4.6.6 - 4
Test Database Queries
Run your database queries again to ensure that they now return results without hanging.
javascriptProgram.find().then(results => console.log(results)).catch(err => console.error(err)); - 5
Monitor Application Behavior
Keep an eye on the application logs and behavior to ensure that the issue does not reoccur after the downgrade.
bashtail -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
Alex Chen
2450 rep