Closed Zarvhos closed 1 week ago
Problem confirmed, thanks @Zarvhos for the detailed report. I am testing code changes necessary to update mongo/mongoose npm packages to the latest versions.
Fixes were published to the repo.
Thank you, @riclolsen, for the prompt fix. The BSONVersionError issue seems to be resolved now.
Best, Zarvhos
Description
We are experiencing issues with the
server_realtime_auth
backend service of thejson-scada
project. The problem manifests when performing certain actions (e.g., creating a new user or role) through thehtdocs-admin
page. The actions fail intermittently, and the following error is thrown:Steps to Reproduce
Expected Behavior
The actions such as creating new users or roles should execute without throwing errors related to BSON versions.
Technical Details
Running
npm list bson
reveals a version conflict between dependencies:The mongodb package is using bson@6.8.0, while mongoose is using bson@4.7.2. This discrepancy leads to the BSONVersionError.
Possible Solutions
1. Upgrade Mongoose Dependency: Ensure that mongoose is compatible with mongodb and its required BSON version. Refer to the MongoDB Server Version Compatibility matrix here: Mongoose Compatibility
2. Align BSON Versions: Ensure that all dependencies use the same bson version (preferably 6.x.x) to avoid conflicts.
3. Use overrides: In your package.json, use the overrides field to enforce a specific bson version for all dependencies. This can help ensure compatibility and avoid version conflicts.
(Personally I downgraded mongodb to 4.0.0, i'm still testing but the error has disapeared)
References
Mongoose Compatibility
Additional Context
This issue can potentially affect other actions involving BSON serialization/deserialization due to the version mismatch. It is critical to resolve this to ensure the stability and reliability of the server_realtime auth service. Also, this problem might intervene in
server_realtime
too, to be investigated.