Skip to content
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

[Bug]: Firefox Won't Open WACZ from Remote Server because the Size of the File is Not Accessible #318

Open
markpbaggett opened this issue Apr 25, 2024 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@markpbaggett
Copy link

ReplayWeb.page Version

v2.0.0

What did you expect to happen? What happened instead?

When trying to replay a WACZ in Firefox, I get this error message:

Sorry, this URL could not be loaded because the size of the file is not accessible.
Make sure this is a valid URL and you have access to this file.

Interestingly, this works fine in both Chrome and Safari. I'm not sure if this is related to how I captured the WACZ or something else.

In case it's helpful, I used Browsertrix-Crawler and this command:

docker run -v $PWD/crawls:/crawls/ -it webrecorder/browsertrix-crawler crawl --url https://abolition-now.github.io/an --generateWACZ --text --collection abolition_now_test

This opens fine in replayweb.page locally, but won't open in Firefox remotely:

https://digital.lib.utk.edu/demo/abolition_now_test.wacz

Is the web server not returning a header or something that replayweb.page is expecting?

Step-by-step reproduction instructions

  1. Open Firefox
  2. Navigate to replayweb.page
  3. Attempt to open this externally hosted resource: https://digital.lib.utk.edu/demo/abolition_now_test.wacz

Additional details

No response

@markpbaggett markpbaggett added the bug Something isn't working label Apr 25, 2024
@Shrinks99
Copy link
Member

Shrinks99 commented Apr 29, 2024

Is the web server not returning a header or something that replayweb.page is expecting?

@edsu recently wrote a good forum post on exactly this problem for another user experiencing the same thing. I can partially replicate this behavior by trying to download the file in the browser, it will not be able to display a progress bar or time remaining estimate (in either Firefox or Chrome)!

... However, using curl --head returns this, which includes Content-Length so that's curious.

~ curl --head https://digital.lib.utk.edu/demo/abolition_now_test.wacz
HTTP/1.1 200 OK
Date: Mon, 29 Apr 2024 20:13:18 GMT
Server: Apache
Last-Modified: Wed, 24 Apr 2024 13:39:28 GMT
ETag: "88e8f59-616d7ccb8d565"
Accept-Ranges: bytes
Content-Length: 143560537
Vary: Accept-Encoding
Access-Control-Allow-Origin: *

Either way, if the file works fine locally it's probably not that, most likely a server config issue?? Can replicate it working in Chrome though.

@Shrinks99 Shrinks99 added question Further information is requested bug Something isn't working and removed bug Something isn't working labels Apr 29, 2024
@ikreymer
Copy link
Member

ikreymer commented Jun 10, 2024

The issue is unfortunately due to a bug/incorrect handling in Firefox. Chrome and Safari correct add Accept-Encoding: identity (the default) header when a range request is sent, allowing the server to return content-length. Unfortunately, Firefox always sends Accept-Encoding: gzip, deflate, br, zstd, which causes the header to return a compressed version of the WACZ, which is not what we want.

Barring the fix in Firefox, I think the best option is to ensure your server ignores the Accept-Encoding header for WACZ files.

You can see that if you do curl --head -H "Accept-Encoding: gzip, deflate, br, zstd" https://digital.lib.utk.edu/demo/abolition_now_test.wacz, there will be no content-length. Unfortunately, it seems there's no way to prevent Firefox from sending this header. (Will open a bug in firefox).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants