← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1386773] Re: Project details request with long ID causes 500 error with DB2

 

** Changed in: keystone
       Status: Fix Committed => Fix Released

** Changed in: keystone
    Milestone: None => liberty-1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1386773

Title:
  Project details request with long ID causes 500 error with DB2

Status in OpenStack Identity (Keystone):
  Fix Released

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://localhost:35357/v3/projects/915eb1fb90d34430b1dafbc712889924asldkjsalkfdjlaksdjflkdsajflkdsajfdsasad | python -m json.tool
  {
      "error": {
          "code": 500,
          "message": "An unexpected error prevented the server from fulfilling your request: (DataError) ibm_db_dbi::DataError: Statement Execute Failed: [IBM][CLI Driver] CLI0109E  String data right truncation. SQLSTATE=22001 SQLCODE=-99999 'SELECT project.id AS project_id, project.name AS project_name, project.domain_id AS project_domain_id, project.description AS project_description, project.enabled AS project_enabled, project.extra AS project_extra \\nFROM project \\nWHERE project.id = ?' ('915eb1fb90d34430b1dafbc712889924asldkjsalkfdjlaksdjflkdsajflkdsajfdsasad',) (Disable debug mode to suppress these details.)",
          "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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1386773/+subscriptions


References