I have an error when run tutor local quickstart with Tutor v.11.2.6. The error occurs in the part of Database creation and migrations when it tries to initialise the lms service. This is the first time I found this error and didn’t know how to solve it. I tried to remove the data folder but it didn’t work.
================================================
Database creation and migrations
================================================
Initialising all services...
docker-compose -f /home/park/.local/share/tutor/env/local/docker-compose.yml -f /home/park/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local -f /home/park/.local/share/tutor/env/local/docker-compose.jobs.yml run --rm mysql-job sh -e -c echo "Initialising MySQL..."
mysql_connection_max_attempts=10
mysql_connection_attempt=0
until mysql -u root --password="Mm78GTsQ" --host "mysql" --port 3306 -e 'exit'
do
mysql_connection_attempt=$(expr $mysql_connection_attempt + 1)
echo " [$mysql_connection_attempt/$mysql_connection_max_attempts] Waiting for MySQL service (this may take a while)..."
if [ $mysql_connection_attempt -eq $mysql_connection_max_attempts ]
then
echo "MySQL initialisation error" 1>&2
exit 1
fi
sleep 10
done
echo "MySQL is up and running"
# edx-platform database
mysql -u root --password="Mm78GTsQ" --host "mysql" --port 3306 -e 'CREATE DATABASE IF NOT EXISTS openedx;'
mysql -u root --password="Mm78GTsQ" --host "mysql" --port 3306 -e 'GRANT ALL ON openedx.* TO "openedx"@"%" IDENTIFIED BY "azxVhJyr";'
Starting tutor_local_mysql_1 ... done
Initialising MySQL...
mysql: [Warning] Using a password on the command line interface can be insecure.
MySQL is up and running
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
Initialising lms...
docker-compose -f /home/park/.local/share/tutor/env/local/docker-compose.yml -f /home/park/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local -f /home/park/.local/share/tutor/env/local/docker-compose.jobs.yml run --rm lms-job sh -e -c dockerize -wait tcp://mysql:3306 -timeout 20s
echo "Loading settings $DJANGO_SETTINGS_MODULE"
./manage.py lms migrate
# Delete obsolete credentials for Android application
./manage.py lms shell -c 'from oauth2_provider.models import get_application_model
get_application_model().objects.filter(name="android").exclude(user__username="login_service_user").delete()'
# Create oauth credentials for Android application
./manage.py lms create_dot_application \
--client-id android \
--client-secret NkO93ynRZuyYBmBYaucio7wE \
--grant-type password \
--public \
--update \
android \
login_service_user
# Fix incorrect uploaded file path
if [ -d /openedx/data/uploads/ ]; then
if [ -n "$(ls -A /openedx/data/uploads/)" ]; then
echo "Migrating LMS uploaded files to shared directory"
mv /openedx/data/uploads/* /openedx/media/
rm -rf /openedx/data/uploads/
fi
fi
# Create waffle switches to enable some features, if they have not been explicitly defined before
# Completion tracking: add green ticks to every completed unit
(./manage.py lms waffle_switch --list | grep completion.enable_completion_tracking) || ./manage.py lms waffle_switch --create completion.enable_completion_tracking on
Starting tutor_local_mysql_1 ... done
2021/04/20 09:40:08 Waiting for: tcp://mysql:3306
2021/04/20 09:40:08 Connected to tcp://mysql:3306
Loading settings lms.envs.tutor.production
Traceback (most recent call last):
File "./manage.py", line 119, in <module>
startup = importlib.import_module(edx_args.startup)
File "/opt/pyenv/versions/3.8.6/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/openedx/edx-platform/lms/startup.py", line 10, in <module>
settings.INSTALLED_APPS # pylint: disable=pointless-statement
File "/openedx/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 79, in __getattr__
self._setup(name)
File "/openedx/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module)
File "/openedx/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/opt/pyenv/versions/3.8.6/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/openedx/edx-platform/lms/envs/tutor/production.py", line 3, in <module>
from lms.envs.production import *
File "/openedx/edx-platform/lms/envs/production.py", line 69, in <module>
__config__ = yaml.safe_load(f)
File "/openedx/venv/lib/python3.8/site-packages/yaml/__init__.py", line 162, in safe_load
return load(stream, SafeLoader)
File "/openedx/venv/lib/python3.8/site-packages/yaml/__init__.py", line 114, in load
return loader.get_single_data()
File "/openedx/venv/lib/python3.8/site-packages/yaml/constructor.py", line 49, in get_single_data
node = self.get_single_node()
File "/openedx/venv/lib/python3.8/site-packages/yaml/composer.py", line 36, in get_single_node
document = self.compose_document()
File "/openedx/venv/lib/python3.8/site-packages/yaml/composer.py", line 55, in compose_document
node = self.compose_node(None, None)
File "/openedx/venv/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/openedx/venv/lib/python3.8/site-packages/yaml/composer.py", line 127, in compose_mapping_node
while not self.check_event(MappingEndEvent):
File "/openedx/venv/lib/python3.8/site-packages/yaml/parser.py", line 98, in check_event
self.current_event = self.state()
File "/openedx/venv/lib/python3.8/site-packages/yaml/parser.py", line 549, in parse_flow_mapping_key
raise ParserError("while parsing a flow mapping", self.marks[-1],
yaml.parser.ParserError: while parsing a flow mapping
in "/openedx/config/lms.env.json", line 1, column 1
expected ',' or '}', but got '<scalar>'
in "/openedx/config/lms.env.json", line 30, column 4
Error: Command failed with status 1: docker-compose -f /home/park/.local/share/tutor/env/local/docker-compose.yml -f /home/park/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local -f /home/park/.local/share/tutor/env/local/docker-compose.jobs.yml run --rm lms-job sh -e -c dockerize -wait tcp://mysql:3306 -timeout 20s
echo "Loading settings $DJANGO_SETTINGS_MODULE"
./manage.py lms migrate
# Delete obsolete credentials for Android application
./manage.py lms shell -c 'from oauth2_provider.models import get_application_model
get_application_model().objects.filter(name="android").exclude(user__username="login_service_user").delete()'
# Create oauth credentials for Android application
./manage.py lms create_dot_application \
--client-id android \
--client-secret NkO93ynRZuyYBmBYaucio7wE \
--grant-type password \
--public \
--update \
android \
login_service_user
# Fix incorrect uploaded file path
if [ -d /openedx/data/uploads/ ]; then
if [ -n "$(ls -A /openedx/data/uploads/)" ]; then
echo "Migrating LMS uploaded files to shared directory"
mv /openedx/data/uploads/* /openedx/media/
rm -rf /openedx/data/uploads/
fi
fi
# Create waffle switches to enable some features, if they have not been explicitly defined before
# Completion tracking: add green ticks to every completed unit
(./manage.py lms waffle_switch --list | grep completion.enable_completion_tracking) || ./manage.py lms waffle_switch --create completion.enable_completion_tracking on