← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1100253] Re: Invalid UUID in servers rest calls causes 500s when using Postgresql

 

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

** Changed in: nova
    Milestone: None => grizzly-3

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1100253

Title:
  Invalid UUID in servers rest calls causes 500s when using Postgresql

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  When using the Postgresql database, invalid UUIDs cause 500s because
  the following check in nova/compute/api.py(L1168):

      def get(self, context, instance_id):
          """Get a single instance with the given instance_id."""
          # NOTE(ameade): we still need to support integer ids for ec2
          if uuidutils.is_uuid_like(instance_id):
              instance = self.db.instance_get_by_uuid(context, instance_id)
          else:
              instance = self.db.instance_get(context, instance_id)

  When an invalid, though string like, UUID is passed into this code
  (like a 35 or 37 alphabetic UUIDish string), we fail over to the
  integer version of this function. The net result id we pass a non-int
  value down to instance_get.

  On MySQL, which is pretty type fluid, things are fine. On Postgresql,
  which is type strict, this generates a DataError because id='aaaaaa'
  is never executed, as it's a type error.

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