Creating extra capabilities with keys longer than 64 characters triggers an Internal Server Error

Bug #1709639 reported by Pierre Riteau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Fix Released
Medium
Masahito Muroi

Bug Description

Because the database field is limited to 64 characters, creating hosts with longer keys throws an exception which results in "ERROR: Internal Server Error" being displayed to users. The host is still created though, but without the capability.

We should return a 400 Bad Request error instead, and probably not create the host at all.

Pierre Riteau (priteau)
Changed in blazar:
importance: Undecided → Medium
Changed in blazar:
milestone: none → 0.4.0
Changed in blazar:
status: New → Triaged
Changed in blazar:
milestone: 0.4.0 → queens-3
Changed in blazar:
milestone: queens-3 → rocky-3
Changed in blazar:
assignee: nobody → Masahito Muroi (muroi-masahito)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to blazar (master)

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

Changed in blazar:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to blazar (master)

Reviewed: https://review.openstack.org/575699
Committed: https://git.openstack.org/cgit/openstack/blazar/commit/?id=580d4ae470520e6c72f34b11943dec475d0af8e9
Submitter: Zuul
Branch: master

commit 580d4ae470520e6c72f34b11943dec475d0af8e9
Author: Masahito Muroi <email address hidden>
Date: Fri Jun 15 18:12:21 2018 +0900

    Return 400 Bad Request for extra capability keys longer than 64 chars

    Length of extra capability keys is limited to 64 characters in the DB
    schema. However, the host create API can create a host based on a
    request that has a longer extra capability key, only to return a 500
    Internal Server Error.

    With this patch, the API checks the key length before creating a host
    and returns a 400 Bad Request status code if it is too long.

    Change-Id: I2cf4ede787e0f65385376832ce410d694df094ff
    Closes-Bug: #1709639

Changed in blazar:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 2.0.0.0b3

This issue was fixed in the openstack/blazar 2.0.0.0b3 development milestone.

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.