Image import "web-download" doesn't check on download size

Bug #1895663 reported by Grégoire Unbekandt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Grégoire Unbekandt

Bug Description

When using the image import "web-download" the downloaded data size is not checked.

This can result in corrupted images in case of network failures or if the source breaks the connection. In such a case Glance should interrupt the process instead of continuing the import.

If the server hosting the data supports the header "Content-Length", Glance should rely on it. All necessaries informations are provided as "store.add" already returns the written size.

https://github.com/openstack/glance/blob/master/glance/async_/flows/_internal_plugins/web_download.py#L120

Changed in glance:
assignee: nobody → Grégoire Unbekandt (gregoire-unbekandt)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.opendev.org/752067

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

Reviewed: https://review.opendev.org/752067
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=68c202d38ba0648c8a71a7e4c3771ea6c6f60651
Submitter: Zuul
Branch: master

commit 68c202d38ba0648c8a71a7e4c3771ea6c6f60651
Author: Grégoire Unbekandt <email address hidden>
Date: Tue Sep 15 15:19:43 2020 +0200

    Image import "web-download" check downloaded size

    If the downloaded data size is different from the expected one, the
    task "web-download" in the image import process will now fail.

    Change-Id: Ie260486d795a6f4af1632f6f3708abc92fb47a3a
    Closes-Bug: #1895663

Changed in glance:
status: In Progress → Fix Released
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.