Invalid URL in Endpoint create breaks keystone

Bug #1020248 reported by Adam Young
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
In Progress
Medium
Adam Young
Folsom
New
Undecided
Unassigned

Bug Description

If a user messes up the endpoint creation command, they will end up with bogus data in the endpoints table.

The particular error was that the internalURL was null. Ideally Keystone would have just rejected the
endpoint-create and not put incomplete data in the database. Suspect that the the trigger was missing a quote somewhere. Some validation on the values of the other parameters would help catch this problem, as well.

Adam Young (ayoung)
Changed in keystone:
assignee: nobody → Adam Young (ayoung)
Revision history for this message
Adam Young (ayoung) wrote :

For example, if

keystone service-create --name=keystone --type=identity --description="Keystone Identity Service"

gives a service id of dcad9c7b949844b2a44e6a5380391f54

The following (which is missing a couple key quotes)

keystone endpoint-create --region RegionOne --service_id dcad9c7b949844b2a44e6a5380391f54 --publicurl http://127.0.0.1:5000/v2.0' --adminurl 'http://127.0.0.1:35357/v2.0' --internalurl 'http://127.0.0.1:35357/v2.0

Will cause
# keystone service-list
Authorization Failed: An unexpected error prevented the server from fulfilling your request. 'NoneType' object has no attribute 'replace' (HTTP 500)

and
# keystone endpoint-list
Authorization Failed: An unexpected error prevented the server from fulfilling your request. 'NoneType' object has no attribute 'replace' (HTTP 500)

Revision history for this message
Adam Young (ayoung) wrote :

Additionally: deleting the erroneous row from the enpoint table in the Keystone database brings the system back to proper operation.

The bogus row looks like this:

| 6e8d273171874deb9dbe2dd2f5ba8161 | RegionOne | dcad9c7b949844b2a44e6a5380391f54 | {"adminurl": null, "internalurl": null, "publicurl": "http://127.0.0.1:5000/v2.0 --adminurl http://127.0.0.1:35357/v2.0 --internalurl http://127.0.0.1:35357/v2.0"} |

Joseph Heck (heckj)
Changed in keystone:
status: New → Triaged
importance: Undecided → Medium
Changed in keystone:
assignee: Adam Young (ayoung) → nobody
assignee: nobody → Sathish Nagappan (sathish-nagappan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
Dolph Mathews (dolph) wrote :

Not entirely clear on if this should be marked as a duplicate of bug 1061736 -- thoughts, Adam?

Adam Young (ayoung)
Changed in keystone:
assignee: Sathish Nagappan (sathish-nagappan) → Adam Young (ayoung)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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