Bug 1234250
| Summary: | horizon manage.py syncdb errors on "App 'openstack_auth' doesn't have a 'user' model." | ||
|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | Matthias Runge <mrunge> |
| Component: | python-django-openstack-auth | Assignee: | Matthias Runge <mrunge> |
| Status: | CLOSED ERRATA | QA Contact: | Ido Ovadia <iovadia> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.0 (Kilo) | CC: | js, mrunge, yeylon |
| Target Milestone: | ga | Keywords: | Triaged |
| Target Release: | 7.0 (Kilo) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | python-django-openstack-auth-1.2.0-3.el7ost | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1232683 | Environment: | |
| Last Closed: | 2015-08-05 13:28:04 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1232683 | ||
| Bug Blocks: | |||
|
Description
Matthias Runge
2015-06-22 07:51:45 UTC
Failed: python-django-openstack-auth-1.2.0-3.el7ost.noarch
===========================================================
Traceback (most recent call last):
File "manage.py", line 23, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
output = self.handle(*args, **options)
File "/usr/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 34, in handle
if not UserModel._default_manager.exists() and options.get('interactive'):
File "/usr/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line 586, in exists
return self.query.has_results(using=self.db)
File "/usr/lib/python2.7/site-packages/django/db/models/sql/query.py", line 479, in has_results
return compiler.has_results()
File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 808, in has_results
return bool(self.execute_sql(SINGLE))
File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 837, in execute_sql
cursor.execute(sql, params)
File "/usr/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.ProgrammingError: (1146, "Table 'horizon.openstack_auth_user' doesn't exist")
Hmm,
actually, the command ./manage.py syncdb is not correct, one should rather use
./manage.py migrate
# mysql
create database horizon;
create user horizon identified by 'horizon';
grant all on horizon.* to 'horizon'@'localhost' identified by 'horizon';
add to local_settings:
DATABASES = {
'default': {
'ENGINE':'django.db.backends.mysql',
'NAME': 'horizon',
'USER': 'horizon',
'PASSWORD': 'horizon',
'HOST': 'localhost',
}
}
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
Test it:
MariaDB [(none)]> drop database horizon;
Query OK, 6 rows affected (0.26 sec)
MariaDB [(none)]> create database horizon;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> Bye
[root@rhos-7-access-plugin openstack-dashboard]# ./manage.py migrate
WARNING:root:"dashboards" and "default_dashboard" in (local_)settings is DEPRECATED now and may be unsupported in some future release. The preferred way to specify the order of dashboards and the default dashboard is the pluggable dashboard mechanism (in /usr/share/openstack-dashboard/openstack_dashboard/enabled, /usr/share/openstack-dashboard/openstack_dashboard/local/enabled).
Operations to perform:
Synchronize unmigrated apps: openstack_auth, settings, admin, messages, openstack_dashboard, compressor, project, staticfiles, theme, humanize, django_pyscss, horizon, django_pyscss_fix, identity
Apply all migrations: contenttypes, auth, sessions
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states... DONE
Applying contenttypes.0001_initial... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0001_initial... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying sessions.0001_initial... OK
And finally: restart httpd and try it out.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2015:1548 |