Standard tutur install bundled binary, compiled on RHEL8, images are all loaded in the local docker CE instance. Doing a local run / init of tutor gives me :

ModuleNotFoundError: No module named ‘lms.envs.tutor.production’

2023/02/23 13:14:05 Ready: tcp://mysql:3306.
2023/02/23 13:14:05 Ready: tcp://mongodb:27017.
Loading settings lms.envs.tutor.production
Traceback (most recent call last):
File “./manage.py”, line 102, in
startup = importlib.import_module(edx_args.startup)
File “/opt/pyenv/versions/3.8.12/lib/python3.8/importlib/ init .py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 843, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/openedx/edx-platform/lms/startup.py”, line 10, in
settings.INSTALLED_APPS # pylint: disable=pointless-statement
File “/openedx/venv/lib/python3.8/site-packages/django/conf/ init .py”, line 82, in getattr
self._setup(name)
File “/openedx/venv/lib/python3.8/site-packages/django/conf/ init .py”, line 69, in _setup
self._wrapped = Settings(settings_module)
File “/openedx/venv/lib/python3.8/site-packages/django/conf/ init .py”, line 170, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File “/opt/pyenv/versions/3.8.12/lib/python3.8/importlib/ init .py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘lms.envs.tutor.production’

The config is generated with

/usr/local/bin/tutor config save --interactive

Any ideas on the cause / how to solve this ?

It looks may be from the logs, its encoding/decoding issue something may be to do with utf-8. hence the the single and double colon in the logs are not correct. instead of it should be " . and instead of it should be ' .

Can you just check the template files to confirm it’s based on the correct format.

You mean the files on the docker host, right ? The containers are run as-is, I didn’t touch them.
I’ll check the locale on the shell, that might be the issue. What is expected there ? UTF8 ?

The .yaml files and other .py essetinaly files in directory tutor config prinroot of which config.yml file and env directory.

I think UTF8 shall work, but might be other coding that would work as well.

Looks all good to me. It gets created in the Dockerfile, and it should get the data from ./env/apps/openedx/settings

I check all the .py files in there, all looks good to me. LANG is set to en_US.UTF-8, so that is also pretty normal. Any idea on how to start debugging this ?

did you check this file in particular

cat `tutor config printroot`/env/local/docker-compose.yml

can you check the value of DJANGO_SETTINGS_MODULE in that file it should be (cms.envs.tutor.production or/and lma.envs.tutor.production) depending on the service . In my case there was no qoutation around it

restart: unless-stopped volumes: - ../apps/openedx/settings/lms:/openedx/edx-platform/lms/envs/tutor:ro - ../apps/openedx/settings/cms:/openedx/edx-platform/cms/envs/tutor:ro - ../apps/openedx/config:/openedx/config:ro - ../../data/lms:/openedx/data - ../../data/openedx-media:/openedx/media image: docker.io/overhangio/openedx:15.3.0 environment: SERVICE_VARIANT: cms DJANGO_SETTINGS_MODULE: cms.envs.tutor.production UWSGI_WORKERS: 2 restart: unless-stopped volumes: - ../apps/openedx/settings/lms:/openedx/edx-platform/lms/envs/tutor:ro - ../apps/openedx/settings/cms:/openedx/edx-platform/cms/envs/tutor:ro - ../apps/openedx/config:/openedx/config:ro - ../../data/cms:/openedx/data - ../../data/openedx-media:/openedx/media

I somewhat get the idea that whatever actually defines lms.envs.tutor.production in Python isn’t properly working. I’ll do some more digging

It should be an ENV variable, python/django gets through ENV i.e inside the container you shall be something like

root@4ea0adff9e9e:/openedx/edx-platform# echo $DJANGO_SETTINGS_MODULE 
lms.envs.tutor.production
              

Humm…
So to my understanding edx-platform is based is a django app, following the logs above, you can trace it to this line