Closed toconnell closed 3 years ago
This issue was opened by a user: https://github.com/toconnell/kdm-manager/issues/539
This failure was obscured by the spam from the 404's that gets corrected in the next release...we've got to get that one out and into prod ASAFP.
Added automatic emailing on database failure:
@@ -122,6 +130,11 @@ def general_exception(exception):
API.logger.warn('Flask caught an unhandled exception!')
+ # in the criminal justice system, database failure is especially heinous
+ if isinstance(exception, pymongo.errors.ServerSelectionTimeoutError):
+ API.logger.error('The database is unavailable!')
+ utils.email_exception(exception)
+
if socket.getfqdn() != API.settings.get('server', 'prod_fqdn'):
err = "'%s' is not production! Raising exception..." % socket.getfqdn()
API.logger.warn(err)
The query that killed the db was this:
find { find: "survivors", filter: { name: { $nin: [ "-", "test", "Test", "TEST", "unknown", "U
nknown", "UNKNOWN", "Anonymous", "anonymous" ] }, dead: { $exists: false } }, sort: { created_on: -1 }, limit: 1
...looks like the most recent survivor query, which has been running every few minutes for years.
Gotta confirm that though.
Haven't had one of these in almost a year. Closing it out.
Here's the fault: