Mord3rca / gamma-launcher

Just another Launcher to setup S.T.A.L.K.E.R.: G.A.M.M.A.
GNU General Public License v3.0
86 stars 13 forks source link

Getting ChunkedEncodingError in v1.5 #77

Closed ThomasMartin83 closed 11 months ago

ThomasMartin83 commented 11 months ago

I'm new to GitHub, so please excuse me if something is wrong with my post.

This is my first try to use Mord3rca's launcher. I downloaded the release version 1.5. Everything was fine — I install Anomaly, patched it and sums are correct. But when I'm trying to full-install, I get this error:

[frank@HFPC-FTZ0 Games]$ STALKER2/gamma-launcher full-install --anomaly '/home/frank/Games/STALKER2/ANO/' --gamma '/home/frank/Games/STALKER2/GAMMA/'
[+] Installing base setup for GAMMA
  - Downloading Mod.Organizer-2.4.4.7z: 85.9MiB [01:28, 1.02MiB/s]
  - Downloading gamma_setup.zip: 1.11GiB [20:38, 961kiB/s] 
Traceback (most recent call last):
  File "urllib3/response.py", line 712, in _error_catcher
  File "urllib3/response.py", line 1071, in read_chunked
  File "urllib3/response.py", line 1006, in _update_chunk_length
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "requests/models.py", line 816, in generate
  File "urllib3/response.py", line 931, in stream
  File "urllib3/response.py", line 1059, in read_chunked
  File "contextlib.py", line 158, in __exit__
  File "urllib3/response.py", line 729, in _error_catcher
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gamma-launcher.py", line 8, in <module>
  File "launcher/cli.py", line 68, in main
  File "launcher/commands/install.py", line 407, in run
  File "launcher/commands/install.py", line 172, in run
  File "tenacity/__init__.py", line 289, in wrapped_f
  File "tenacity/__init__.py", line 379, in __call__
  File "tenacity/__init__.py", line 314, in iter
  File "concurrent/futures/_base.py", line 449, in result
  File "concurrent/futures/_base.py", line 401, in __get_result
  File "tenacity/__init__.py", line 382, in __call__
  File "launcher/downloader/__init__.py", line 52, in download_archive
  File "launcher/downloader/base.py", line 40, in download
  File "requests/models.py", line 818, in generate
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
[28918] Failed to execute script 'gamma-launcher' due to unhandled exception!

Is there a way to overcome the issue? Really want to play GAMMA 0.9.1, but most of the guides on topic are for 0.9

Edit 1: My 0.9 GAMMA folder is 51,4 GiB, 0.9.1 is 276,7 MiB. I've moved everything from .9 to .9.1. Now it is Downloading Stalker_GAMMA.zip. I'll edit again if new information comes.

Edit 2: After about 3 hours, download process is finished. In MO2, I have 439 mods, on start I get 0.9.1 loading screen. But for some reason in the end only Anomaly starts, not GAMMA. I suspect gamma_setup can't be installed through the launcher. I'll try to do fresh installation with manually placing it in GAMMA folder

ThomasMartin83 commented 11 months ago

The text below should've been edit 3, but it's too long for that. Okay, so I tried to extract gamma_setup-main.zip manually, place it in temp folder during the installation, but nothing worked. Now I'm trying to run gamma-launcher under venv. Also commented in lines 171-178 in install.py.

# with TemporaryDirectory(prefix="gamma-launcher-mo-setup-") as dir:
        #     file = download_archive("https://github.com/Grokitach/gamma_setup", self._cache_dir or dir)
        #     extract_archive(file, self._grok_mod_dir)

        # gamma_setup_dir = list(self._grok_mod_dir.glob("gamma_setup-*"))[0]
        # for i in gamma_setup_dir.glob("*"):
        #     move(i, self._grok_mod_dir)
        # gamma_setup_dir.rmdir()

By doing that, I disabled gamma_setup-main.zip downloading process. After that, I manually extracted the zip and started launcher again. Now the script looks healthy. Here's an example of on what stage I'm in:

  - Downloading Duxs_Innumerable_Character_Kit_Voices_Pack.2.zip: 230MiB [03:40,  - Downloading Duxs_Innumerable_Character_Kit_Voices_Pack.2.zip: 231MiB [03:41,  - Downloading Duxs_Innumerable_Character_Kit_Voices_Pack.2.zip: 232MiB [03:42,  - Downloading Duxs_Innumerable_Character_Kit_Voices_Pack.2.zip: 233MiB [03:43,  - Downloading Duxs_Innumerable_Character_Kit_Voices_Pack.2.zip: 234MiB [03:44,  - Downloading Duxs_Innumerable_Character_Kit_Voices_Pack.2.zip: 234MiB [03:44, 1.09MiB/s]
    Installing Dux's Innumerable Character Kit Voices Pack -> /home/frank/Games/STALKER2/GAMMA/mods/305- Dux Characters Kit Voices Pack - Demonized
    Installing Dux's Innumerable Character Kit Voices Pack English ISG -> /home/frank/Games/STALKER2/GAMMA/mods/305- Dux Characters Kit Voices Pack - Demonized
[+] Installing mod:  Grulag's Dead Bushes
  - Downloading gamma_large_files_v2.zip: 95.0MiB [01:26, 1.17MiB/s]

I will provide more information when the script is finished or if I encounter a new error

Edit 4:

New error:
Installing Dux's Innumerable Character Kit Voices Pack -> /home/frank/Games/STALKER2/GAMMA/mods/305- Dux Characters Kit Voices Pack - Demonized Installing Dux's Innumerable Character Kit Voices Pack English ISG -> /home/frank/Games/STALKER2/GAMMA/mods/305- Dux Characters Kit Voices Pack - Demonized [+] Installing mod: Grulag's Dead Bushes - Downloading gamma_large_files_v2.zip: 1.32GiB [20:25, 1.16MiB/s] Traceback (most recent call last): File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/urllib3/response.py", line 712, in _error_catcher yield File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/urllib3/response.py", line 833, in _raw_read raise IncompleteRead(self._fp_bytes_read, self.length_remaining) urllib3.exceptions.IncompleteRead: IncompleteRead(1421025179 bytes read, 1307819144 more expected) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/requests/models.py", line 816, in generate yield from self.raw.stream(chunk_size, decode_content=True) File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/urllib3/response.py", line 934, in stream data = self.read(amt=amt, decode_content=decode_content) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/urllib3/response.py", line 905, in read data = self._raw_read(amt) ^^^^^^^^^^^^^^^^^^^ File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/urllib3/response.py", line 811, in _raw_read with self._error_catcher(): File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__ self.gen.throw(typ, value, traceback) File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/urllib3/response.py", line 729, in _error_catcher raise ProtocolError(f"Connection broken: {e!r}", e) from e urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(1421025179 bytes read, 1307819144 more expected)', IncompleteRead(1421025179 bytes read, 1307819144 more expected)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/frank/Games/STALKER2/glf/env/bin/gamma-launcher", line 8, in sys.exit(main()) ^^^^^^ File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/launcher/cli.py", line 68, in main args.cobject().run(args) File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/launcher/commands/install.py", line 415, in run self._install_mods() File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/launcher/commands/install.py", line 366, in _install_mods self._install_mod(k, v) File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/launcher/commands/install.py", line 324, in _install_mod file = download_archive(url, self._dl_dir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/tenacity/__init__.py", line 289, in wrapped_f return self(f, *args, **kw) ^^^^^^^^^^^^^^^^^^^^ File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/tenacity/__init__.py", line 379, in __call__ do = self.iter(retry_state=retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/tenacity/__init__.py", line 314, in iter return fut.result() ^^^^^^^^^^^^ File "/usr/lib/python3.11/concurrent/futures/_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/tenacity/__init__.py", line 382, in __call__ result = fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/launcher/downloader/__init__.py", line 52, in download_archive e.download(file) File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/launcher/downloader/base.py", line 40, in download for chunk in r.iter_content(chunk_size=1 * 1024 * 1024): File "/home/frank/Games/STALKER2/glf/env/lib/python3.11/site-packages/requests/models.py", line 818, in generate raise ChunkedEncodingError(e) requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(1421025179 bytes read, 1307819144 more expected)', IncompleteRead(1421025179 bytes read, 1307819144 more expected))

Oh well, I guess I should download gamma_large_files_v2.zip manually too, we'll see.

Edit 5: For some reason, I couldn't download the file even manually. But the problem is gone after changing networks. Waiting now for complete install or another error

ThomasMartin83 commented 11 months ago

Welp, nothing really worked. I get either ChunkedEncodingError or installation is broken (no GAMMA logo in main menu, files missing). I'll try another approach. Furthermore, I'll let you know if successful

ThomasMartin83 commented 11 months ago

Okay, I found the solution: You MUST download "GAMMA RC3.7z" from the discord server. For some reason I thought that it will be downloaded automatically. After following instructions exactly I have working 0.9.1.

PS Perfomance-wise it is even better then 0.9 by about 20 fps

Mord3rca commented 11 months ago

Hello,

all of this looks like a DL issue (according to urllib3 exceptions). If you can't download gamma_setup, ModOrganizer & Anomaly files, download them with a web browser and use --cache <path/to/cache/dir> to allow gamma-launcher to use them.

For all other mods, they will be stored in <path/to/gamma>/downloads

Is ChunkedEncodingError was always on the same archive ? The big ones only ?

ThomasMartin83 commented 10 months ago

If I remember correctly, ChunkedEncodingError occurred two times: at full install and when I tried to download mods. I think the big ones, yes