File downloads not working via authenticated proxy (2001635380)

PWE
edited 9 days ago
I'm having issues syncing files from external to a PC. Adding them locally and syncing them to the cloud is not a problem.

May this be a firewall issue when connecting to wss://stream.zotero.org?
  • S3 returned 0
    Something on your computer or network is blocking downloads from the Amazon cloud.
  • edited December 10, 2024
    I'm behind the same proxy and found that it indeed works using Zotero 6.

    It looks like the implemention changed slightly.

    How can I assist in debugging this issue?

    BTW: Disabling WebSockets does not help. The error message is:

    [JavaScript Error: "S3 returned 0 for 2228042/7QVTDDUC -- retrying download" {file: "chrome://zotero/content/xpcom/storage/zfs.js" line: 177}]
    Zotero.Sync.Storage.Mode.ZFS.prototype.downloadFile</listener<.onStop<@chrome://zotero/content/xpcom/storage/zfs.js:177:32
  • We can look at a Debug ID, but Zotero's network stack is just Firefox's. Zotero 6 was based on Firefox 60. Zotero 7 is based on Firefox 115. Most likely you'll need to debug this on your end. If you're getting as far as the above error, Zotero's network requests are working for you generally and it's just requests to Amazon S3 that are being blocked.

    (As I've explained before, the WebSockets connection is totally irrelevant.)
  • I'm back on this issue and verified that it works with Zotero 6.0.36 but does not work with Zotero 7.0.12. Both versions are installed side-by-side at the same machine and using the same profile with exactly the same settings.

    In Zotero 7 I'v enabled the Network monitoring in the console and see the GET request to the file:

    GET /users/xxxxxx/items/YYYYYYY/file HTTP/1.1
    Host: api.zotero.org
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0) Gecko/20100101 Zotero/7.0.12


    But this request is blocked with "407 authenticationrequired" which means the proxy authentication does not work for the file requests:

    HTTP/1.1 407 authenticationrequired
    Date: Mon, 24 Feb 2025 16:01:05 GMT
    Content-Type: text/html
    Cache-Control: no-cache
    Content-Length: 3996
    X-Frame-Options: deny
    Proxy-Connection: Keep-Alive
    Proxy-Authenticate: Basic realm="McAfee Web Gateway"


    The next entry in the console is the error posted above:

    S3 returned 0 for 1/YYYYYYY -- retrying download zfs.js:177
    onStop chrome://zotero/content/xpcom/storage/zfs.js:177


    In Zotero 6 there is no possibility to enable the network monitoring but the download simply works. I assume that there is a difference in the proxy authentication of Zotero 7. Will dig into it further.
  • I've looked into the commit history of zfs.js and found no significant difference between Zotero 6 and Zotero 7. The downloadFile function calls Zotero.Utilities.Internal.saveURI to start the download process (the initial GET request mentioned above).
    Comparing the saveURI function of utilities_internal.js between Z6 and Z7 shows IMHO significant differences in the parameters passing to nsIWebBrowserPersist.saveURI, i.e. Services.scriptSecurityManager.createNullPrincipal({}) is used as the second parameter in Z7 compared to null in Z6. I believe that this is relevant.
    The signature of the function nsIWebBrowserPersist.saveURI changed from eight parameters to ten. Unfortunately, I cannot find the recent interface documentation of nsIWebBrowserPersist to dig into it deeper.

    BTW: the download of files via proxy works in general in Z7 but not if the proxy requires authentication.
  • Maybe, someone can change the discussion title because it has nothing to do with wss. The cause of the problem is the same as with https://forums.zotero.org/discussion/117327.
  • Title updated. We'll look into it. Thanks for the additional debugging.
Sign In or Register to comment.