-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Error: Unexpected response, download incomplete." in Firefox #3243
Comments
The preview also works without issues, for shorter documents it displays the entire thing without issues. |
is it fixed #3214 ? |
I'll check in the evening |
I just updated to |
I've debugged this and seems that Firefox for some reason doesn't report the downloaded size as others do.
And we expect them to be the same. |
interesting, that's quite the difference. first thing that came to my mind was "compressed size", but I don't think the difference is big enough to account for gzip. |
Yes, and the difference changes depending on the filesize so we can't account for a fixed offset. |
@cesnietor I googled around a bit and my suspicion is currently, that "progress" might not consistently fire for the last bytes. It seems the spec is only requiring it to be fired at least once: https://xhr.spec.whatwg.org/#dom-progressevent-loaded I think you want to also mount a handler to the |
Non of my assumptions turned out to be true. I even had a case where |
Thanks for investigating, was a nice start, I also tried some stuff and indeed the Please use |
I just confirmed: The size reported by firefox is the gzipped size of the file. I counted the bytes from curl's output with and without the --compressed option, they line up exactly. |
The intent of the size check is to detect incomplete downloads, right? In what scenario would a download be incompletely while not triggering any of the error/failure mechanism of XHR? i.e.: is the check like this really necessary? |
ah interesting 🤔 .
So this is the original issue. |
We could use the |
loadend and load behaved identical to progress. |
oh but we wouldn't need to read the
|
Ah so instead of tracking the size you assume that when load is fired the download really was complete? Does the browser have enough information to decide this given that minio is doing chunked transfer? |
I hope so :D I'm doing some testing. |
I considered migrating the code over to fetch, but it seems that is has the exact same problem: anthumchris/fetch-progress-indicators#13 (comment) So regarding checking the size we are pretty much all out of luck. |
Ok these are my findings so far:
Thinking about the initial problem we were trying to solve, is to not download a file when it's incomplete and surface the proper error in the UI. So the best solution would be to handle the error properly when the io.Copy fails see Who should handle the error. I tried in a first proposal to do |
@cesnietor we can ignore accept-encoding for "GETs" because this can come in the way, causing wrong size being sent to client. |
@harshavardhana @cesnietor I just had a very simple idea for a fix and it works, see #3249 |
In Firefox: When I click download on any object I get "Unexpected response, download incomplete" in the "Uploads / Downloads" widget (close to the end of the progress bar, > 90%). In the network tab the only request that I see (https://console..../api/v1/buckets/.../objects/download?...) has status 200. Nothing in the minio log. Nothing in the browser console.
When I do the same in Chromium instead of Firefox, then the file downloads normally.
What I noticed: In firefox the download response payload seems to be base64 encoded, in chromium it isn't.(probably just a display thing in firefox' console)Expected Behavior
Downloads work identically in Firefox and Chromium.
Current Behavior
In Firefox it fails.
Steps to Reproduce (for bugs)
This is the only Minio cluster of mine that has this behavior and I have no idea when it started. Other clusters I operate running the same version of Minio work fine.
Context
minio/minio#19091
Your Environment
minio --version
):uname -a
):Linux ... 6.7.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 17 Feb 2024 14:02:33 +0000 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: