Why is it necessary to run tutor local launch
after installing and enabling a plugin?
I am automating tutor deployments from my pipeline and noticed in the browser that I was missing environment variable definitions required by plugins (tutor-mfe).
I basically only ran tutor local launch
once with the non-interactive flag in my pipeline then built up the tutor instance declaratively with a series of commands: adding config, plugins, enabling plugins etc. Then performed a tutor local reboot --detach
but it looks like I should really do a tutor local launch
(time consuming). This makes it less desirable to run automatically every time in my pipeline.
I’m assuming tutor local launch
retrieves any required configurations from the installed plugins. Not sure why the plugin command wouldn’t do this.
UPDATED
As I expected running tutor local launch
a second time doesn’t work. It broke my working tutor installation.
WARNINGS:
course_metadata.Course.collaborators: (fields.W340) null has no effect on ManyToManyField.
course_metadata.Degree.specializations: (fields.W340) null has no effect on ManyToManyField.
course_metadata.SearchDefaultResultsConfiguration.courses: (fields.W340) null has no effect on ManyToManyField.
course_metadata.SearchDefaultResultsConfiguration.programs: (fields.W340) null has no effect on ManyToManyField.
taxonomy.JobPostings.job: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
taxonomy.SkillsQuiz.skills: (fields.W340) null has no effect on ManyToManyField.
2024-02-05 21:59:55,637 INFO 22 [course_discovery.apps.core.management.commands.install_es_indexes] /openedx/discovery/course_discovery/apps/core/management/commands/install_es_indexes.py:18 - Attempting to establish initial connection to Elasticsearch host [http://elasticsearch:9200/]...
/openedx/venv/lib/python3.8/site-packages/elasticsearch/connection/base.py:208: ElasticsearchWarning: Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-minimal-setup.html to enable security.
warnings.warn(message, category=ElasticsearchWarning)
2024-02-05 21:59:56,223 INFO 22 [course_discovery.apps.core.management.commands.install_es_indexes] /openedx/discovery/course_discovery/apps/core/management/commands/install_es_indexes.py:21 - ...success!
2024-02-05 21:59:56,224 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:37 - Making sure alias [course_run] exists...
2024-02-05 21:59:58,323 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:46 - ...alias updated.
2024-02-05 21:59:58,324 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:37 - Making sure alias [learner_pathway] exists...
2024-02-05 21:59:58,706 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:46 - ...alias updated.
2024-02-05 21:59:58,706 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:37 - Making sure alias [course] exists...
2024-02-05 21:59:59,032 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:46 - ...alias updated.
2024-02-05 21:59:59,032 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:37 - Making sure alias [program] exists...
2024-02-05 21:59:59,329 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:46 - ...alias updated.
2024-02-05 21:59:59,329 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:37 - Making sure alias [person] exists...
2024-02-05 21:59:59,646 INFO 22 [course_discovery.apps.core.utils] /openedx/discovery/course_discovery/apps/core/utils.py:46 - ...alias updated.
System check identified some issues:
WARNINGS:
course_metadata.Course.collaborators: (fields.W340) null has no effect on ManyToManyField.
course_metadata.Degree.specializations: (fields.W340) null has no effect on ManyToManyField.
course_metadata.SearchDefaultResultsConfiguration.courses: (fields.W340) null has no effect on ManyToManyField.
course_metadata.SearchDefaultResultsConfiguration.programs: (fields.W340) null has no effect on ManyToManyField.
taxonomy.JobPostings.job: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
taxonomy.SkillsQuiz.skills: (fields.W340) null has no effect on ManyToManyField.
2024-02-05 22:00:03,179 INFO 36 [course_discovery.apps.core.management.commands.create_or_update_partner] /openedx/discovery/course_discovery/apps/core/management/commands/create_or_update_partner.py:134 - Partner created with code dev
System check identified some issues:
WARNINGS:
course_metadata.Course.collaborators: (fields.W340) null has no effect on ManyToManyField.
course_metadata.Degree.specializations: (fields.W340) null has no effect on ManyToManyField.
course_metadata.SearchDefaultResultsConfiguration.courses: (fields.W340) null has no effect on ManyToManyField.
course_metadata.SearchDefaultResultsConfiguration.programs: (fields.W340) null has no effect on ManyToManyField.
taxonomy.JobPostings.job: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
taxonomy.SkillsQuiz.skills: (fields.W340) null has no effect on ManyToManyField.
2024-02-05 22:00:06,349 INFO 50 [course_discovery.apps.core.management.commands.create_or_update_partner] /openedx/discovery/course_discovery/apps/core/management/commands/create_or_update_partner.py:134 - Partner created with code openedx
System check identified some issues:
WARNINGS:
course_metadata.Course.collaborators: (fields.W340) null has no effect on ManyToManyField.
course_metadata.Degree.specializations: (fields.W340) null has no effect on ManyToManyField.
course_metadata.SearchDefaultResultsConfiguration.courses: (fields.W340) null has no effect on ManyToManyField.
course_metadata.SearchDefaultResultsConfiguration.programs: (fields.W340) null has no effect on ManyToManyField.
taxonomy.JobPostings.job: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
taxonomy.SkillsQuiz.skills: (fields.W340) null has no effect on ManyToManyField.
2024-02-05 22:00:09,401 INFO 64 [course_discovery.apps.course_metadata.management.commands.refresh_course_metadata] /openedx/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py:134 - Command is not using threads to write data.
2024-02-05 22:00:09,403 INFO 64 [course_discovery.apps.course_metadata.management.commands.refresh_course_metadata] /openedx/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py:178 - Executing Loader CoursesApiDataLoader, url: http://best-edx.charite.de/api/courses/v1/
2024-02-05 22:00:09,510 INFO 64 [course_discovery.apps.course_metadata.management.commands.refresh_course_metadata] /openedx/venv/lib/python3.8/site-packages/backoff/_common.py:105 - Backing off run_loader(...) for 0.2s (requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: http://lms:8000/oauth2/access_token)
2024-02-05 22:00:09,753 INFO 64 [course_discovery.apps.course_metadata.management.commands.refresh_course_metadata] /openedx/venv/lib/python3.8/site-packages/backoff/_common.py:105 - Backing off run_loader(...) for 5.7s (requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: http://lms:8000/oauth2/access_token)
2024-02-05 22:00:15,428 ERROR 64 [course_discovery.apps.course_metadata.management.commands.refresh_course_metadata] /openedx/venv/lib/python3.8/site-packages/backoff/_common.py:120 - Giving up run_loader(...) after 3 tries (requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: http://lms:8000/oauth2/access_token)
2024-02-05 22:00:15,428 ERROR 64 [course_discovery.apps.course_metadata.management.commands.refresh_course_metadata] /openedx/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py:40 - CoursesApiDataLoader failed!
Traceback (most recent call last):
File "/openedx/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py", line 37, in execute_loader
run_loader()
File "/openedx/venv/lib/python3.8/site-packages/backoff/_sync.py", line 105, in retry
ret = target(*args, **kwargs)
File "/openedx/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py", line 34, in run_loader
return loader_class(*loader_args).ingest()
File "/openedx/discovery/course_discovery/apps/course_metadata/data_loaders/api.py", line 50, in __init__
super().__init__(partner, api_url, max_workers, is_threadsafe, enable_api)
File "/openedx/discovery/course_discovery/apps/course_metadata/data_loaders/__init__.py", line 36, in __init__
self.username = self.get_username_from_client(self.api_client)
File "/openedx/discovery/course_discovery/apps/course_metadata/data_loaders/__init__.py", line 46, in get_username_from_client
token = client.get_jwt_access_token()
File "/openedx/venv/lib/python3.8/site-packages/edx_rest_api_client/client.py", line 283, in get_jwt_access_token
self._ensure_authentication()
File "/openedx/venv/lib/python3.8/site-packages/edx_rest_api_client/client.py", line 262, in _ensure_authentication
oauth_access_token_response = get_and_cache_oauth_access_token(
File "/openedx/venv/lib/python3.8/site-packages/edx_rest_api_client/client.py", line 177, in get_and_cache_oauth_access_token
oauth_access_token_response = get_oauth_access_token(
File "/openedx/venv/lib/python3.8/site-packages/edx_rest_api_client/client.py", line 127, in get_oauth_access_token
response.raise_for_status() # Raise an exception for bad status codes.
File "/openedx/venv/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: http://lms:8000/oauth2/access_token
CommandError: One or more of the data loaders above failed.
Error: Command failed with status 1: docker compose -f /home/gitlab/interagent-tutor/tutor/env/local/docker-compose.yml -f /home/gitlab/interagent-tutor/tutor/env/local/docker-compose.prod.yml --project-name tutor_local -f /home/gitlab/interagent-tutor/tutor/env/local/docker-compose.jobs.yml run --rm discovery-job sh -e -c make migrate
# Development partners
./manage.py create_or_update_partner \
--site-id 1 \
--site-domain best-edx-discovery.charite.de:8381 \
--code dev \
--name "Open edX - development" \
--lms-url="http://lms:8000" \
--studio-url="http://cms:8000" \
--courses-api-url "http://best-edx.charite.de:8000/api/courses/v1/" \
--organizations-api-url "http://best-edx.charite.de:8000/api/organizations/v1/"
# Production partner
./manage.py create_or_update_partner \
--site-id 2 \
--site-domain best-edx-discovery.charite.de \
--code openedx \
--name "Open edX" \
--lms-url="http://lms:8000" \
--studio-url="http://cms:8000" \
--courses-api-url "http://best-edx.charite.de/api/courses/v1/" \
--organizations-api-url "http://best-edx.charite.de/api/organizations/v1/"
./manage.py refresh_course_metadata --partner_code=$DEFAULT_PARTNER_CODE
./manage.py update_index --disable-change-limit