overhangio / tutor

The Docker-based Open edX distribution designed for peace of mind
https://docs.tutor.overhang.io/
GNU Affero General Public License v3.0
928 stars 445 forks source link

Error: docker-compose is not installed. #156

Closed natea closed 5 years ago

natea commented 5 years ago

I ran the tutor local quickstart command, and it's complaining that docker-compose is not installed.

Steps to reproduce

Nathans-MacBook-Pro-2:Downloads nateaune$ ./tutor-osx local quickstart
==================================================
        Interactive platform configuration
==================================================
Your website domain name for students (LMS) [www.myopenedx.com]
Your website domain name for teachers (CMS) [studio.www.myopenedx.com]
Your platform name/title [My Open edX]
Your public contact email address [contact@www.myopenedx.com] nate@appsembler.com
The default language code for the platform [en]
Activate SSL/TLS certificates for HTTPS access? Important note:this will NOT work in a development environment. [yN]
Activate Student Notes service (https://open.edx.org/features/student-notes)? [yN]
Activate Xqueue for external grader services (https://github.com/edx/xqueue)? [yN]
Configuration saved to /Users/nateaune/Library/Application Support/tutor/config.yml
======================================
        Environment generation
======================================
Environment generated in /Users/nateaune/Library/Application Support/tutor
==============================================
        Stopping any existing platform
==============================================
Error: docker-compose is not installed. Please follow instructions from https://docs.docker.com/compose/install/

Unexpected behavior

I would expect that tutor could find docker-compose given that I installed Docker for Mac, which according to this page, already includes docker-compose. https://docs.docker.com/compose/install/

Additional info (IMPORTANT)

Nathans-MacBook-Pro-2:Downloads nateaune$ ./tutor-osx --version
Traceback (most recent call last):
  File "main", line 4, in <module>
  File "tutor/cli.py", line 21, in main
  File "click/core.py", line 764, in __call__
  File "click/core.py", line 716, in main
  File "click/core.py", line 641, in make_context
  File "click/core.py", line 1089, in parse_args
  File "click/core.py", line 940, in parse_args
  File "click/core.py", line 1477, in handle_parse_result
  File "click/core.py", line 96, in invoke_param_callback
  File "click/decorators.py", line 270, in callback
RuntimeError: Could not determine version
[1659] Failed to execute script main
regisb commented 5 years ago

Ok we have two major issues here.

  1. ./tutor --version just doesn't work (neither on Mac OS nor Linux).
  2. docker-compose cannot be found on Mac OS.

I think I can solve the first problem on my own, as I can reproduce the issue. However, I'm going to need your help with the second. Can you please paste the output of the following commands:

  1. which docker-compose
  2. python -c "import shutil; print(shutil.which('docker-compose'))"
  3. If neither commands return something, can you please try to find out where does the docker-compose binary come from?
natea commented 5 years ago

Here is the output of those two commands. I'll try to find out where the docker-compose binary lives. I installed Docker for Mac using brew cask install docker so that might have put it in a weird place?

Nathans-MacBook-Pro-2:Downloads nateaune$ python -c "import shutil; print(shutil.which('docker-compose'))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'which'
natea commented 5 years ago
Nathans-MacBook-Pro-2:Downloads nateaune$ which docker-compose

^^^ doesn't return anything when I run that command.

regisb commented 5 years ago

What about docker-compose --help?

natea commented 5 years ago

I hadn't gone through the entire Docker for Mac setup process (since I got a new computer). Once I completed that, then docker-compose was available on the path and the tutor install path proceeded without a problem.

natea commented 5 years ago

I'm not sure why this issue is related to the error ERROR 1130 (HY000): Host '172.18.0.9' is not allowed to connect to this MySQL server but here is the full traceback of this new error:

Nathans-MacBook-Pro-2:Downloads nateaune$ ./tutor-osx local quickstart
==================================================
        Interactive platform configuration
==================================================
Your website domain name for students (LMS) [www.myopenedx.com]
Your website domain name for teachers (CMS) [studio.www.myopenedx.com]
Your platform name/title [My Open edX]
Your public contact email address [nate@appsembler.com]
The default language code for the platform [en]
Activate SSL/TLS certificates for HTTPS access? Important note:this will NOT work in a development environment. [yN]
Activate Student Notes service (https://open.edx.org/features/student-notes)? [yN]
Activate Xqueue for external grader services (https://github.com/edx/xqueue)? [yN]
Configuration saved to /Users/nateaune/Library/Application Support/tutor/config.yml
======================================
        Environment generation
======================================
Environment generated in /Users/nateaune/Library/Application Support/tutor
==============================================
        Stopping any existing platform
==============================================
docker-compose -f /Users/nateaune/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local rm --stop --force
No stopped containers
====================================
        Docker image updates
====================================
docker-compose -f /Users/nateaune/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local pull
Pulling memcached      ... done
Pulling mongodb        ... done
Pulling mysql          ... done
Pulling elasticsearch  ... done
Pulling openedx-assets ... done
Pulling rabbitmq       ... done
Pulling smtp           ... done
Pulling forum          ... done
Pulling lms            ... done
Pulling cms            ... done
Pulling nginx          ... done
Pulling lms_worker     ... done
Pulling cms_worker     ... done
================================================
        Database creation and migrations
================================================
Initializing MySQL database...
docker-compose -f /Users/nateaune/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local up -d mysql
Creating network "tutor_local_default" with the default driver
Creating tutor_local_mysql_1 ... done
    waiting for creation of /Users/nateaune/Library/Application Support/tutor/data/mysql/mysql
MySQL database initialized
docker-compose -f /Users/nateaune/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local stop mysql
Stopping tutor_local_mysql_1 ... done
Creating lms/cms databases...
docker-compose -f /Users/nateaune/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local run --rm lms bash -e -c dockerize -wait tcp://mysql:3306 -timeout 20s
mysql -u root --password="NME7mivi" --host "mysql" -e 'CREATE DATABASE IF NOT EXISTS openedx;'
mysql -u root --password="NME7mivi" --host "mysql" -e 'GRANT ALL ON openedx.* TO "openedx"@"%" IDENTIFIED BY "NME7mivi";'
Starting tutor_local_mysql_1         ... done
Creating tutor_local_smtp_1          ... done
Creating tutor_local_rabbitmq_1      ... done
Creating tutor_local_elasticsearch_1 ... done
Creating tutor_local_memcached_1     ... done
Creating tutor_local_mongodb_1       ... done
Creating tutor_local_forum_1         ... done
2019/02/11 15:27:32 Waiting for: tcp://mysql:3306
2019/02/11 15:27:32 Connected to tcp://mysql:3306
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.9' is not allowed to connect to this MySQL server
Error: Command failed with status 1: docker-compose -f /Users/nateaune/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local run --rm lms bash -e -c dockerize -wait tcp://mysql:3306 -timeout 20s
mysql -u root --password="NME7mivi" --host "mysql" -e 'CREATE DATABASE IF NOT EXISTS openedx;'
mysql -u root --password="NME7mivi" --host "mysql" -e 'GRANT ALL ON openedx.* TO "openedx"@"%" IDENTIFIED BY "NME7mivi";'
regisb commented 5 years ago

Hi @natea! I made a mistake while rushing to fix existing issues, and I mistook issue #156 (this one) with #159. Both should be fixed in v3.0.2. Thanks a lot for your comments! It's a tremendous help to get feedback from other platforms and users.

Pt0lemaeus commented 1 year ago

I met same problem in15.0.1