-
Notifications
You must be signed in to change notification settings - Fork 16
Description
As expected if you attempt to upload a compressed raw image, the upload will fail (we do not support it currently). In terms of network requests we see a number of normal bulk-write requests until we reach the end of the file at which point we receive a 400 response from nexus. The error looks like:
{
"request_id": "79a6c964-b41e-4691-933d-39a2b6626755",
"error_code": "InvalidRequest",
"message": "Data length not block size multiple"
}While we can't completely verify that the submitted file is correct, we can probably add some checks at file selection time to try and detect the error prior to uploading the entire image. Looking at the form data for the compressed vs uncompressed files in this case:
Compressed
{
"name": "Fedora-Cloud-Base-39-1.5.x86_64.raw.xz",
"size": 446022784,
"type": "application/x-xz"
}Uncompressed
{
"name": "Fedora-Cloud-Base-39-1.5.x86_64.raw",
"size": 5368709120,
"type": "image/x-panasonic-rw"
}We can probably use the type and size fields to make a guess about if the file will work or not. Given that this is not a rigorous check (the browser thinks the .raw file is a photograph) maybe we display some kind of warning if we detect specific formats that we know do not work.
And if my basic understanding of block size is correct we can also check the size reported by the browser against the selected block size. (Though I don't know how accurate these reported values are).
