Skip to content

Handle mongodb auth errors that may occur after running the server for a while #4576

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

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

flovilmart
Copy link
Contributor

It has been noticed on our production servers that the mongo driver is flaky on the current version, and at one point may completely loose it's mind in terms of authentication

{ MongoError: not authorized on DB_NAME to execute command { find: "ClassName", filter: { _id: "XXXXXX", _rperm: { $in: [ null, "*", "XXXXXXX" ] } }, sort: {}, projection: {}, maxTimeMS: 60000 } 

This PR attempts to workaround the issue by re-creating the connection.

@dplewis
Copy link
Member

dplewis commented Feb 19, 2018

Can you add a fix to #4575 here?

It has unhandled promise rejections as well.

@flovilmart
Copy link
Contributor Author

I won’t add the fix for the health endpoint here as it’s a complete new feature

@codecov
Copy link

codecov bot commented Feb 19, 2018

Codecov Report

Merging #4576 into master will decrease coverage by 0.2%.
The diff coverage is 61.9%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4576      +/-   ##
=========================================
- Coverage   92.91%   92.7%   -0.21%     
=========================================
  Files         118     118              
  Lines        8491    8527      +36     
=========================================
+ Hits         7889    7905      +16     
- Misses        602     622      +20
Impacted Files Coverage Δ
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 90.85% <61.9%> (-4.69%) ⬇️
src/RestWrite.js 93.28% <0%> (-0.19%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 97.11% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b754d51...f180cfc. Read the comment docs.

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

Successfully merging this pull request may close these issues.

2 participants