I’ve discovered a download issue connected to free disk space limited to the Chrome or Chromium browser. The app is a media player which runs on a dedicated PC, regardless of the low disk space there is still plenty of space for the download.
Simple code example…
function _startDownloadBackground() {
var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', 'images/background.mp4', true);
httpRequest.responseType = 'blob';
httpRequest.onload = () => {
console.log('success');
};
httpRequest.onerror = () => {
console.log('fail');
};
httpRequest.send();
}
Run this code locally removing any remote server considerations, background.mp4 is a 15 MB file (any size will produce the same results). Use Chome or Chromium as the browser.
When your PC’s disk space is normal (no red bar for the Local Disk space in the Explorer), the above function will download the mp4 on each execution. However, when disk space is low, but still more than enough to store the mp4 (in this example 1.5GB is free) you’ll experience the following…
- Open Chrome > execute the function = success
- Execute the function = Err_Failed 200
- Refresh the browser > execute the function = Err_Failed 200
- Open Dev Tools > Disable Cache > execute the function = Err_Failed
200 - Hard refresh > execute function = Err_failed
- Close Chome > open Chrome > execute the function = success
- Replay a failed xhr by right-clicking the failed request in dev tools = success
This is not an issue in Edge or Firefox. I’ve tried opening Chrome with the following switches with no luck.
–disk-cache-size=104857600 | –aggressive-cache-discard | –enable-aggressive-domstorage-flushing
Finally, I’ve taken a log from chrome://net-export/ and noticed two interesting entries (both on different requests)
- HTTP_CACHE_DOOM_ENTRY [dt=0] –> net_error = -2 (ERR_FAILED)
- HTTP_TRANSACTION_READ_BODY [dt=1] (no request for URL_REQUEST_JOB_FILTERED_BYTES_READ) then the next line reads ‘Cancelled’