Overhang.io

Create super user command failed

Now it worked, running the command 10 hours later is the solution :rofl:
Maybe yesterday there were some resources not been downloaded in docker due to the great firewall of CHINA. EVIL…
====above is update========
I’m struggling with this, and sadly, I don’t know how to resolve it. The platform works fine, so I think there’s no problem with mysql. But why it can’t be connected when creating superuser.
:disappointed_relieved:

And what should I supposed to do or search or learn looking at all this prompt? Just have no clue. Thanks in advance.

tutor local createuser --staff --superuser staff staff@example.com
docker-compose -f /Users/terguunzoregtiin/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local run --rm --entrypoint sh -e -c lms ./manage.py lms --settings=tutor.production manage_user --superuser --staff staff staff@example.com
./manage.py lms --settings=tutor.production changepassword staff
Starting tutor_local_elasticsearch_1 … done
Starting tutor_local_memcached_1 …
Starting tutor_local_rabbitmq_1 … done
Starting tutor_local_memcached_1 … done
Starting tutor_local_mongodb_1 … done
Starting tutor_local_mysql_1 … done
Starting tutor_local_forum_1 … done
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-07-12 17:08:12,813 WARNING 6 [enterprise.utils] utils.py:50 - Could not import Registry from third_party_auth.provider
2019-07-12 17:08:12,816 WARNING 6 [enterprise.utils] utils.py:51 - cannot import name _LTI_BACKENDS
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 327, in execute
self.check()
File “/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py”, line 359, in check
include_deployment_checks=include_deployment_checks,
File “/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py”, line 346, in _run_checks
return checks.run_checks(**kwargs)
File “/openedx/venv/local/lib/python2.7/site-packages/django/core/checks/registry.py”, line 81, in run_checks
new_errors = check(app_configs=app_configs)
File “/openedx/venv/local/lib/python2.7/site-packages/django/core/checks/model_checks.py”, line 30, in check_all_models
errors.extend(model.check(**kwargs))
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/models/base.py”, line 1284, in check
errors.extend(cls._check_fields(**kwargs))
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/models/base.py”, line 1359, in _check_fields
errors.extend(field.check(**kwargs))
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/models/fields/init.py”, line 913, in check
errors = super(AutoField, self).check(**kwargs)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/models/fields/init.py”, line 219, in check
errors.extend(self._check_backend_specific_checks(**kwargs))
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/models/fields/init.py”, line 322, in _check_backend_specific_checks
return connections[db].validation.check_field(self, **kwargs)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/mysql/validation.py”, line 49, in check_field
field_type = field.db_type(self.connection)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/models/fields/init.py”, line 644, in db_type
return connection.data_types[self.get_internal_type()] % data
File “/openedx/venv/local/lib/python2.7/site-packages/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py”, line 174, in data_types
if self.features.supports_microsecond_precision:
File “/openedx/venv/local/lib/python2.7/site-packages/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/mysql/features.py”, line 53, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5)
File “/openedx/venv/local/lib/python2.7/site-packages/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py”, line 385, in mysql_version
with self.temporary_connection() as cursor:
File “/usr/lib/python2.7/contextlib.py”, line 17, in enter
return self.gen.next()
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/base.py”, line 591, in temporary_connection
cursor = self.cursor()
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/base.py”, line 254, in cursor
return self._cursor()
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/base.py”, line 229, in _cursor
self.ensure_connection()
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
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/base/base.py”, line 213, in ensure_connection
self.connect()
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/base/base.py”, line 189, in connect
self.connection = self.get_new_connection(conn_params)
File “/openedx/venv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py”, line 274, in get_new_connection
conn = Database.connect(**conn_params)
File “/openedx/venv/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/openedx/venv/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 193, in init
super(Connection, self).init(*args, **kwargs2)
django.db.utils.OperationalError: (2003, “Can’t connect to MySQL server on ‘mysql’ (111)”)
Error: Command failed with status 1: docker-compose -f /Users/terguunzoregtiin/Library/Application Support/tutor/env/local/docker-compose.yml --project-name tutor_local run --rm --entrypoint sh -e -c lms ./manage.py lms --settings=tutor.production manage_user --superuser --staff staff staff@example.com
./manage.py lms --settings=tutor.production changepassword staff

It worked this morning without any specific reason.
Am I doing wrong yesterday? Is the create superuser command need to be executed when the tutor is stopped?

Glad to hear that it worked! According to the stack trace, the mysql server could not be found. Maybe the mysql container was overloaded? Did you run any other commands?

tutor is running, I run tutor local start in another terminal. Does that cause this problem?

Yes, it’s a problem: you shouldn’t try to launch two instances of the same platform on the same computer. Unexpected problems will occur (such as connectivity to the mysql database).