Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenStack: Operators

folsom -> grizzly keystone-manage db_sync error

 

 

OpenStack operators RSS feed   Index | Next | Previous | View Threaded


jon at jonproulx

Aug 5, 2013, 7:56 PM

Post #1 of 5 (44 views)
Permalink
folsom -> grizzly keystone-manage db_sync error

It's entirely possible my problem is that I've been working for 14h so far
today...

On Ubuntu 12.04 using cloud-archieve repos I just upgraded keystone to
grizzly from folsom, but 'keystone-manage db_sync' is failing with
something like:

sqlalchemy.exc.IntegrityError: (IntegrityError) (1452, 'Cannot add or
update a child row: a foreign key constraint fails
(`keystone`.`user_project_metadata`, CONSTRAINT
`user_project_metadata_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user`
(`id`))') 'INSERT INTO user_project_metadata (user_id, project_id, data)
VALUES (%s, %s, %s)' ('1c45965adcd341a68140f318460444db',
'98333a1a28e746fa8c629c83a818ad57', '{"roles":
["9fe2ff9ee4384b1894a90878d3e92bab"]}')

the user_id is not an id in the user table, the referenced project and role
both exist.

The first time I shruged and created a new (but disabled) user, but after
doing that I got the same error but with a different non-existant user id.

CLI is giving errors that I'm pretty sure relate to the keystone DB not
being updated:

ERROR: An unexpected error prevented the server from fulfilling your
request. (OperationalError) (1054, "Unknown column 'token.user_id' in
'field list'") 'SELECT token.id AS token_id, token.expires AS
token_expires, token.extra AS token_extra, token.valid AS token_valid,
token.user_id AS token_user_id, token.trust_id AS token_trust_id \nFROM
token \nWHERE token.valid = %s AND token.id = %s \n LIMIT %s' (1,
'801e71c762ea338a01a0142a35d9993a', 1) (HTTP 500)

Any clues on how to get my db to sync?

-Jon


jon at jonproulx

Aug 6, 2013, 5:38 AM

Post #2 of 5 (43 views)
Permalink
Re: folsom -> grizzly keystone-manage db_sync error [In reply to]

On Tue, Aug 6, 2013 at 2:15 AM, Robert van Leeuwen <
Robert.vanLeeuwen [at] spilgames> wrote:

> > On Ubuntu 12.04 using cloud-archieve repos I just upgraded keystone
> to grizzly from folsom,
> > but 'keystone-manage db_sync' is failing with something like:
>
> > sqlalchemy.exc.IntegrityError: (IntegrityError) (1452, 'Cannot add or
> update a child row: a foreign key
>
> > Any clues on how to get my db to sync?
>
> Jon,
>
> Could you check if your tables are innodb?
> I've seen something similar when the tables where myisam.
>
> Cheers,
> Robert van Leeuwen
>



They are innodb, SHOW TABLE STATUS confirms.

Thanks,
-Jon


jon at jonproulx

Aug 6, 2013, 6:05 AM

Post #3 of 5 (43 views)
Permalink
Re: folsom -> grizzly keystone-manage db_sync error [In reply to]

I believe this relates to deleted users.

The old metadata table has entries for user_id's that have no corresponding
entry in the user table. I've not quite worked out the SQL for showing
these lines but it appears they also have no roles in the projects they are
associated with. Just a little more coffee and I think I've got it.

If my suspicion is correct then the patch is pretty easy just don't try to
migrate rows where the role list is null.

-Jon


On Tue, Aug 6, 2013 at 8:38 AM, Jonathan Proulx <jon [at] jonproulx> wrote:

> On Tue, Aug 6, 2013 at 2:15 AM, Robert van Leeuwen <
> Robert.vanLeeuwen [at] spilgames> wrote:
>
>> > On Ubuntu 12.04 using cloud-archieve repos I just upgraded keystone
>> to grizzly from folsom,
>> > but 'keystone-manage db_sync' is failing with something like:
>>
>> > sqlalchemy.exc.IntegrityError: (IntegrityError) (1452, 'Cannot add or
>> update a child row: a foreign key
>>
>> > Any clues on how to get my db to sync?
>>
>> Jon,
>>
>> Could you check if your tables are innodb?
>> I've seen something similar when the tables where myisam.
>>
>> Cheers,
>> Robert van Leeuwen
>>
>
>
>
> They are innodb, SHOW TABLE STATUS confirms.
>
> Thanks,
> -Jon
>


b.hagemeier at fz-juelich

Aug 6, 2013, 6:26 AM

Post #4 of 5 (43 views)
Permalink
Re: folsom -> grizzly keystone-manage db_sync error [In reply to]

Hi Jonathan,

without reading your full thread, I found the same problem yesterday
while upgrading. I deleted the extra users from DB and everything worked
fine.

There's a bug related to update issues from folsom to grizzly in which I
meant to report what I had to do, but didn't do yet. I'll do after
sending this email.

https://bugs.launchpad.net/keystone/+bug/1131174

The cause of the "problem" is that originally there was no enforcement
of referential integrity of the DB, which has now been added.
Transforming the old data, which possibly contains integrity violations,
can cause these problems. So actually, it is a good thing, but legacy
data may not quite fit in.

I think the table from which I deleted the entries was
user_project_metadata. You'll find the right place anyhow.


Cheers,
Björn

On 06.08.2013 15:05, Jonathan Proulx wrote :
>
> I believe this relates to deleted users.
>
> The old metadata table has entries for user_id's that have no
> corresponding entry in the user table. I've not quite worked out the
> SQL for showing these lines but it appears they also have no roles in
> the projects they are associated with. Just a little more coffee and I
> think I've got it.
>
> If my suspicion is correct then the patch is pretty easy just don't try
> to migrate rows where the role list is null.
>
> -Jon
>
>
> On Tue, Aug 6, 2013 at 8:38 AM, Jonathan Proulx <jon [at] jonproulx
> <mailto:jon [at] jonproulx>> wrote:
>
> On Tue, Aug 6, 2013 at 2:15 AM, Robert van Leeuwen
> <Robert.vanLeeuwen [at] spilgames
> <mailto:Robert.vanLeeuwen [at] spilgames>> wrote:
>
> > On Ubuntu 12.04 using cloud-archieve repos I just upgraded
> keystone to grizzly from folsom,
> > but 'keystone-manage db_sync' is failing with something like:
>
> > sqlalchemy.exc.IntegrityError: (IntegrityError) (1452,
> 'Cannot add or update a child row: a foreign key
>
> > Any clues on how to get my db to sync?
>
> Jon,
>
> Could you check if your tables are innodb?
> I've seen something similar when the tables where myisam.
>
> Cheers,
> Robert van Leeuwen
>
>
>
>
> They are innodb, SHOW TABLE STATUS confirms.
>
> Thanks,
> -Jon
>
>
>
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>


--
Dipl.-Inform. Björn Hagemeier
Federated Systems and Data
Juelich Supercomputing Centre
Institute for Advanced Simulation

Phone: +49 2461 61 1584
Fax : +49 2461 61 6656
Email: b.hagemeier [at] fz-juelich
Skype: bhagemeier
WWW : http://www.fz-juelich.de/jsc

JSC is the coordinator of the
John von Neumann Institute for Computing
and member of the
Gauss Centre for Supercomputing

-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Attachments: b_hagemeier.vcf (0.37 KB)


jon at jonproulx

Aug 6, 2013, 7:18 AM

Post #5 of 5 (43 views)
Permalink
Re: folsom -> grizzly keystone-manage db_sync error [In reply to]

Thanks Björn,

That's exactly it.

-Jon


On Tue, Aug 6, 2013 at 9:26 AM, Björn Hagemeier
<b.hagemeier [at] fz-juelich>wrote:

> Hi Jonathan,
>
> without reading your full thread, I found the same problem yesterday while
> upgrading. I deleted the extra users from DB and everything worked fine.
>
> There's a bug related to update issues from folsom to grizzly in which I
> meant to report what I had to do, but didn't do yet. I'll do after sending
> this email.
>
> https://bugs.launchpad.net/**keystone/+bug/1131174<https://bugs.launchpad.net/keystone/+bug/1131174>
>
> The cause of the "problem" is that originally there was no enforcement of
> referential integrity of the DB, which has now been added. Transforming the
> old data, which possibly contains integrity violations, can cause these
> problems. So actually, it is a good thing, but legacy data may not quite
> fit in.
>
> I think the table from which I deleted the entries was
> user_project_metadata. You'll find the right place anyhow.
>
>
> Cheers,
> Björn
>
> On 06.08.2013 15:05, Jonathan Proulx wrote :
>
>>
>> I believe this relates to deleted users.
>>
>> The old metadata table has entries for user_id's that have no
>> corresponding entry in the user table. I've not quite worked out the
>> SQL for showing these lines but it appears they also have no roles in
>> the projects they are associated with. Just a little more coffee and I
>> think I've got it.
>>
>> If my suspicion is correct then the patch is pretty easy just don't try
>> to migrate rows where the role list is null.
>>
>> -Jon
>>
>>
>> On Tue, Aug 6, 2013 at 8:38 AM, Jonathan Proulx <jon [at] jonproulx
>> <mailto:jon [at] jonproulx>> wrote:
>>
>> On Tue, Aug 6, 2013 at 2:15 AM, Robert van Leeuwen
>> <Robert.vanLeeuwen [at] spilgames**com <Robert.vanLeeuwen [at] spilgames>
>> <mailto:Robert.vanLeeuwen@**spilgames.com<Robert.vanLeeuwen [at] spilgames>>>
>> wrote:
>>
>> > On Ubuntu 12.04 using cloud-archieve repos I just upgraded
>> keystone to grizzly from folsom,
>> > but 'keystone-manage db_sync' is failing with something like:
>>
>> > sqlalchemy.exc.IntegrityError: (IntegrityError) (1452,
>> 'Cannot add or update a child row: a foreign key
>>
>> > Any clues on how to get my db to sync?
>>
>> Jon,
>>
>> Could you check if your tables are innodb?
>> I've seen something similar when the tables where myisam.
>>
>> Cheers,
>> Robert van Leeuwen
>>
>>
>>
>>
>> They are innodb, SHOW TABLE STATUS confirms.
>>
>> Thanks,
>> -Jon
>>
>>
>>
>>
>> ______________________________**_________________
>> OpenStack-operators mailing list
>> OpenStack-operators [at] lists**openstack.org<OpenStack-operators [at] lists>
>> http://lists.openstack.org/**cgi-bin/mailman/listinfo/**
>> openstack-operators<http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators>
>>
>>
>
> --
> Dipl.-Inform. Björn Hagemeier
> Federated Systems and Data
> Juelich Supercomputing Centre
> Institute for Advanced Simulation
>
> Phone: +49 2461 61 1584
> Fax : +49 2461 61 6656
> Email: b.hagemeier [at] fz-juelich
> Skype: bhagemeier
> WWW : http://www.fz-juelich.de/jsc
>
> JSC is the coordinator of the
> John von Neumann Institute for Computing
> and member of the
> Gauss Centre for Supercomputing
>
> ------------------------------**------------------------------**
> -------------------------
> ------------------------------**------------------------------**
> -------------------------
> Forschungszentrum Juelich GmbH
> 52425 Juelich
> Sitz der Gesellschaft: Juelich
> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
> Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
> Prof. Dr. Sebastian M. Schmidt
> ------------------------------**------------------------------**
> -------------------------
> ------------------------------**------------------------------**-------------------------
>
>

OpenStack operators RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.