Ask Your Question
0

Cinder is unable to open my database

asked 2014-04-04 08:04:23 -0600

Matteo gravatar image

Hello I'm running a Ubuntu Server 13.04 server and following the OpenStack installation guide. Cinder isn't working proberbly, though. The problem is the cinder.conf. It wasn't filled correctly and a lot of stuff was missing. So I insert the default conf from github into it and uncommented the needed settings. It still doesn't work, though. The error message I receive is:

CRITICAL [cinder] (OperationalError) unable to open database file None None

Mysql is set up right, though. Am I missing anything?

edit retag flag offensive close merge delete

Comments

What does your sql_connection setting look like in /etc/cinder/cinder.conf?

larsks gravatar imagelarsks ( 2014-04-04 09:46:57 -0600 )edit

I would run:-

    [root@dallas1 ~(keystone_admin)]$ mysql -u root -p
    Enter password: 
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 280
    Server version: 5.5.36-MariaDB MariaDB Server

    Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

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

    MariaDB [(none)]> SELECT User, Host, Password FROM mysql.user;
    +----------+---------------------+-------------------------------------------+
    | User     | Host                | Password                                  |
    +----------+---------------------+-------------------------------------------+
    | root     | localhost           | *E0DC09146F1310B49A34199B04274A9EED6F9EC7 |
    | root     | dallas1.localdomain | *E0DC09146F1310B49A34199B04274A9EED6F9EC7 |
    | root     | 127.0.0.1           | *E0DC09146F1310B49A34199B04274A9EED6F9EC7 |
    | root     | ::1                 | *E0DC09146F1310B49A34199B04274A9EED6F9EC7 |
    |          | localhost           |                                           |
    |          | dallas1.localdomain |                                           |
    | keystone | localhost           | *936E8F7AB2E21B47F6C9A7E5D9FE14DBA2255E5A |
    | keystone | %                   | *936E8F7AB2E21B47F6C9A7E5D9FE14DBA2255E5A |
    | glance   | localhost           | *CC67CAF178CB9A07D756302E0BBFA3B0165DFD49 |
    | glance   | %                   | *CC67CAF178CB9A07D756302E0BBFA3B0165DFD49 |
    | cinder   | localhost           | *028F8298C041368BA08A280AA8D1EF895CB68D5C |
    | cinder   | %                   | *028F8298C041368BA08A280AA8D1EF895CB68D5C |
    | neutron  | localhost           | *4DF421833991170108648F1103CD74FCB66BBE9E |
    | neutron  | %                   | *03A31004769F9E4F94ECEEA61AA28D9649084839 |
    | nova     | localhost           | *0BE3B501084D35F4C66DD3AC4569EAE5EA738212 |
    | nova     | %                   | *0BE3B501084D35F4C66DD3AC4569EAE5EA738212 |
    | nova     | dallas1.localdomain | *0BE3B501084D35F4C66DD3AC4569EAE5EA738212 |
    | dash     | %                   | *C9E492EC67084E4255B200FD34BDF396E3CE1A36 |
    | dash     | localhost           | *C9E492EC67084E4255B200FD34BDF396E3CE1A36 |
    | dash     | dallas1.localdomain | *C9E492EC67084E4255B200FD34BDF396E3CE1A36 |
    | cinder   | dallas1.localdomain | *028F8298C041368BA08A280AA8D1EF895CB68D5C |
    +----------+---------------------+-------------------------------------------+
    21 rows in set (0.00 sec)

    MariaDB [(none)]> UPDATE mysql.user SET Password = PASSWORD('xxxxxxxx') WHERE User ...
(more)
dbaxps gravatar imagedbaxps ( 2014-04-05 06:42:58 -0600 )edit

My configuration looks like this:

    [DEFAULT]
rootwrap_config=/etc/cinder/rootwrap.conf
api_paste_config = /etc/cinder/api-paste.ini

iscsi_helper=tgtadm
volume_name_template = volume-%s
volume_group = cinder-volumes
verbose = True
auth_strategy = keystone
#osapi_volume_listen_port=5900

# Add these when not using the defaults.
rabbit_host = rabbitmq01
rabbit_port = 5672
rabbit_userid = guest
rabbit_password = 02eb12d641f407244c7e
#rabbit_virtual_host = /nova

[database]
connection = mysql://cinder:2592af999f96947f9c17@sqldb01/cinder

And that's the error message from the cinder-scheduler.log (despite the error is saying it, the DB isn't read only)

DBError: (OperationalError) attempt to write a readonly database u'INSERT INTO services (created_at, updated_at, deleted_at, deleted, host, binary, topic, report_count, disabled, availability_zone) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' ('2014-04-07 07:29:41.694794', None, None, 0, 'oscontroller01', 'cinder-scheduler', 'cinder-scheduler', 0, 0, 'nova')
Matteo gravatar imageMatteo ( 2014-04-07 02:08:34 -0600 )edit

Are you able with password 2592af999f96947f9c17 proceed like this :-

[root@dallas1 ~(keystone_admin)]$ mysql -u cinder -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 98
Server version: 5.5.36-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

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

MariaDB [(none)]> use cinder ;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
dbaxps gravatar imagedbaxps ( 2014-04-07 02:38:30 -0600 )edit

Yes. It was of the one things I tested on Friday. I have access with the user to the database cinder. And as it should be there aren't tables in it because cinder can't use the db as it seems. I also can create manually tables within the database "cinder" with the user cinder.

Matteo gravatar imageMatteo ( 2014-04-07 02:44:17 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2014-04-07 11:48:02 -0600

dbaxps gravatar image

updated 2014-04-08 02:55:38 -0600

Login in MySQL as root

mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
      -> IDENTIFIED BY '2592af999f96947f9c17';


mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \
      -> IDENTIFIED BY '2592af999f96947f9c17';

mysql> FLUSH PRIVILEGES;

View also cinder-mange sync is not creating tables in havana , regarding syntax of SQL connectivity string.

edit flag offensive delete link more

Comments

Unfortunately this doesn't solve the problem.

Matteo gravatar imageMatteo ( 2014-04-08 05:19:15 -0600 )edit
0

answered 2014-04-08 01:17:36 -0600

Matteo gravatar image

updated 2014-04-08 03:10:29 -0600

Okay. I've managed to solve the problem. The Problem was with the /var/lib/cinder/cinder.sqlite file. I forgot deleting the file.

E:// Okay it solved not the whole problem. But it was still one.

edit flag offensive delete link more

Comments

Per cinder-mange sync is not creating tables in havana Only deleting cinder.sqlite file doesn't solve the problem . There is one more notice

 if you are using Havana: connection = mysql://cinder:CINDER_DBPASS@localhost/cinder not sql_connection = mysql://cinder:CINDER_DBPASS@localhost/cinder
dbaxps gravatar imagedbaxps ( 2014-04-08 02:43:16 -0600 )edit

My config doesn't include the wrong connection term anymore but it still doesn't work. As before the log still says that cinder can't write into an readonly db.

Matteo gravatar imageMatteo ( 2014-04-08 03:11:30 -0600 )edit

Am I correct stating ?

Neither manually granting privileges to "cinder" nor following "cinder-mange sync is not creating tables in havana " helps to solve the issue. It's still in place.

dbaxps gravatar imagedbaxps ( 2014-04-08 03:23:38 -0600 )edit

Yes. I've deleted the database and the user as well and created it again. The problem still persists.

Matteo gravatar imageMatteo ( 2014-04-08 04:16:58 -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

1 follower

Stats

Asked: 2014-04-04 08:04:23 -0600

Seen: 8,188 times

Last updated: Apr 08 '14