#60 Azure error handling should skip on BadRequest
Opened by jcline. Modified

Currently the uploader is spinning on a message:

The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/srv/image-uploader/venv/lib64/python3.13/site-packages/fedora_image_uploader/azure.py", line 79, in __call__
self.azure_upload_and_import_image(image, ffrel)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/srv/image-uploader/venv/lib64/python3.13/site-packages/fedora_image_uploader/azure.py", line 228, in azure_upload_and_import_image
self.azure_create_image_version(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
image, ffrel, gallery_image_name, image_version, blob_client
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/srv/image-uploader/venv/lib64/python3.13/site-packages/fedora_image_uploader/azure.py", line 215, in azure_create_image_version
op.result(30 * 60)
~~~~~~~~~^^^^^^^^^
File "/srv/image-uploader/venv/lib64/python3.13/site-packages/azure/core/polling/_poller.py", line 326, in result
self.wait(timeout)
~~~~~~~~~^^^^^^^^^
File "/srv/image-uploader/venv/lib64/python3.13/site-packages/azure/core/tracing/decorator.py", line 119, in wrapper_use_tracer
return func(*args, **kwargs)
File "/srv/image-uploader/venv/lib64/python3.13/site-packages/azure/core/polling/_poller.py", line 345, in wait
raise self._exception # type: ignore
^^^^^^^^^^^^^^^^^^^^^
File "/srv/image-uploader/venv/lib64/python3.13/site-packages/azure/core/polling/_poller.py", line 250, in _start
self._polling_method.run()
~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/srv/image-uploader/venv/lib64/python3.13/site-packages/azure/core/polling/base_polling.py", line 820, in run
raise HttpResponseError(response=self._pipeline_response.http_response, error=err) from err
azure.core.exceptions.HttpResponseError: (BadRequest) The specified cookie value in VHD footer indicates that disk 'b15a164ace8d7f7d6d78931cf495e21c21be96467cd4a43fe161fda60faecf1b.vhd' with blob https://fedoraimageupload.blob.core.windows.net:8443/vhds/b15a164ace8d7f7d6d78931cf495e21c21be96467cd4a43fe161fda60faecf1b.vhd is not a supported VHD. Disk is expected to have cookie value 'conectix'.
Code: BadRequest
Message: The specified cookie value in VHD footer indicates that disk 'b15a164ace8d7f7d6d78931cf495e21c21be96467cd4a43fe161fda60faecf1b.vhd' with blob https://fedoraimageupload.blob.core.windows.net:8443/vhds/b15a164ace8d7f7d6d78931cf495e21c21be96467cd4a43fe161fda60faecf1b.vhd is not a supported VHD. Disk is expected to have cookie value 'conectix'.

I'm not sure if the upload failed somehow, or if this is a new requirement. Either way, it should log an error once and discard the image. It can always retry the next nightly build.


My theory is that the upload happened slowly enough to get bonked, or was otherwise interrupted. Probably should see if I can provide the expected checksum with the upload so it fails server-side appropriately?

Metadata