From 8aba298c3b41c5e874c196fdd24f27b50a9daf0e Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 12 Nov 2024 13:31:54 -0500 Subject: [PATCH] fix: Don't build uwsgi with xml support. When uwsgi runs with xml support, it throws the following error on startup with the latest version of edx-platform: ``` xmlsec.InternalError: (-1, 'lxml & xmlsec libxml2 library version mismatch') ``` See https://github.com/xmlsec/python-xmlsec/issues/320 for more details on this. Essentially, the uWSGI wheel is built against a different version of libxml2 and it causes this version mismach error when trying to load xmlsec. The xml support in uWSGI is only needed for runing with xml configuration files, which tutor does not do. Following the guidance of the above issue, I updated the `openedx` Dockerfile to no longer compile with any xml support as a part of the build. The time to build uWSGI was only slightly more than building from cache so I'm not concerned about major slowdowns in the build time for un-cached builds. --- ...113_131448_feanil_fix_uwsgi_xml_issues_master.md | 13 +++++++++++++ tutor/templates/build/openedx/Dockerfile | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20241113_131448_feanil_fix_uwsgi_xml_issues_master.md diff --git a/changelog.d/20241113_131448_feanil_fix_uwsgi_xml_issues_master.md b/changelog.d/20241113_131448_feanil_fix_uwsgi_xml_issues_master.md new file mode 100644 index 0000000000..05edc22c2d --- /dev/null +++ b/changelog.d/20241113_131448_feanil_fix_uwsgi_xml_issues_master.md @@ -0,0 +1,13 @@ + + + + + +[Bugfix] Don't build uwsgi with XML support (by @feanil) diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index 621b463422..4ca2de9f46 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -94,8 +94,10 @@ RUN --mount=type=bind,from=edx-platform,source=/requirements/edx/base.txt,target pip install -r /openedx/edx-platform/requirements/edx/base.txt # Install extra requirements +# We don't need xml configuration support in uwsgi so don't install it. RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \ - pip install \ + UWSGI_PROFILE_OVERRIDE="xml=no" \ + pip install --no-cache-dir --compile \ # Use redis as a django cache https://pypi.org/project/django-redis/ django-redis==5.4.0 \ # uwsgi server https://pypi.org/project/uWSGI/