Project details request with long ID causes 500 error with DB2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Medium
|
Brant Knudson |
Bug Description
When using DB2 as the database, if you get project details with a really long ID (even if it doesn't exist), the you get a 500 error instead of 404 Not Found:
$ curl -s -H "X-Auth-Token: $TOKEN" http://
{
"error": {
"code": 500,
"message": "An unexpected error prevented the server from fulfilling your request: (DataError) ibm_db_
"title": "Internal Server Error"
}
}
I guess DB2 doesn't like getting a parameter that's longer than the column.
This probably applies to other resources, too.
Seems like the right thing to do here is either check the length in the SQL backend or catch this particular exception and reraise it as NotFound. Seems safer and more efficient to check the length in the SQL backend, although it's going to be a lot of changes.
Changed in keystone: | |
assignee: | nobody → Brant Knudson (blk-u) |
tags: | added: sql |
tags: | added: db2 |
Changed in keystone: | |
milestone: | none → liberty-1 |
status: | Fix Committed → Fix Released |
Changed in keystone: | |
milestone: | liberty-1 → 8.0.0 |
This is something we should hit with validation. What is the maximum length of an ID? Or the DB2 driver should perhaps validate the length and raise something back up.