From 06ad1978a49eb142d3f5a3257fcdb682f54f1551 Mon Sep 17 00:00:00 2001 From: Paulo Viadanna Date: Tue, 26 Sep 2023 17:42:56 -0300 Subject: [PATCH] fix: adds mongodb connect=False Adding connect=False to the LMS and CMS' MongoDB connection to prevent ServerSelectionError after a cluster failover. --- changelog.d/20231003_144841_paulo_mongodb_connect.md | 1 + tutor/templates/apps/openedx/settings/partials/common_all.py | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelog.d/20231003_144841_paulo_mongodb_connect.md diff --git a/changelog.d/20231003_144841_paulo_mongodb_connect.md b/changelog.d/20231003_144841_paulo_mongodb_connect.md new file mode 100644 index 0000000000..0f3cb5d50d --- /dev/null +++ b/changelog.d/20231003_144841_paulo_mongodb_connect.md @@ -0,0 +1 @@ +[Improvement] Adds `connect=False` to the LMS and CMS' MongoDB connection to prevent `ServerSelectionError` after a cluster failover. (by @open-craft) diff --git a/tutor/templates/apps/openedx/settings/partials/common_all.py b/tutor/templates/apps/openedx/settings/partials/common_all.py index 46a563df66..b02cff42ac 100644 --- a/tutor/templates/apps/openedx/settings/partials/common_all.py +++ b/tutor/templates/apps/openedx/settings/partials/common_all.py @@ -12,6 +12,7 @@ "user": {% if MONGODB_USERNAME %}"{{ MONGODB_USERNAME }}"{% else %}None{% endif %}, "password": {% if MONGODB_PASSWORD %}"{{ MONGODB_PASSWORD }}"{% else %}None{% endif %}, # Connection/Authentication + "connect": False, "ssl": {{ MONGODB_USE_SSL }}, "authsource": "{{ MONGODB_AUTH_SOURCE }}", "replicaSet": {% if MONGODB_REPLICA_SET %}"{{ MONGODB_REPLICA_SET }}"{% else %}None{% endif %},