ERROR in edx-platform repo- (common.djangoapps.common_initialization.E001) LMS_ROOT_URL is not defined

i want to change accomplishment-rendering.html template in edx-platform directory for that i cloned the edx platform directory on my local then added it in my current tutor configuration using {tutor mounts add “path of edx platform repo“ }command and then run the tutir images build openedx command it shows this error .NOTE: i ahve already tried adding lms_root_url in config.yml file , still no luck .how can i fix this? - - AttributeError: ‘NoneType’ object has no attribute ‘startswith’

73.36 SystemCheckError: System check identified some issues:

73.36

73.36 ERRORS:

73.36 ?: (common.djangoapps.common_initialization.E001) LMS_ROOT_URL is not defined.

73.36

73.36 WARNINGS:

73.36 embargo.GlobalRestrictedCountry.country: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.

73.36 HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.

1 Like

Hi @Deepanshu_Kadam
I’m not particularly certain about those errors you’re getting, but as far as I’m aware it’s not strictly needed to fork/clone the entire platform repo for this, it should be enough to place the single html file into the matching path in your theme directory before rebuilding openedx.

Im getting the same error when building

@Deepanshu_Kadam @efortish can you provide like, a lot more detail? What are you doing? Are you using Tutor? Which version? Do you have fuller logs, and can you provide them in a code block rather than plaintext?

Hello @sarina @Deepanshu_Kadam

I was using python 3.11.13 and tutor main.
I already fixed it with a change, I don’t have the logs anymore :frowning:

  1. The main issue when we do the edx-platform mount is: LMS_ROOT_URL = None in edx-platform/openedx/envs/common.py, I just assigned a value and it worked.

I also found several errors when trying: tutor dev launch with main branch. (My team couldn’t get it to work either.)
I have more information about that, but is something related to tutor, so I’m not sure if this is the place to share our findings.

@efortish if this is a consistent error with Tutor, we can flag the @tutor-maintainers on this thread.

Hi @sarina i have fixed that issue, basically i assigned the value of root url in common.py file and it works

@sarina Perfect!.

Well my team and I were trying to get up a new main environment on our computers and we found this issues:

  1. When tutor local/dev launch is building MFE images the process fail showing this(sorry I just have screenshots not the entire log):

*How did I fix it? I just disabled the Indigo plugin, and that was enough.
*
2. Then another thing failed showing:

File "/openedx/venv/lib/python3.11/site-packages/django/conf/__init__.py", line 81, in __getattr__ self._setup(name) File "/openedx/venv/lib/python3.11/site-packages/django/conf/__init__.py", line 68, in _setup self._wrapped = Settings(settings_module) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openedx/venv/lib/python3.11/site-packages/django/conf/__init__.py", line 166, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/pyenv/versions/3.11.8/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1204, in _gcd_import File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/openedx/edx-platform/lms/envs/tutor/development.py", line 113, in <module> INSTALLED_APPS.remove("lms.djangoapps.coursewarehistoryextended") ValueError: list.remove(x): x not in list

How did I fix it? I added this code at tutor/tutor/templates/apps/openedx/settings/partials/common_all.py#109

if "lms.djangoapps.coursewarehistoryextended" in INSTALLED_APPS: INSTALLED_APPS.remove("lms.djangoapps.coursewarehistoryextended")

3.Then I received this other related problem:

return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1204, in _gcd_import File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/openedx/edx-platform/lms/envs/tutor/development.py", line 115, in <module> DATABASE_ROUTERS.remove( ValueError: list.remove(x): x not in list exit status

How did I fix it? I added this code at tutor/tutor/templates/apps/openedx/settings/partials/common_all.py#111

if "openedx.core.lib.django_courseware_routers.StudentModuleHistoryExtendedRouter" in DATABASE_ROUTERS:
DATABASE_ROUTERS.remove( "openedx.core.lib.django_courseware_routers.StudentModuleHistoryExtendedRouter" )

  1. After that, I received this:
 File "/opt/pyenv/versions/3.11.8/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/openedx/edx-platform/lms/envs/tutor/development.py", line 162, in <module>
    from django.utils.deprecation import RemovedInDjango50Warning, RemovedInDjango51Warning
ImportError: cannot import name 'RemovedInDjango50Warning' from 'django.utils.deprecation' (/openedx/venv/lib/python3.11/site-packages/django/utils/deprecation.py)

And also received another one related to RemovedInDjango51Warning.

How did I fix it? I removed lines: 158 160 and 161 in tutor/tutor/templates/apps/openedx/settings/partials/common_all.py

After all this changes the tutor dev launch worked.
I think this is not the optimal behavior of tutor main so that’s why I considered to share it with you.
We were investigating this with @mgmdi

@tutor-maintainers

The Tutor main build currently fails with Indigo enabled. This is also reported here: https://github.com/overhangio/tutor/issues/1249. Temporarily, you can make it work by disabling Indigo with tutor plugins disable indigo while we work on incorporating design tokens.

As for the import errors you mentioned some were fixed here.

This error is likely originating from a change to the settings in edx-platform. There was a PR merged into Tutor to fix this issue, so please update Tutor to grab the latest commits.

That PR did not seem to solve the issue for me. I still had to do what was said above:
”The main issue when we do the edx-platform mount is: LMS_ROOT_URL = None in edx-platform/openedx/envs/common.py, I just assigned a value and it worked.”

I am on tutor, version 20.0.2. I also confirmed that the code in that PR is on the main branch on my local.

I should clarify that the changes introduced to Tutor in this PR are not expected in any of the 20.x.x releases (see Tutor versioning). v20 of Tutor is compatible with the Teak release of Open edX, and the setting changes to edx-platform in this PR were introduced after the Teak release.

If you are working with edx-platform on the master branch, it is recommended to install “Tutor Main” rather than a release version of Tutor.

Thank you for the additional info! Using tutor on its main branch and edx-platform on the master branch solved it for me today without the workaround!