You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
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).
However, the failure at the end of upload here seems like API bug that shouldn't be related to the image being compressed. Images that don't work should not fail until you actually try to boot them — the upload process is totally agnostic to the bytes being written to the disk.
Just ran into this while trying to upload a bad image on purpose to create a failed instance. If we don't change the API logic, we could at least check that the content length in bytes is a multiple of block size before we let the user sit there for a while watching the file upload.
Activity
david-crespo commentedon Oct 14, 2024
We added the soft validation in #2217
However, the failure at the end of upload here seems like API bug that shouldn't be related to the image being compressed. Images that don't work should not fail until you actually try to boot them — the upload process is totally agnostic to the bytes being written to the disk.
david-crespo commentedon Apr 9, 2025
Just ran into this while trying to upload a bad image on purpose to create a failed instance. If we don't change the API logic, we could at least check that the content length in bytes is a multiple of block size before we let the user sit there for a while watching the file upload.
Validate client-side that image size is a multiple of block size (#3183)