ItsSim / fsolauncher

Official FreeSO Launcher made with Electron
https://beta.freeso.org
Mozilla Public License 2.0
18 stars 9 forks source link

[Windows, Mac] Investigate download errors #19

Closed ItsSim closed 1 year ago

ItsSim commented 3 years ago

All downloads available in the launcher are behind the launcher website proxy (https://beta.freeso.org/LauncherResourceCentral). Downloads work flawlessly for most people, but some seem to get a network error.

Need to check logs to find out why some of them are failing. Might be an issue with the NGINX proxy. From there, see if it can be fixed or if it’s necessary to provide a mirror for the downloads.

Need to be able to confirm it with someone that actually has the issue to completely close this.

ItsSim commented 2 years ago

Happens with The Sims Online download mostly. There were recently download errors with SDL but that was fixed by self-hosting the SDL download.

tomgrice commented 2 years ago

Hey,

I've encountered this and spent quite a bit of time trying to work out why I was unable to download the packages on one system but not another. I've been doing some work on cloud gaming instances and was unable to use the launcher to download anything from beta.freeso.org on my AWS cloud vps, via the original links defined in the electron app, but those links were redirected without issue using a browser such as Opera/Chrome/Edge. Using the electron app, the server threw a 503 error. Using a browser, I was redirected successfully with a http 301 code.

Changing the url constant in the source to the redirected url (https://beta.freeso.org/TSO.docx) results in a successful download. I think the Cloudflare is blocking the redirection from certain IPs/apps as spam protection.

I tried various stuff such as proxying via a cloudflare worker, and reverse apache proxy on my own server but my laptop shutdown unexpectedly and lost progress. Probably not worth working much more on it as the issue must be pretty rare.

Maybe the files could be mirrored on AWS S3/Google Cloud as a mirror of last resort in case error 503 is thrown in order to resolve these very rare edge cases? Would be happy to help if needed.

Cheers TommyG

ItsSim commented 2 years ago

Thanks, @tomgrice!

I’ll try to repro this on an AWS server instance myself and debug further.

tomgrice commented 2 years ago

Hi @ItsSim

I've had some success with the Electron 'net' module rather than the node native https module. It seems to handle the redirection perfectly.

https://www.electronjs.org/docs/latest/api/net

Probably wouldn't be too hard to plug that in although the .get() helper method is not available, so it would have to be handled using .request().

Hope this helps :)

tomgrice commented 2 years ago

See https://github.com/ItsSim/fsolauncher/pull/25

I've added a workaround so the follow-redirects module will use the request method from Electron's net module, using Chromium to fetch data instead of the native http client.

ItsSim commented 2 years ago

1.8.7 is live which includes https://github.com/ItsSim/fsolauncher/pull/25.

Hopefully it fixes this for everyone that seemed to be having this issue. Will close this after some time if it’s not reported anymore.

Thanks again @tomgrice!

ItsSim commented 2 years ago

About a month has passed, closing as it seems to have been resolved with #25!

ItsSim commented 2 years ago

Seems to keep happening to some. The error is "End of central directory signature not found", which means the zip file is corrupt. I have never been able to reproduce this. Only seems to happen with the TSO download.

The alternative I'm considering is to download directly from the source, instead of the beta.freeso.org/LauncherResourceCentral proxy.

Will keep investigating.

tomgrice commented 2 years ago

Might be helpful if we are able to somehow obtain the file that is saved to these users’ system? I guess it’s possible that issues are occurring due to web filters on the user’s side, or Cloudflare still throwing up errors?

ItsSim commented 2 years ago

Might be helpful if we are able to somehow obtain the file that is saved to these users’ system? I guess it’s possible that issues are occurring due to web filters on the user’s side, or Cloudflare still throwing up errors?

Obtaining the file would be useful. Currently the launcher cleans up all the files when the installer finishes or encounters an error. I'll think of a way to allow the user to help debug this.

ItsSim commented 1 year ago

Has been some time without reports. Sentry #50 should also give some insight into this.