From 37f9de8b9b11e8dd1b54452531aa708e16517c6d Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 5 Aug 2022 01:54:08 +0300 Subject: [PATCH] Try 2 to fix missing variable in WeKan fails to get MongoDB server version. Thanks to simon816 and xet7 ! Fixes #4596 --- server/statistics.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/server/statistics.js b/server/statistics.js index 9927717a7..745c1c47e 100644 --- a/server/statistics.js +++ b/server/statistics.js @@ -86,14 +86,11 @@ if (Meteor.isServer) { mongoOplogEnabled = oplogEnabled; } catch (e) { try { - if (mongo === undefined) { - mongoVersion = 'unknown'; - } else { - const { version } = Promise.await( - mongo.db.command({ buildinfo: 1 }), - ); - mongoVersion = version; - } + const { mongo } = MongoInternals.defaultRemoteCollectionDriver(); + const { version } = Promise.await( + mongo.db.command({ buildinfo: 1 }), + ); + mongoVersion = version; mongoStorageEngine = 'unknown'; } catch (e) { mongoVersion = 'unknown';