Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modules 5 and 6: Latest MongoDB container not compatible with reqests from results_server and survey_server. #57

Open
hilfigertout opened this issue Jun 7, 2023 · 0 comments

Comments

@hilfigertout
Copy link

The newest release of MongoDB does not support the queries made by the version of the Mongoose library in the results_server and survey_server in modules 5 and 6.

The containers start ok, but whenever attempting to submit a new entry from the form at localhost:8080, the survey_server crashes with the following error message:

MongoError: Unsupported OP_QUERY command: insert. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal

Attempting to visit localhost:3000 yields the error Cannot read property 'length' of undefined.

After some digging, it appears that these legacy opcodes were deprecated in MongoDB 5.0 and removed in MongoDB 6.0. While I can't find them mentioned in the index.js files, the database queries must be using these opcodes.

Possible Solutions:

  1. Set the version of the MongoDB container to 4.0, instead of using mongo:latest to pull it. Pull request Adjusted some types and avoided some mongo promise errors by choosing a docker mongo version instead of always picking the latest version #56 addresses this issue, though at time of writing it only modifies the README in module 5 and doesn't fix the docker_compose.yml file in module 6.
  2. Rewrite the code using the Mongoose library code with their newer methods. According to the warnings from the console, several methods from Mongoose are deprecated and should no longer be used.
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

No branches or pull requests

1 participant