Ask Your Question
0

Dropped "role" table from keystone database. Can it be recoverd?

asked 2013-11-09 01:51:28 -0600

Vinu Pillai gravatar image

I happened to drop the table "role" from keystone, and now my keystone role-list is not working. I think this will propagate the issue across all tenants which has role assigned to them.

I tried to get the table back to keystone database by "keystone-manage db_sync", but seems it's not working.

Output of the command is below.

Any help on this is highly appreciated.

Thanks, Vinu P.

keystone-manage db_sync

# #

keystone role-list

An unexpected error prevented the server from fulfilling your request. (ProgrammingError) (1146, "Table 'keystone.role' doesn't exist") 'SELECT role.id AS role_id, role.name AS role_name, role.extra AS role_extra \nFROM role' () (HTTP 500) rc#

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-11-09 09:28:59 -0600

larsks gravatar image

You could try creating the table by hand. Under Grizzly, the table looks like this:

CREATE TABLE `role` (
  `id` varchar(64) NOT NULL,
  `name` varchar(255) NOT NULL,
  `extra` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

And on my system has the following data:

INSERT INTO `role` VALUES ('9fe2ff9ee4384b1894a90878d3e92bab','_member_','{\"enabled\": \"True\", \"description\": \"Default role for project membership\"}');
INSERT INTO `role` VALUES ('42496baa3c854c50a54d48ce05848d1f','Member','{}');
INSERT INTO `role` VALUES ('837638d0e9ec45cdb1dc010d6692bf12','admin','{}');

You would need to modify the identifiers here to match those already referenced in other keystone tables.

edit flag offensive delete link more

Comments

@larsks - thanks. It worked now:-)

Vinu Pillai gravatar imageVinu Pillai ( 2013-11-09 22:26:39 -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: 2013-11-09 01:51:28 -0600

Seen: 514 times

Last updated: Nov 09 '13