Ask Your Question
0

Cloudkitty DB permission error on Mitaka

asked 2016-08-25 22:03:09 -0600

KotoriChannn gravatar image

updated 2016-08-29 01:50:27 -0600

Hello.

I am trying to install Cloudkitty on OpenStack Mitaka. and got the db permission error. I will show my whole step that i did. Help me to solve the problem.

git clone git://git.openstack.org/openstack/cloudkitty
cd cloudkitty
python setup.py install

mkdir /etc/cloudkitty

I git cloned cloudkitty from github like this.

[DEFAULT]
verbose = True
log_dir = /var/log/cloudkitty

[oslo_messaging_rabbit]
rabbit_userid = guest
rabbit_password = guest
rabbit_hosts = controller:5672

[auth]
username = cloudkitty
password = cloudkitty
tenant = services
region = RegionOne
url = http://controller:5000/v2.0

[keystone_authtoken]
username = cloudkitty
password = cloudkitty
project_name = services
region = RegionOne
auth_url = http://controller:5000/v2.0
auth_plugin = password
identity_uri=http://controller:35357

[database]
connection = mysql://cloudkitty:cloudkitty@controller/cloudkitty

[keystone_fetcher]
username = admin
password = adminpass from keystonerc_admin
tenant = admin
region = RegionOne
url = http://controller:5000/v2.0

[ceilometer_collector]
username = cloudkitty
password = cloudkitty 
tenant = services
region = RegionOne
url = http://controller:5000

This is my /etc/cloudkitty/cloudkitty.conf file.

mysql -uroot -p
 CREATE DATABASE cloudkitty;
 GRANT ALL PRIVILEGES ON cloudkitty.* TO 'cloudkitty'@'controller' IDENTIFIED BY 'cloudkitty';

and i made "cloudkitty" database like this.

   # cloudkitty-dbsync upgrade

than, i tried to dbsync.

  Option "verbose" from group "DEFAULT" is deprecated for removal.  Its value may be silently ignored in the future.
CRITI [cloudkitty] OperationalError: (_mysql_exceptions.OperationalError) (1044, "Access denied for user 'cloudkitty'@'192.168.1.26' to database 'cloudkitty'")
Traceback (most recent call last):
  File "/bin/cloudkitty-dbsync", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/cloudkitty/cli/dbsync.py", line 143, in main
    CONF.command.func()
  File "/usr/lib/python2.7/site-packages/cloudkitty/cli/dbsync.py", line 94, in upgrade
    self._version_change('upgrade')
  File "/usr/lib/python2.7/site-packages/cloudkitty/cli/dbsync.py", line 91, in _version_change
    func(revision)
  File "/usr/lib/python2.7/site-packages/cloudkitty/db/sqlalchemy/migration.py", line 27, in upgrade
    return migration.upgrade(config, revision)
  File "/usr/lib/python2.7/site-packages/cloudkitty/common/db/alembic/migration.py", line 37, in upgrade
    return alembic.command.upgrade(config, version or 'head')
  File "/usr/lib/python2.7/site-packages/alembic/command.py", line 174, in upgrade
    script.run_env()
  File "/usr/lib/python2.7/site-packages/alembic/script/base.py", line 397, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/usr/lib/python2.7/site-packages/cloudkitty/db/sqlalchemy/alembic/env.py", line 25, in <module>
    env.run_migrations_online(target_metadata, version_table)
  File "/usr/lib/python2.7/site-packages/cloudkitty/common/db/alembic/env.py", line 37, in run_migrations_online
    engine = db.get_engine()
  File "/usr/lib/python2.7/site-packages/cloudkitty/db/__init__.py", line 32, in get_engine
    facade = _create_facade_lazily()
  File "/usr/lib/python2.7/site-packages/cloudkitty/db/__init__.py", line 27, in _create_facade_lazily
    _FACADE = session.EngineFacade.from_config(cfg.CONF, sqlite_fk=True)
  File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 1056, in from_config
    expire_on_commit=expire_on_commit, _conf=conf)
  File "/usr/lib/python2 ...
(more)
edit retag flag offensive close merge delete

Comments

1

Not Sure if thats related, Could you please check this bug reported thread

You may need to add [authinfos] section. Let us know if that works for you.

sunnyarora gravatar imagesunnyarora ( 2016-08-25 22:44:41 -0600 )edit

I solved this DB permission error, i created DB manually, and it works.

KotoriChannn gravatar imageKotoriChannn ( 2016-08-26 02:09:53 -0600 )edit

Hi, Could you please reply in answer Section giveing the steps you did and Close this Query. -Thanks

sunnyarora gravatar imagesunnyarora ( 2016-08-26 05:54:37 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-08-29 01:45:38 -0600

KotoriChannn gravatar image

updated 2016-08-29 01:49:25 -0600

Solved.

just create 'cloudkitty' DB manually on "mysql -uroot -p". (don't follow DB create command on installation guide.) and the permission will apply without any problems.

mysql -uroot -p

CREATE DATABASE cloudkitty;

CREATE USER cloudkitty@localhost identified by 'cloudkitty';

GRANT ALL PRIVILEGES ON cloudkitty.* to cloudkitty@localhost identified by 'cloudkitty';

flush PRIVILEGES;

exit

It was simple, but annoying error. Hope this reply can help you.

edit flag offensive delete link more

Comments

did the following command

cloudkitty-storage-init

work without errors with your setup?

generalkalbasa gravatar imagegeneralkalbasa ( 2016-08-29 11:17:49 -0600 )edit

What error did you get when you run cloudkitty-storage-init?

KotoriChannn gravatar imageKotoriChannn ( 2016-09-01 23:35:59 -0600 )edit

if your problem is ERROR cloudkitty Unauthorized: The request you have made requires authentication. (HTTP 401), add "cloudkitty" account , rating service and endpoints first on keystone. This will solve the HTTP 401 auth error.

KotoriChannn gravatar imageKotoriChannn ( 2016-09-02 00:13:44 -0600 )edit

thank you, will try that as soon as i get to my lab

generalkalbasa gravatar imagegeneralkalbasa ( 2016-09-03 07:39:36 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2016-08-25 22:03:09 -0600

Seen: 157 times

Last updated: Aug 29 '16