Quickstart failed on fresh mac

This error is keep occuring even if I delete mysql data and reinstall on my local mac. What might be the problem? Thanks in advance.

2019/10/01 09:29:51 Waiting for: tcp://mysql:3306
2019/10/01 09:29:51 Connected to tcp://mysql:3306
WARNING:py.warnings:/openedx/edx-platform/lms/djangoapps/courseware/__init__.py:5: DeprecationWarning: Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported
  warnings.warn("Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported", DeprecationWarning)

2019-10-01 09:31:36,813 WARNING 29 [enterprise.utils] utils.py:50 - Could not import Registry from third_party_auth.provider
2019-10-01 09:31:36,819 WARNING 29 [enterprise.utils] utils.py:51 - cannot import name _LTI_BACKENDS
System check identified some issues:

WARNINGS:
?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
	HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/1.11/ref/databases/#mysql-sql-mode
Operations to perform:
  Apply all migrations: admin, api_admin, assessment, auth, badges, block_structure, bookmarks, branding, bulk_email, catalog, celery_utils, certificates, commerce, completion, consent, content_type_gating, contentserver, contenttypes, cors_csrf, course_action_state, course_duration_limits, course_goals, course_groups, course_modes, course_overviews, courseware, crawlers, credentials, credit, dark_lang, database_fixups, degreed, django_comment_common, django_notify, django_openid_auth, djcelery, edx_oauth2_provider, edx_proctoring, edxval, email_marketing, embargo, enterprise, entitlements, experiments, external_auth, grades, instructor_task, integrated_channel, lms_xblock, microsite_configuration, milestones, mobile_api, notes, oauth2, oauth2_provider, oauth_dispatch, oauth_provider, organizations, programs, redirects, rss_proxy, sap_success_factors, schedules, self_paced, sessions, shoppingcart, site_configuration, sites, social_django, splash, static_replace, status, student, submissions, survey, teams, theming, third_party_auth, track, user_api, user_authn, util, verified_track_content, verify_student, video_config, video_pipeline, waffle, waffle_utils, wiki, workflow, xapi, xblock_django
Running migrations:
  Applying embargo.0001_initial...Traceback (most recent call last):
  File "./manage.py", line 123, in <module>
    execute_from_command_line([sys.argv[0]] + django_args)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 204, in handle
    fake_initial=fake_initial,
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 115, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/migration.py", line 129, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 97, in database_forwards
    schema_editor.create_model(model)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 319, in create_model
    self.execute(sql, params or None)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 136, in execute
    cursor.execute(sql, params)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/openedx/venv/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/openedx/venv/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
django.db.utils.OperationalError: (1050, "Table 'embargo_country' already exists")
Error: Command failed with status 1: docker-compose -f /Users/terguunzoregtiin/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local exec lms sh -e -c dockerize -wait tcp://mysql:3306 -timeout 20s
./manage.py lms --settings=tutor.production migrate

./manage.py lms --settings=tutor.production create_oauth2_client \
    "http://androidapp.com" "http://androidapp.com/redirect" public \
    --client_id android --client_secret xPiWWa6WVGAqoAjldjA7hkQL \
    --trusted

# 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

Hi @teruun! It’s quite strange that this error occurs again even if you delete the mysql data. Can you please describe the set of commands that you run to delete the mysql data? I suggest you do the following (same as a previous answer):

tutor local stop
sudo rm -rf $(tutor config printroot)/data/mysql
tutor local quickstart

I used this command, but still not work. The whole output is below. I something

==================================================
        Interactive platform configuration
==================================================
Your website domain name for students (LMS) [localhost] 
Your website domain name for teachers (CMS) [studio.localhost] 
Your platform name/title [My Open edX] 
Your public contact email address [contact@localhost] 
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. [y/N] N
Configuration saved to /Users/terguunzoregtiin/Library/Application Support/tutor/config.yml
================================================
        Updating the current environment
================================================
Environment generated in /Users/terguunzoregtiin/Library/Application Support/tutor/env
==============================================
        Stopping any existing platform
==============================================
docker-compose -f /Users/terguunzoregtiin/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local rm --stop --force
No stopped containers
=============================================
        HTTPS certificates generation
=============================================
HTTPS is not activated: certificate generation skipped
======================================================
        Starting the platform in detached mode
======================================================
docker-compose -f /Users/terguunzoregtiin/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local up --remove-orphans -d
Creating tutor_local_mongodb_1        ... done
Creating tutor_local_smtp_1           ... done
Creating tutor_local_elasticsearch_1  ... done
Creating tutor_local_openedx-assets_1 ... done
Creating tutor_local_memcached_1      ... done
Creating tutor_local_mysql_1          ... done
Creating tutor_local_rabbitmq_1       ... done
Creating tutor_local_cms_1            ... done
Creating tutor_local_forum_1          ... done
Creating tutor_local_cms_worker_1     ... done
Creating tutor_local_lms_1            ... done
Creating tutor_local_nginx_1          ... done
Creating tutor_local_lms_worker_1     ... done
================================================
        Database creation and migrations
================================================
Initialising all services...
docker-compose -f /Users/terguunzoregtiin/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local exec mysql sh -e -c echo "Initialising MySQL..."
mysql_connection_max_attempts=10
mysql_connection_attempt=0
until mysql -u root --password="04i4Anii" --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"

mysql -u root --password="04i4Anii" --host "mysql" --port 3306 -e 'CREATE DATABASE IF NOT EXISTS openedx;'
mysql -u root --password="04i4Anii" --host "mysql" --port 3306 -e 'GRANT ALL ON openedx.* TO "openedx"@"%" IDENTIFIED BY "6l4xZmjF";'
Initialising MySQL...
Warning: Using a password on the command line interface can be insecure.
MySQL is up and running
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
Initialising lms...
docker-compose -f /Users/terguunzoregtiin/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local exec lms sh -e -c dockerize -wait tcp://mysql:3306 -timeout 20s
./manage.py lms --settings=tutor.production migrate

./manage.py lms --settings=tutor.production create_oauth2_client \
    "http://androidapp.com" "http://androidapp.com/redirect" public \
    --client_id android --client_secret xPiWWa6WVGAqoAjldjA7hkQL \
    --trusted
    
# 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
2019/10/02 23:37:49 Waiting for: tcp://mysql:3306
2019/10/02 23:37:50 Connected to tcp://mysql:3306
WARNING:py.warnings:/openedx/edx-platform/lms/djangoapps/courseware/__init__.py:5: DeprecationWarning: Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported
  warnings.warn("Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported", DeprecationWarning)

2019-10-02 23:39:40,612 WARNING 27 [enterprise.utils] utils.py:50 - Could not import Registry from third_party_auth.provider
2019-10-02 23:39:40,683 WARNING 27 [enterprise.utils] utils.py:51 - cannot import name _LTI_BACKENDS
System check identified some issues:

WARNINGS:
?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
	HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/1.11/ref/databases/#mysql-sql-mode
Operations to perform:
  Apply all migrations: admin, api_admin, assessment, auth, badges, block_structure, bookmarks, branding, bulk_email, catalog, celery_utils, certificates, commerce, completion, consent, content_type_gating, contentserver, contenttypes, cors_csrf, course_action_state, course_duration_limits, course_goals, course_groups, course_modes, course_overviews, courseware, crawlers, credentials, credit, dark_lang, database_fixups, degreed, django_comment_common, django_notify, django_openid_auth, djcelery, edx_oauth2_provider, edx_proctoring, edxval, email_marketing, embargo, enterprise, entitlements, experiments, external_auth, grades, instructor_task, integrated_channel, lms_xblock, microsite_configuration, milestones, mobile_api, notes, oauth2, oauth2_provider, oauth_dispatch, oauth_provider, organizations, programs, redirects, rss_proxy, sap_success_factors, schedules, self_paced, sessions, shoppingcart, site_configuration, sites, social_django, splash, static_replace, status, student, submissions, survey, teams, theming, third_party_auth, track, user_api, user_authn, util, verified_track_content, verify_student, video_config, video_pipeline, waffle, waffle_utils, wiki, workflow, xapi, xblock_django
Running migrations:
  Applying embargo.0001_initial...Traceback (most recent call last):
  File "./manage.py", line 123, in <module>
    execute_from_command_line([sys.argv[0]] + django_args)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 204, in handle
    fake_initial=fake_initial,
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 115, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/migration.py", line 129, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 97, in database_forwards
    schema_editor.create_model(model)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 319, in create_model
    self.execute(sql, params or None)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 136, in execute
    cursor.execute(sql, params)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/openedx/venv/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/openedx/venv/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
django.db.utils.OperationalError: (1050, "Table 'embargo_country' already exists")
Error: Command failed with status 1: docker-compose -f /Users/terguunzoregtiin/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local exec lms sh -e -c dockerize -wait tcp://mysql:3306 -timeout 20s
./manage.py lms --settings=tutor.production migrate

./manage.py lms --settings=tutor.production create_oauth2_client \
    "http://androidapp.com" "http://androidapp.com/redirect" public \
    --client_id android --client_secret xPiWWa6WVGAqoAjldjA7hkQL \
    --trusted
    
# 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

What is the output of tutor config printvalue MYSQL_HOST?

output is just mysql

Hmmm I see that you are on a Mac and your tutor folder contains space characters. Please try again with quotes:

tutor local stop
sudo rm -rf "$(tutor config printroot)/data/mysql"
tutor local quickstart

I experienced a similar error output relating to mysql on a fresh install. I rebuilt openedx with tutor images build openedx and the instance launched without problems. Not sure why, but worth a try?

Yes, it works with quotes, don’t know there’s this difference in mac and linux terminal. Seems like zsh and iterm is much friendly than the default terminal.

Since regis’s solution solved my problem, I haven’t tried yours. But thank you.

There isn’t really a difference between mac/linux terminals – it’s just that the default tutor project root path ( /Users/terguunzoregtiin/Library/Application Support/tutor/) contains spaces on mac, and not on linux.

I triled eveything and it faile exactly t this step everytime, I ma trying to setup a dev env in my mac, following your docs. However, build does not go through quickstart. I locally rebuilt the image as advised

Exception as below:

Running migrations:
Applying contenttypes.0001_initial…Traceback (most recent call last):
File “./manage.py”, line 123, in
execute_from_command_line([sys.argv[0]] + django_args)
File “/openedx/venv/local/lib/python2.7/site-packages/django/core/management/init.py”, line 364, in execute_from_command_line
utility.execute()
File “/openedx/venv/local/lib/python2.7/site-packages/django/core/management/init.py”, line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py”, line 283, in run_from_argv
self.execute(*args, **cmd_options)
File “/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py”, line 330, in execute
output = self.handle(*args, **options)
File “/openedx/venv/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py”, line 204, in handle
fake_initial=fake_initial,
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/executor.py”, line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/executor.py”, line 145, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/executor.py”, line 244, in apply_migration
state = migration.apply(state, schema_editor)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/migration.py”, line 129, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/migrations/operations/models.py”, line 97, in database_forwards
schema_editor.create_model(model)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/schema.py”, line 319, in create_model
self.execute(sql, params or None)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/schema.py”, line 136, in execute
cursor.execute(sql, params)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py”, line 64, in execute
return self.cursor.execute(sql, params)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/utils.py”, line 94, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py”, line 62, in execute
return self.cursor.execute(sql)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py”, line 101, in execute
return self.cursor.execute(query, args)
File “/openedx/venv/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/openedx/venv/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.OperationalError: (2013, ‘Lost connection to MySQL server during query’)
Error: Command failed with status 1: docker-compose -f /Users/ghost/cbl/tutor/env/local/docker-compose.yml --project-name tutor_local exec lms sh -e -c dockerize -wait tcp://mysql:3306 -timeout 20s

export DJANGO_SETTINGS_MODULE=$SERVICE_VARIANT.envs.$SETTINGS
echo “Loading settings $DJANGO_SETTINGS_MODULE”

./manage.py lms migrate

./manage.py lms create_oauth2_client
http://androidapp.com” “http://androidapp.com/redirect” public
–client_id android --client_secret 1wGVe6hOalqcOlltogGYuFlV
–trusted

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

Hi,check if it is a memory issue, if your local machine has more than 4g memory, it might be your docker settings is set too little memory.

Not sure I just delete mysql data and did a quickstart and it worked.