Ldap module issue when using base image: indico:latest OR v.3.3.7

Hi,

We have been using same command in Dockerfile to build indico image for installing ldap module for based image v3.3.6 and below and worked fine, however when using base images 3.3.7 or latest when running application in kubernetes we get the error as seen futher below

Dockerfile:

FROM getindico/indico:3.3.7
USER root
RUN apt-get update && \
    apt-get -y install gcc libsasl2-dev libldap2-dev libssl-dev libpq-dev
# Install python-ldap
USER indico
RUN pip install python-ldap
RUN pip install --upgrade pip

logs from indico deployment inside a container

File "<frozen importlib.\_bootstrap>", line 488, in \_call_with_frames_removed
  File "/opt/indico/.venv/lib/python3.12/site-packages/flask_multipass/providers/ldap/__init__.py", line 7, in <module>
    from flask_multipass.providers.ldap.providers import (
  File "/opt/indico/.venv/lib/python3.12/site-packages/flask_multipass/providers/ldap/providers.py", line 10, in <module>
    from ldap import INVALID_CREDENTIALS

logging into container, it does show that ldap python-ldap is installed, but the error above is still persistent.

indico@indico-95fbf8b67-cx25p:~$ pip show python-ldap
Name: python-ldap
Version: 3.4.4
Summary: Python modules for implementing LDAP clients
Home-page: https://www.python-ldap.org/
Author: python-ldap project
Author-email: python-ldap@python.org
License: Python style
Location: /opt/indico/.local/lib/python3.12/site-packages
Requires: pyasn1, pyasn1_modules
Required-by:
indico@indico-95fbf8b67-cx25p:~$

I am newbie for containerisation and in particular I am not a programmer but I tried also using following in Dockerfile:

RUN pip install python3-ldap, but still no luck.

Can someone please help..!! thanks in advance.

Try /opt/indico/.venv/bin/pip install ... to install it in the correct environment.