LDAP Integration. ModuleNotFoundError: No module named 'user_settings.ldap_connection_settings'

Sorry for this question… but i’m have tried to find a solution by myself and tbh i’m lost.
I’ve copied and edited the file ldap_connection_settings.py in my docker volume.
in my case /var/lib/docker/volumes/mayan_app/_data/user_settings/
And when i start up the docker-compose i have the error:
ModuleNotFoundError: No module named ‘user_settings.ldap_connection_settings’
Any idea how i can fix it ?
Thank you by advence for your time.
Best Regards.


Error dump:
app_1 | During handling of the above exception, another exception occurred:
app_1 |
app_1 | Traceback (most recent call last):
app_1 | File “/opt/mayan-edms/bin/mayan-edms.py”, line 22, in
app_1 | main()
app_1 | File “/opt/mayan-edms/bin/mayan-edms.py”, line 18, in main
app_1 | execute_from_command_line(sys.argv)
app_1 | File “/opt/mayan-edms/lib/python3.9/site-packages/django/core/management/init.py”, line 419, in execute_from_command_line
app_1 | utility.execute()
app_1 | File “/opt/mayan-edms/lib/python3.9/site-packages/django/core/management/init.py”, line 413, in execute
app_1 | self.fetch_command(subcommand).run_from_argv(self.argv)
app_1 | File “/opt/mayan-edms/lib/python3.9/site-packages/django/core/management/init.py”, line 244, in fetch_command
app_1 | settings.INSTALLED_APPS
app_1 | File “/opt/mayan-edms/lib/python3.9/site-packages/django/conf/init.py”, line 82, in getattr
app_1 | self._setup(name)
app_1 | File “/opt/mayan-edms/lib/python3.9/site-packages/django/conf/init.py”, line 69, in _setup
app_1 | self._wrapped = Settings(settings_module)
app_1 | File “/opt/mayan-edms/lib/python3.9/site-packages/django/conf/init.py”, line 170, in init
app_1 | mod = importlib.import_module(self.SETTINGS_MODULE)
app_1 | File “/usr/lib/python3.9/importlib/init.py”, line 127, in import_module
app_1 | return _bootstrap._gcd_import(name[level:], package, level)
app_1 | File “”, line 1030, in _gcd_import
app_1 | File “”, line 1007, in _find_and_load
app_1 | File “”, line 984, in _find_and_load_unlocked
app_1 | ModuleNotFoundError: No module named ‘user_settings.ldap_connection_settings’

Hi there, saw there was no movement on this, and while I do not use ldap I may in the future so I thought I would reply.

First off did you get your settings file from the repo? Also are you using the docker compose method of install?



Hello DocCyblade
thank you for your answer.
Yes for both of your questions.
I use exactly the installation process who i’ve found here.
THank you for your time.

This error points to the issue that python is trying to load the file (because you set the MAYAN_SETTINGS_MODULE=user_settings.ldap_connection_settings in your env file. That would mean your file could not be read.

  1. Check your user permissions within the running container.
  2. Ensure the custom config file is where it should be.

Also what version of Mayan are trying to implement ldap on?

EDIT: Link was wrong, fixed that

yes totally, that’s what i supposed.

  1. -rw-r–r-- 1 root root 5539 Mar 1 09:02 ldap_connection_settings.py (and that’s my right on it.)
  2. In my installation the file is located here : /var/lib/docker/volumes/mayan_app/_data/user_settings/ldap_connection_settings.py

My mayan version is :

thank you very much for your time.

So I checked my setup, my permissions show 1000 as the user/group. This may be your issue.

drwxr-xr-x 3 1000 1000 4096 Feb 24 22:46 user_settings

For giggles try and change your files owner/group to 1000 and restart the containers
sudo chown 1000:1000 /var/lib/docker/volumes/mayan_app/_data/user_settings/ldap_connection_settings.py

Hello Thank you very much for your answer, sadly it’s does’nt work.
I will continue to investigate.
Thank you again for your time and sorry for the delay of answer.
Best regards.

What is your output of the following commands:
ls -l /var/lib/docker/volumes/mayan_app/_data/
ls -l /var/lib/docker/volumes/mayan_app/_data/user_settings/

Are you getting the same error, can’t import the ldap settings file?
Might be worth posting your ldap settings file too (just make sure you remove any passwords and organization specific info you don’t want on the interwebs

Just wondering if the user_settings permissions is right and is it setup to be a python module.