)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"f13aebbf6329340866b1498e2198e2ad54ba37cc","unresolved":true,"context_lines":[{"line_number":7,"context_line":"Fix glance download with wrong checksum"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The glance download is broken with glance cache enabled and wrong"},{"line_number":10,"context_line":"checksum because the save and reraise the exeption in glance cache."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-Bug: #2012898"},{"line_number":13,"context_line":"Change-Id: I5d398277b01a114cfb74af6458f8bee30a812cc5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"bdade157_76929d79","line":10,"range":{"start_line":10,"start_character":17,"end_line":10,"end_character":20},"updated":"2026-06-30 17:33:52.000000000","message":"I had to read the bug report to figure out what this was about. Maybe the subject line should be along the lines of \"cache: do not raise GlanceException on wrong checksum\".","commit_id":"5704ffe41db9519ff012d142017e3e5fa654d19f"},{"author":{"_account_id":29037,"name":"Pierre-Samuel Le Stang","email":"pierre-samuel.le-stang@ovhcloud.com","username":"pslestang"},"change_message_id":"d479d585ba4a9cb12e615bf3d1129934bcad1d6c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix glance download with wrong checksum"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The glance download is broken with glance cache enabled and wrong"},{"line_number":10,"context_line":"checksum because the save and reraise the exeption in glance cache."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-Bug: #2012898"},{"line_number":13,"context_line":"Change-Id: I5d398277b01a114cfb74af6458f8bee30a812cc5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"209e6132_9ef7fdcd","line":10,"range":{"start_line":10,"start_character":17,"end_line":10,"end_character":20},"in_reply_to":"bdade157_76929d79","updated":"2026-07-10 12:23:39.000000000","message":"Done","commit_id":"5704ffe41db9519ff012d142017e3e5fa654d19f"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":33607,"name":"Pierre Libeau","email":"pierre.libeau@ovhcloud.com","username":"plibeau"},"change_message_id":"c3d51dc7a02fc4e509cc426a2580bff00cc2e59b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"1034878a_6b9ca53d","updated":"2023-10-27 13:41:35.000000000","message":"recheck","commit_id":"5ea5a4f95dcf23b381d2c7fbfcac535ef8644c52"},{"author":{"_account_id":33607,"name":"Pierre Libeau","email":"pierre.libeau@ovhcloud.com","username":"plibeau"},"change_message_id":"a094a9bf974ea84972c395c2ffcbceb41aa53fe2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"143ff00f_74b7802c","updated":"2023-04-14 08:15:53.000000000","message":"recheck","commit_id":"5ea5a4f95dcf23b381d2c7fbfcac535ef8644c52"},{"author":{"_account_id":33607,"name":"Pierre Libeau","email":"pierre.libeau@ovhcloud.com","username":"plibeau"},"change_message_id":"5eed405d5ddd8239ee3cfc14a6979537e3d896ac","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"89f1a819_470319c7","updated":"2023-03-28 07:50:22.000000000","message":"recheck openstack-tox-functional-py39","commit_id":"5ea5a4f95dcf23b381d2c7fbfcac535ef8644c52"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"f13aebbf6329340866b1498e2198e2ad54ba37cc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"215584bd_6f941243","updated":"2026-06-30 17:33:52.000000000","message":"Sorry for taking so long to review this patch.\n\nI think after applying this patch, we still rollback and remove the image from cache, and the user still gets an error message.\n\nYour whole issue was that when the cache was enabled, the user would see a misleading/useless error message, right?\n\n@akekane@redhat.com Does this look good to you?","commit_id":"5704ffe41db9519ff012d142017e3e5fa654d19f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"dcdd0176305bf85122fe7505e9f62507fc70d578","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"f04bc2f6_9ea2b267","in_reply_to":"215584bd_6f941243","updated":"2026-07-01 06:24:57.000000000","message":"Yes, cache rollback is expected — we should not keep data that fails checksum verification.\n\nAfter this patch, the user does not see an error message. The download completes successfully. The checksum failure is only logged on the server side.\n\nWithout the patch, the user does see an error when cache is enabled, even though all image data was already sent. So the bug was about the download being interrupted, not just a misleading error message.\n\nI think this is right way to deal with.","commit_id":"5704ffe41db9519ff012d142017e3e5fa654d19f"},{"author":{"_account_id":33607,"name":"Pierre Libeau","email":"pierre.libeau@ovhcloud.com","username":"plibeau"},"change_message_id":"7d5c88f01148bd0c59d9bb0b333d73d7a79ae504","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"e71eaac6_476eead8","in_reply_to":"ccdecb18_99e6cde6","updated":"2026-07-16 14:08:00.000000000","message":"Thanks Cyril. I re-ran the reproduction on my dev environment and I think it fully answers both questions.\n\nFirst, the important point: the checksum verification the user relies on is done client-side, openstackclient/glanceclient compares the MD5 of the received body against the Content-MD5/checksum header. That client-side check is what produces the clean InvalidResponse. The server-side checksum check in the cache tee only decides whether the cached copy is valid; it is not what the user\u0027s error comes from.\n\n1. Same error with and without cache? Yes. Here is the exact same openstack image save on the same corrupt image, with and without the patch:\n\nwith the patch (cache enabled): identical to the cache-disabled behaviour\n`$ openstack image save 9d81c7df-49a7-4596-8f06-823002eb7802 --file test-download\nUnable to download image: InvalidResponse`\n\nwithout the patch (cache enabled): the bug\n`$ openstack image save 9d81c7df-49a7-4596-8f06-823002eb7802 --file test-download\nUnable to download image: (\"Connection broken: InvalidChunkLength(got length b\u0027\u0027, 0 bytes read)\", InvalidChunkLength(got length b\u0027\u0027, 0 bytes read))`\n\nThe bug was that with the cache enabled we raise the GlanceException from inside the streaming generator, but only after every chunk has already been yielded. Raising there tears down the chunked transfer without a terminating 0-length chunk, so the client gets the useless InvalidChunkLength instead of InvalidResponse. With the patch the generator returns cleanly, the stream terminates properly, and the client\u0027s own checksum verification produces the same meaningful InvalidResponse you get when the cache is disabled.\n\n2. Does the image ever get downloaded? No. In both cases image save fails and no valid file is written, we never hand corrupt data to the user as if it were valid. On the server side the corrupt data is not cached either: the GlanceException still propagates through open_for_write, which rolls the incomplete file back to .invalid and drops the cache DB entry before we swallow the exception. So we don\u0027t serve or store garbage — the patch only stops us from corrupting the HTTP framing, which lets the client report the real reason (InvalidResponse).","commit_id":"5704ffe41db9519ff012d142017e3e5fa654d19f"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"a66995e3eb75a48743edba2c5661e96c48194680","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"ccdecb18_99e6cde6","in_reply_to":"f04bc2f6_9ea2b267","updated":"2026-07-10 15:07:38.000000000","message":"So in the bug report, I can see the following:\n\n\n    $ openstack image save c35e644a-21cd-4852-9dab-190ba5032d53 --file cirros-image-test\n    Unable to download image: InvalidResponse\n\n\nAnd this comment by the reporter:\n\n\n    Note that the InvalidResponse in openstack client is a good answer, because the checksum is wrong and the client is checking the checksum\n\n\nI wonder why the download should complete. If the checksum is wrong, surely we don\u0027t want to download garbage?\n\n@pierre.libeau@ovhcloud.com After applying this patch, do you get the same error messgae with and without cache enabled? Does the image ever end up being downloaded?","commit_id":"5704ffe41db9519ff012d142017e3e5fa654d19f"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"a66995e3eb75a48743edba2c5661e96c48194680","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"942b9bf2_1f6bb28e","updated":"2026-07-10 15:07:38.000000000","message":"A question inline.","commit_id":"582432b8232506a0aef5e2b563ccdf628f8efc84"},{"author":{"_account_id":29037,"name":"Pierre-Samuel Le Stang","email":"pierre-samuel.le-stang@ovhcloud.com","username":"pslestang"},"change_message_id":"d479d585ba4a9cb12e615bf3d1129934bcad1d6c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"1dfa7b67_6e5db1de","updated":"2026-07-10 12:23:39.000000000","message":"Fixed following @cyril@redhat.com comments","commit_id":"582432b8232506a0aef5e2b563ccdf628f8efc84"}],"glance/image_cache/__init__.py":[{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"f13aebbf6329340866b1498e2198e2ad54ba37cc","unresolved":true,"context_lines":[{"line_number":375,"context_line":"            # bad length), or corrupt data (checksum is wrong)."},{"line_number":376,"context_line":"            # NOTE(plibeau): bug #2012898 we don\u0027t want save and reraise"},{"line_number":377,"context_line":"            # exception because this action broke the customer download"},{"line_number":378,"context_line":"            LOG.exception(encodeutils.exception_to_unicode(e))"},{"line_number":379,"context_line":"        except Exception as e:"},{"line_number":380,"context_line":"            LOG.exception(_LE(\"Exception encountered while tee\u0027ing \""},{"line_number":381,"context_line":"                              \"image \u0027%(image_id)s\u0027 into cache: %(error)s. \""}],"source_content_type":"text/x-python","patch_set":4,"id":"2b70f436_d1bf093d","line":378,"range":{"start_line":378,"start_character":26,"end_line":378,"end_character":58},"updated":"2026-06-30 17:33:52.000000000","message":"OVH has customers, Glance has users. Also, do not use past tense: \"Do not save and reraise as this would prevent the end user from getting a meaningful error message\", or something like that.","commit_id":"5704ffe41db9519ff012d142017e3e5fa654d19f"},{"author":{"_account_id":29037,"name":"Pierre-Samuel Le Stang","email":"pierre-samuel.le-stang@ovhcloud.com","username":"pslestang"},"change_message_id":"d479d585ba4a9cb12e615bf3d1129934bcad1d6c","unresolved":false,"context_lines":[{"line_number":375,"context_line":"            # bad length), or corrupt data (checksum is wrong)."},{"line_number":376,"context_line":"            # NOTE(plibeau): bug #2012898 we don\u0027t want save and reraise"},{"line_number":377,"context_line":"            # exception because this action broke the customer download"},{"line_number":378,"context_line":"            LOG.exception(encodeutils.exception_to_unicode(e))"},{"line_number":379,"context_line":"        except Exception as e:"},{"line_number":380,"context_line":"            LOG.exception(_LE(\"Exception encountered while tee\u0027ing \""},{"line_number":381,"context_line":"                              \"image \u0027%(image_id)s\u0027 into cache: %(error)s. \""}],"source_content_type":"text/x-python","patch_set":4,"id":"985faf40_14ceb3ed","line":378,"range":{"start_line":378,"start_character":26,"end_line":378,"end_character":58},"in_reply_to":"2b70f436_d1bf093d","updated":"2026-07-10 12:23:39.000000000","message":"Done","commit_id":"5704ffe41db9519ff012d142017e3e5fa654d19f"}]}
