← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2127789] Re: Image upload fails with "Unsupported Media Type"

 

Reviewed:  https://review.opendev.org/c/openstack/glance/+/963868
Committed: https://opendev.org/openstack/glance/commit/28d98401b965716b53f719d354f0ecbf5583601c
Submitter: "Zuul (22348)"
Branch:    master

commit 28d98401b965716b53f719d354f0ecbf5583601c
Author: Dan Smith <dansmith@xxxxxxxxxx>
Date:   Mon Oct 13 07:39:45 2025 -0700

    Handle images detected as ISO+GPT
    
    ISO images can have a system-specific bootloader prepended to them,
    which in the case of x86-64 would be a typical GPT/MBR boot sector,
    partition table, etc. These files are not uncommon amongst installer
    media and currently trigger and fail our format detection since they
    are identified as both ISO and GPT. This makes us allow these files
    if they are being uploaded with disk_format=iso as the target. No
    other multi-format combinations are allowed.
    
    Note that this only impacts the upload method and not import with
    format conversion. The latter is more complicated as we currently use
    oslo's detect_file_format() method which specifically disallows
    multiple formats. Converting from iso+gpt to anything else is not
    likely very useful and we already ignore it in the process (although
    after the inspection check).
    
    Closes-Bug: #2127789
    Change-Id: I11a6872275568e874236ae78faf877db1bbfbb9a
    Signed-off-by: Dan Smith <dansmith@xxxxxxxxxx>


** Changed in: glance
       Status: In Progress => Fix Released

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

Title:
  Image upload fails with "Unsupported Media Type"

Status in Glance:
  Fix Released

Bug description:
  Environment details:

  - OS: Ubuntu 24.04
  - Deployment: package based
  - glance-api version: 2:30.0.0-0ubuntu1~cloud0

  This is a follow-up on the discussion on the mailing list [0].

  After our recent upgrade to Epoxy we have troubles uploading images to
  Glance:

  openstack image create --disk-format iso --file .../opensuse/Leap-16.0-offline-installer-x86_64.install.iso --progress --public test-ebl
  [=============================>] 100%
  HttpException: 415: Client Error for url: http://controller.domain:9292/v2/images/e23d802e-d927-4f34-ae2d-1d6f54d62066/file, Unsupported Media Type

  And in the logs this is reported:

  2025-10-11 01:16:56.585 65675 ERROR glance.api.v2.image_data [None
  req-086ad005-a455-471a-bb0d-9dfe5e27eacf
  89c5dcc8793d4867bae22d50e51e16b3 90c403f317ee47feb0dad58461e76fb1 - -
  default default] Multiple formats detected: iso,gpt:
  glance.common.exception.InvalidImageData: Multiple formats detected:
  iso,gpt

  For now I disabled the check by setting:

  [image_format]
  require_image_format_match = false

  Citing Sean's assumption that this might be a regression:

  > glance has a copy of the orginal nova iso support https://review.opendev.org/c/openstack/glance/+/923676
  > and it was updated to use oslo https://review.opendev.org/c/openstack/glance/+/927291/5
  > but i do not see any equilvent of https://review.opendev.org/c/openstack/nova/+/931833 in https://github.com/openstack/glance/blob/1a89edc86b10cbe14e1877d119de409b7b75863f/glance/async_/flows/plugins/image_conversion.py#L83-L246
  > so i think this is a regression in glance from the cve fix.

  I found similar reports for ironic ([1], [2]) but none for glance.

  [0] https://lists.openstack.org/archives/list/openstack-discuss@xxxxxxxxxxxxxxxxxxx/thread/F5V2AR7GSRGJWO3XBCXWYWTKADSXN3LN/
  [1] https://bugs.launchpad.net/ironic/+bug/2091611
  [2] https://bugs.launchpad.net/ironic-python-agent/+bug/2091611

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



References