V2: Endpoint creation with missing URL returns 500

Bug #1097747 reported by Unmesh Gurjar
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
Tushar Patil

Bug Description

Branch: master

Steps to repro:
1. Create an endpoint without specifying either or all of adminurl, internalurl or publicurl as follows:
$ keystone endpoint-create --service-id 6920e3f02bfd4bc89e06539818c83cdc

2. Observe the response.

Expected Behavior:
API should return a 400 Bad Request with appropriate message.

Actual Response:
API returns a 500 Internal Server Error with the following response body:
Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. (OperationalError) (1048, \"Column 'url' cannot be null\") 'INSERT INTO endpoint (id, interface, region, service_id, url, extra) VALUES (%s, %s, %s, %s, %s, %s)' ('8622653655e545e8b86876ce7badafe4', 'admin', 'regionOne', '6920e3f02bfd4bc89e06539818c83cdc', None, '{\"legacy_endpoint_id\": \"f59f7a01857147a39c4caf5a6a7d0ef0\"}')", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)

Tags: ntt
Changed in keystone:
assignee: nobody → Unmesh Gurjar (unmesh-gurjar)
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/19431

Changed in keystone:
assignee: Unmesh Gurjar (unmesh-gurjar) → Tushar Patil (tpatil)
status: New → In Progress
Revision history for this message
Brant Knudson (blk-u) wrote :

Shouldn't the expected response in this case be that the keystone command says that that the --adminurl, --internalurl, and --publicurl arguments are required? It shouldn't even send the request to the keystone server.

The server is also not working correctly, but I think the keystone command should validate its arguments too so that you can print out a more understandable error message.

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

Reviewed: https://review.openstack.org/19431
Committed: http://github.com/openstack/keystone/commit/3a38ecfc8868c95ad3df43de22b29f08f2c9d4cf
Submitter: Jenkins
Branch: master

commit 3a38ecfc8868c95ad3df43de22b29f08f2c9d4cf
Author: Tushar Patil <email address hidden>
Date: Thu Jan 10 00:46:23 2013 -0800

    Validated URLs in v2 endpoint creation API

    Fixed the 500 response when endpoint is created without specifying
    either adminurl, publicurl or internalurl empty.
    Added unit test coverage for v2 endpoint create API.

    Fixes LP: #1097747

    Change-Id: I1875859bd7e197e985a5b5395c8caefff3c83b11

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: grizzly-3 → 2013.1
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.