Ask Your Question

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

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

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 AS role_id, 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

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

larsks gravatar image

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

  `id` varchar(64) NOT NULL,
  `name` varchar(255) NOT NULL,
  `extra` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)

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


@larsks - thanks. It worked now:-)

Vinu Pillai gravatar imageVinu Pillai ( 2013-11-09 22:26:39 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-11-09 01:51:28 -0500

Seen: 593 times

Last updated: Nov 09 '13