You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
collection.find() exits without throwing any error when user not found #343
This is what happens when running nodemon test.js:
[nodemon] starting `node test.js`
STARTING...
[nodemon] clean exit - waiting for changes before restart
This is very strange because the code never hits either one of: OK or ERROR or FINALLY - therefore I suspect that monk.find has to do a process.exit(0) somewhere inside.
In mongo's log I can find that the user was not found:
mongo_1 | {"t":{"$date":"2021-07-25T09:04:24.208+00:00"},"s":"I", "c":"ACCESS", "id":20249, "ctx":"conn34","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-1","speculative":false,"principalName":"mongo_user","authenticationDatabase":"database","remote":"172.19.0.3:56774","extraInfo":{},"error":"UserNotFound: Could not find user \"mongo_user\" for db \"database\""}}
mongo_1 | {"t":{"$date":"2021-07-25T09:04:24.212+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn33","msg":"Connection ended","attr":{"remote":"172.19.0.3:56772","connectionId":33,"connectionCount":1}}
However, should the code throw an exception in this case?
Activity