user_id may not be a uuid

Bug #1505984 reported by Stefano Zilli
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Gnocchi
Fix Released
Medium
Sam Morrison

Bug Description

Gnocchi currently requires the user_id and created_by_user_id to be a valid uuid. The checks are everywhere in the code and in the indexer sql schema itself.

In some cases tho the user_id may not be a uuid. For example, where Keystone is integrated with AD, the user_id may be the actual username making it impossible to use Gnocchi as it is.

Julien Danjou (jdanjou)
Changed in gnocchi:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Chris Dent (cdent) wrote :

I feel a bit like I'm seeing hammers to nail everywhere, but would the uuid5 trick used for resource ids work here too?

Revision history for this message
Julien Danjou (jdanjou) wrote :

IIRC the conversion is one way only so once it's converted and stored, there's no way to display the initial value? That might be an issue for displaying "reports".

Revision history for this message
Marek Denis (marek-denis) wrote :

Hi, just for the record.
As od today (and since Icehouse) user_id of federated users is designated by administrators (or, to be more specific creators of the mapping rule). It can be literally everything.

Revision history for this message
Sam Morrison (sorrison) wrote :

Just wondering if any movement on this bug. We really want to deploy gnocchi in prod but this is a show stopper for us.
My initial thinking is changing user and project to be a string in the DB? Is that the way forward here?

Revision history for this message
Julien Danjou (jdanjou) wrote :

Hey Sam,

Yes, this is probably the best plan to move forward on this. I've postponed it so far because I hoped we would have enough time to make progress on our plan to have this kind of data to be dynamically created, but I guess it'll be for a next release.

Feel free to send a patch to fix that if you are able to!

Revision history for this message
Sam Morrison (sorrison) wrote :

Having a look now, should be pretty straight forward, now just need to learn alembic!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to gnocchi (master)

Fix proposed to branch: master
Review: https://review.openstack.org/270007

Changed in gnocchi:
assignee: nobody → Sam Morrison (sorrison)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to gnocchi (master)

Reviewed: https://review.openstack.org/270007
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=d4f87da5d8cfce2cdab7f6dbdcc9748783f29ccd
Submitter: Jenkins
Branch: master

commit d4f87da5d8cfce2cdab7f6dbdcc9748783f29ccd
Author: Sam Morrison <email address hidden>
Date: Wed Jan 20 15:59:54 2016 +1100

    Convert user and project IDs from UUIDs to Strings

    Change-Id: Ib7e65be82cebe78761c77db667c15fedff1df05e
    Closes-Bug: #1505984

Changed in gnocchi:
status: In Progress → Fix Committed
Julien Danjou (jdanjou)
Changed in gnocchi:
milestone: none → 2.0.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.