Tutor (Nutmeg): mysql initialisatino error during quickstart

fresh edX installation, local/not a fork
tutor 14.0.5
docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1

Quickstart SEEMS to fail (no http page generated) but the mysql instance is running - the database just never appears to be initialised. Sorry if this is a rehash/known issue, but I’ve had zero luck searching for someone else with this problem. It may be a local docker config issue, but I can’t seem to run it down. Any thoughts where to start?

ps. Log below contains a warning and then an error…? b’PATH’?
[ the b'PATH variable is not set. Defaulting to a blank string ]

[ env cannot contain 'PATH' and b'PATH' keys ]

================================================
        Database creation and migrations
================================================
Initialising all services...
Running init task: hooks/mysql/init
docker-compose -f /home/gpowers/.local/share/tutor/env/local/docker-compose.yml -f /home/gpowers/.local/share/tutor/env/local/docker-compose.prod.yml -f /home/gpowers/.local/share/tutor/env/local/docker-compose.tmp.yml --project-name tutor_local -f /home/gpowers/.local/share/tutor/env/local/docker-compose.jobs.yml -f /home/gpowers/.local/share/tutor/env/local/docker-compose.jobs.tmp.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="wnvlLUS7" --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="wnvlLUS7" --host "mysql" --port 3306 -e "CREATE DATABASE IF NOT EXISTS openedx;"
mysql -u root --password="wnvlLUS7" --host "mysql" --port 3306 -e "CREATE USER IF NOT EXISTS '"'"'openedx'"'"';"
mysql -u root --password="wnvlLUS7" --host "mysql" --port 3306 -e "ALTER USER '"'"'openedx'"'"'@'"'"'%'"'"' IDENTIFIED BY '"'"'NC4z1IJF'"'"';"
mysql -u root --password="wnvlLUS7" --host "mysql" --port 3306 -e "GRANT ALL ON openedx.* TO '"'"'openedx'"'"'@'"'"'%'"'"';"'
Starting tutor_local_mysql_1 ... done
WARNING: The b'PATH' variable is not set. Defaulting to a blank string.
Traceback (most recent call last):
  File "./docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.25.0', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 72, in main
    command()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 128, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 896, in run
    run_one_off_container(
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1376, in run_one_off_container
    exit_code = call_docker(
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1498, in call_docker
    return subprocess.call(args, env=environment)
  File "/usr/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1636, in _execute_child
    for dir in os.get_exec_path(env))
  File "/usr/lib/python3.8/os.py", line 645, in get_exec_path
    raise ValueError(
ValueError: env cannot contain 'PATH' and b'PATH' keys
Error: Command failed with status 1: docker-compose -f /home/gpowers/.local/share/tutor/env/local/docker-compose.yml -f /home/gpowers/.local/share/tutor/env/local/docker-compose.prod.yml -f /home/gpowers/.local/share/tutor/env/local/docker-compose.tmp.yml --project-name tutor_local -f /home/gpowers/.local/share/tutor/env/local/docker-compose.jobs.yml -f /home/gpowers/.local/share/tutor/env/local/docker-compose.jobs.tmp.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="wnvlLUS7" --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="wnvlLUS7" --host "mysql" --port 3306 -e "CREATE DATABASE IF NOT EXISTS openedx;"
mysql -u root --password="wnvlLUS7" --host "mysql" --port 3306 -e "CREATE USER IF NOT EXISTS 'openedx';"
mysql -u root --password="wnvlLUS7" --host "mysql" --port 3306 -e "ALTER USER 'openedx'@'%' IDENTIFIED BY 'NC4z1IJF';"
mysql -u root --password="wnvlLUS7" --host "mysql" --port 3306 -e "GRANT ALL ON openedx.* TO 'openedx'@'%';"
Summary

tutor (Nutmeg) failed quickstart does not complete due to error in mysql initialisation.

This looks like an issue with docker-compose, not Tutor. You are running docker-compose==1.25.0, which dates back from 2019. I’m not sure this is the issue root cause, but please upgrade anyway.

Thanks - Got docker-compose working (hello-world) and the permissions appear correct for the non-elevated user. However, there still seems to be a permissions error with docker-compose-yml. There does not appear to be any help in the logs of either tutor or docker.

If Docker appears to be working, is there another way to troubleshoot Tutor’s installation? Feels a bit like I’m in a dark room stumbling around for a light switch here…

docker-compose -f /home/tutor/.local/share/tutor/env/local/docker-compose.yml -f /home/tutor/.local/share/tutor/env/local/docker-compose.prod.yml -f /home/tutor/.local/share/tutor/env/local/docker-compose.tmp.yml --project-name tutor_local stop ERROR: .PermissionError: [Errno 13] Permission denied: '/home/tutor/.local/share/tutor/env/local/docker-compose.yml' Error: Command failed with status 1: docker-compose -f /home/tutor/.local/share/tutor/env/local/docker-compose.yml -f /home/tutor/.local/share/tutor/env/local/docker-compose.prod.yml -f /home/tutor/.local/share/tutor/env/local/docker-compose.tmp.yml --project-name tutor_local stop

What are the permissions of the corresponding files and folders? To find out, paste here the output of the following commands:

ls -l /home/tutor/.local/share/tutor/env/local/docker-compose.yml
ls -l /home/tutor/.local/share/tutor/env/

Thanks for the response. I’d actually checked these, earlier. Mainly because… well, that’s the only thing I could think of for a “permissions error.” My suspicion is that something is fouled with the permissions inside of the YML file, but I don’t have a detailed log to tell me what’s occurring.

I have a second, ‘fresh,’ installation that is experiencing my original issue with MySQL - still don’t know what is occurring with a brand-new Docker and brand-new Tutor installation that I’m doing incorrectly. :slight_smile:

-rw-rw-r-- 1 tutor tutor 5776 Sep 28 10:06 /home/tutor/.local/share/tutor/env/local/docker-compose.yml

/home/tutor/.local/share/tutor/env/
drwxrwxr-x 5 tutor tutor 4096 Sep 28 09:58 apps
drwxrwxr-x 4 tutor tutor 4096 Sep 28 09:58 build
drwxrwxr-x 2 tutor tutor 4096 Sep 28 09:58 dev
drwxrwxr-x 2 tutor tutor 4096 Sep 28 09:58 k8s
-rw-rw-r-- 1 tutor tutor 1759 Sep 28 10:06 kustomization.yml
drwxrwxr-x 2 tutor tutor 4096 Sep 28 09:58 local
drwxrwxr-x 3 tutor tutor 4096 Sep 28 09:58 plugins
-rw-rw-r-- 1 tutor tutor    6 Sep 28 10:06 version

Actually, today I got same problem with fresh tutor package (14.1.2).

I got the same problem in mysql initialization. It is very strange because I’ve installed tutor several times already but this is the first I got mysql error.

I installed docker 20.10.21 and docker compose 2.12.2 on Ubuntu 22.04.

Anyone can help me solve this problem?

Thanks,