[Bug 1244439] [NEW] After installing the keystone, its not able to sync with mysql DB

Kush kush.sood at gmail.com
Thu Oct 24 21:26:47 UTC 2013


Public bug reported:

I am trying to configure NOVA on my UBUNTU 12.04 machine.
I installed Mysql and created keystone and other users required for openstack on work.

Please find below mysql users created :

Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.

mysql> select User,Host from mysql.user;
+------------------+--------------------------+
| User             | Host                     |
+------------------+--------------------------+
| glance           | %                        |
| keystone         | %                        |
| nova             | %                        |
| root             | 127.0.0.1                |
| root             | ::1                      |
|   
|   root               | localhost                |
| debian-sys-maint | localhost                |
| glance           | localhost                |
| keystone         | localhost                |
| nova             | localhost                |
| root             | localhost                |
+------------------+--------------------------+


It has Keystone user and I can very well login from my shell as keystone user.So there is no problem with my permissions issues.

System is running with below keystone versions

esookus at BLL18R1:/etc/keystone$ sudo apt-cache policy python-prettytable 
python-prettytable:
  Installed: 0.5-1ubuntu2
  Candidate: 0.5-1ubuntu2
  Version table:
 *** 0.5-1ubuntu2 0
        500 http://ca.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status
esookus at BLL18R1:/etc/keystone$ ^C
esookus at BLL18R1:/etc/keystone$ sudo apt-cache policy keystone
keystone:
  Installed: 2012.1-0ubuntu1
  Candidate: 2012.1-0ubuntu1
  Version table:
 *** 2012.1-0ubuntu1 0
        500 http://ca.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

===================================

But when ever I try to to keystone-manage db_sync , it results in
failure with below mentioned errors

==================esookus at BLL18R1:~/openstackgeek/essex$ keystone-manage --config-file /etc/keystone/keystone.conf db_sync
Traceback (most recent call last):
  File "/usr/bin/keystone-manage", line 28, in <module>
    cli.main(argv=sys.argv, config_files=config_files)
  File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 148, in main
    return run(cmd, (args[:1] + args[2:]))
  File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 134, in run
    return CMDS[cmd](argv=args).run()
  File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 36, in run
    return self.main()
  File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 57, in main
    driver.db_sync()
  File "/usr/lib/python2.7/dist-packages/keystone/identity/backends/sql.py", line 135, in db_sync
    migration.db_sync()
  File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration.py", line 50, in db_sync
    current_version = db_version()
  File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration.py", line 64, in db_version
    CONF.sql.connection, repo_path)
  File "<string>", line 2, in db_version
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 155, in with_engine
    engine = construct_engine(url, **kw)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 140, in construct_engine
    return create_engine(engine, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/__init__.py", line 321, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 64, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/connectors/mysqldb.py", line 52, in dbapi
    return __import__('MySQLdb')

=============================

Here is my keystone.conf file which it uses 
=================================
[DEFAULT]
#bind_host = 0.0.0.0
public_port = 5000
admin_port = 35357
admin_token = f00bar
compute_port = 8774
verbose = True
debug = True
log_config = /etc/keystone/logging.conf

# ================= Syslog Options ============================
# Send logs to syslog (/dev/log) instead of to file specified
# by `log-file`
use_syslog = False

# Facility to use. If unset defaults to LOG_USER.
# syslog_log_facility = LOG_LOCAL0

[sql]
connection = mysql://keystone:f00bar@127.0.0.1/keystone
idle_timeout = 200

[ldap]
#url = ldap://localhost
#tree_dn = dc=example,dc=com
#user_tree_dn = ou=Users,dc=example,dc=com
#role_tree_dn = ou=Roles,dc=example,dc=com
#tenant_tree_dn = ou=Groups,dc=example,dc=com
#user = dc=Manager,dc=example,dc=com
#password = freeipa4all
#suffix = cn=example,cn=com

[identity]
driver = keystone.identity.backends.sql.Identity

[catalog]
driver = keystone.catalog.backends.templated.TemplatedCatalog 
template_file = /etc/keystone/default_catalog.templates
driver = keystone.catalog.backends.templated.TemplatedCatalog 
template_file = /etc/keystone/default_catalog.templates
driver = keystone.catalog.backends.templated.TemplatedCatalog 
template_file = /etc/keystone/default_catalog.templates

[token]
driver = keystone.token.backends.sql.Token

# Amount of time a token should remain valid (in seconds)
expiration = 86400

[policy]
driver = keystone.policy.backends.rules.Policy

[ec2]
driver = keystone.contrib.ec2.backends.sql.Ec2

[filter:debug]
paste.filter_factory = keystone.common.wsgi:Debug.factory

[filter:token_auth]
paste.filter_factory = keystone.middleware:TokenAuthMiddleware.factory

[filter:admin_token_auth]
paste.filter_factory = keystone.middleware:AdminTokenAuthMiddleware.factory

[filter:xml_body]
paste.filter_factory = keystone.middleware:XmlBodyMiddleware.factory

[filter:json_body]
paste.filter_factory = keystone.middleware:JsonBodyMiddleware.factory

[filter:crud_extension]
paste.filter_factory = keystone.contrib.admin_crud:CrudExtension.factory

[filter:ec2_extension]
paste.filter_factory = keystone.contrib.ec2:Ec2Extension.factory

[app:public_service]
paste.app_factory = keystone.service:public_app_factory

[app:admin_service]
paste.app_factory = keystone.service:admin_app_factory

[pipeline:public_api]
pipeline = token_auth admin_token_auth xml_body json_body debug ec2_extension public_service

[pipeline:admin_api]
pipeline = token_auth admin_token_auth xml_body json_body debug ec2_extension crud_extension admin_service

[app:public_version_service]
paste.app_factory = keystone.service:public_version_app_factory

[app:admin_version_service]
paste.app_factory = keystone.service:admin_version_app_factory

[pipeline:public_version_api]
pipeline = xml_body public_version_service

[pipeline:admin_version_api]
pipeline = xml_body admin_version_service

[composite:main]
use = egg:Paste#urlmap
/v2.0 = public_api
/ = public_version_api

[composite:admin]
use = egg:Paste#urlmap
/v2.0 = admin_api
/ = admin_version_api
==================================

I am not able to see why db_sync is failing.

Thanks in Advance and quick reply will be appreciated.

Best Regards
-Kush Sood

** Affects: keystone (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to keystone in Ubuntu.
https://bugs.launchpad.net/bugs/1244439

Title:
  After installing the keystone, its not able to sync with mysql DB

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/keystone/+bug/1244439/+subscriptions



More information about the Ubuntu-server-bugs mailing list