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
65 stars 11 forks source link

psutil errors, BadRarFile, No space left, errors during full_install #14

Closed fonikz closed 1 year ago

fonikz commented 1 year ago

During full_install I keep getting errors in the same place.

[+] Installing mod:  Bizon Replacer
  - Using cached Better_Bizon_Weapon.7.7z
Traceback (most recent call last):
  File "/home/hukt/.local/bin/gamma-launcher", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/cli.py", line 60, in main
    args.cobject().run(args)
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/commands/install.py", line 194, in run
    self._install_mods()
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/commands/install.py", line 156, in _install_mods
    self._install_mod(k, v)
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/commands/install.py", line 123, in _install_mod
    extract_archive(file, dir)
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/archive.py", line 10, in extract_archive
    {
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/archive.py", line 11, in <lambda>
    '7z': lambda f, p: SevenZipFile(f).extractall(p),
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 963, in extractall
    self._extract(path=path, return_dict=False, callback=callback)
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 624, in _extract
    self.worker.extract(
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1264, in extract
    raise exc_info[1].with_traceback(exc_info[2])
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1289, in extract_single
    self._extract_single(fp, files, path, src_end, q, skip_notarget)
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1358, in _extract_single
    crc32 = self.decompress(fp, f.folder, obfp, f.uncompressed, f.compressed, src_end)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1409, in decompress
    max_block_size = get_memory_limit()
                     ^^^^^^^^^^^^^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/properties.py", line 98, in get_memory_limit
    import psutil
  File "/usr/lib/python3/dist-packages/psutil/__init__.py", line 102, in <module>
    from . import _pslinux as _psplatform
  File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 26, in <module>
    from . import _psutil_linux as cext
ImportError: cannot import name '_psutil_linux' from partially initialized module 'psutil' (most likely due to a circular import) (/usr/lib/python3/dist-packages/psutil/__init__.py)
[+] Installing mod:  Bizon Replacer
  - Using cached Better_Bizon_Weapon.7.7z
Traceback (most recent call last):
  File "/home/hukt/.local/bin/gamma-launcher", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/cli.py", line 60, in main
    args.cobject().run(args)
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/commands/install.py", line 194, in run
    self._install_mods()
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/commands/install.py", line 156, in _install_mods
    self._install_mod(k, v)
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/commands/install.py", line 123, in _install_mod
    extract_archive(file, dir)
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/archive.py", line 10, in extract_archive
    {
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/archive.py", line 11, in <lambda>
    '7z': lambda f, p: SevenZipFile(f).extractall(p),
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 963, in extractall
    self._extract(path=path, return_dict=False, callback=callback)
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 624, in _extract
    self.worker.extract(
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1264, in extract
    raise exc_info[1].with_traceback(exc_info[2])
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1289, in extract_single
    self._extract_single(fp, files, path, src_end, q, skip_notarget)
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1358, in _extract_single
    crc32 = self.decompress(fp, f.folder, obfp, f.uncompressed, f.compressed, src_end)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1409, in decompress
    max_block_size = get_memory_limit()
                     ^^^^^^^^^^^^^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/properties.py", line 102, in get_memory_limit
    avmem = psutil.virtual_memory().available
            ^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'psutil' has no attribute 'virtual_memory'`
Mord3rca commented 1 year ago

You don't seems to use a venv. Can you retry with one ?

This seems to be a dependency error, what distro are you using ?

For reference, on my venv, psutil is at version 5.9.4

fonikz commented 1 year ago

Maybe I did it wrong, never using venv's before. I did create a venv in the folder the launcher is in with python3 -m venv launcher/

And then python3.11 pip install gamma-launcher-master/ to install. Is there a venv-specific command to install or run gamma-launcher after creating the venv?

I'm using Ubuntu Studio 22.04, KDE Plasma 5.24.7

Mord3rca commented 1 year ago

You need to create the venv with: python3 -m <dir> Then activate the venv: . <dir>/bin/activate

Finally, you install the launcher with pip and dependency should be installed by it. pip install <path/to/launcher>

And now you can use the launcher without error

Edit: Or you can follow this guide

fonikz commented 1 year ago

Finally got to try this, I was having issues with whitespace in the filepath (that I never worked out, I just renamed the directory).

Same issue even working within the venv.


[+] Updating G.A.M.M.A. definition
[+] Reading GAMMA/.Grok's Modpack Installer/G.A.M.M.A/modpack_data/modlist.txt & GAMMA/.Grok's Modpack Installer/G.A.M.M.A/modpack_data/modpack_maker_list.txt...
[+] Installing mod:  Dux Characters Kit Voices Pack
  - Using cached Duxs_Innumerable_Character_Kit_Voices_Pack.2.zip
    Installing Dux's Innumerable Character Kit Voices Pack -> GAMMA/mods/305- Dux Characters Kit Voices Pack - Demonized
    Installing Dux's Innumerable Character Kit Voices Pack English ISG -> GAMMA/mods/305- Dux Characters Kit Voices Pack - Demonized
[+] Installing mod:  Grulag's Dead Bushes
  - Using cached gamma_large_files_v2.zip
    Installing gamma_large_files_v2-main/Grulag's Dead Bushes -> GAMMA/mods/272- Grulag's Dead Bushes - Grulag
[+] Installing mod:  Headlamp Animation Fix
  - Using cached HeadlampAnimationFix.3.zip
    Installing HeadlampAnimationFix -> GAMMA/mods/270- Headlamp Animation Fix - RavenAscendant
[+] Installing mod:  Safe Areas Transitions
  - Using cached Safe_Start_2.2.zip
[+] Installing mod:  Zone Customization Project (ZCP)
  - Using cached zone_customization_project_1.5e.zip
[+] Installing mod:  Hideout Furniture
  - Using cached HideoutFurniture-v2.1.0.zip
    Installing 00 Main -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 001 Dependencies/ahuyn -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 001 Dependencies/arm -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 10 Nomad Module/11 Stash Containers -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 10 Nomad Module/12 Portable Lights -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31 Weapon Displays -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.3 VSSK Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.2 PPP Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.1 AUGmented Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.5 Bizon Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.6 Vityaz Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.7 G36 Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.8 Saiga-12K Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.9 SVD Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.10 AN-94 Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 30 Fortress Module/31.0 Patches/31.11 KAR Patch -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 40 Homestead Module/41 Portable Workshop -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 50 Fun Module/51 Piano -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 50 Fun Module/52 Radio -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 50 Fun Module/52.0 Other Stations/52.1 Anomaly Radios Extended -> GAMMA/mods/245- Hideout Furniture - Aoldri
    Installing 90 Addons/91 Stash Capacities -> GAMMA/mods/245- Hideout Furniture - Aoldri
[+] Installing mod:  Weird Tasks Framework
  - Using cached WTF_3.6.zip
    Installing Weird_Tasks_Framework -> GAMMA/mods/244- Weird Tasks Framework - Igigog
[+] Installing mod:  Bizon Replacer
  - Using cached Better_Bizon_Weapon.7.7z
Traceback (most recent call last):
  File "/home/hukt/.local/bin/gamma-launcher", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/cli.py", line 60, in main
    args.cobject().run(args)
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/commands/install.py", line 194, in run
    self._install_mods()
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/commands/install.py", line 156, in _install_mods
    self._install_mod(k, v)
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/commands/install.py", line 123, in _install_mod
    extract_archive(file, dir)
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/archive.py", line 10, in extract_archive
    {
  File "/home/hukt/.local/lib/python3.11/site-packages/launcher/archive.py", line 11, in <lambda>
    '7z': lambda f, p: SevenZipFile(f).extractall(p),
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 963, in extractall
    self._extract(path=path, return_dict=False, callback=callback)
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 624, in _extract
    self.worker.extract(
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1264, in extract
    raise exc_info[1].with_traceback(exc_info[2])
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1289, in extract_single
    self._extract_single(fp, files, path, src_end, q, skip_notarget)
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1358, in _extract_single
    crc32 = self.decompress(fp, f.folder, obfp, f.uncompressed, f.compressed, src_end)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/py7zr.py", line 1409, in decompress
    max_block_size = get_memory_limit()
                     ^^^^^^^^^^^^^^^^^^
  File "/home/hukt/.local/lib/python3.11/site-packages/py7zr/properties.py", line 98, in get_memory_limit
    import psutil
  File "/usr/lib/python3/dist-packages/psutil/__init__.py", line 102, in <module>
    from . import _pslinux as _psplatform
  File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 26, in <module>
    from . import _psutil_linux as cext
ImportError: cannot import name '_psutil_linux' from partially initialized module 'psutil' (most likely due to a circular import) (/usr/lib/python3/dist-packages/psutil/__init__.py)```
Mord3rca commented 1 year ago

Can you do a pip list in the venv ?

fonikz commented 1 year ago

Sorry, it was me, changing the directory name borked the venv (it was still named after the old directory). Rebuilding the venv fixed. But now, a new issue on a new mod. I tried the cached version as well as downloading a new copy:

Traceback (most recent call last):
  File "/mnt/instant/Games/stalker/env/bin/gamma-launcher", line 33, in <module>
    sys.exit(load_entry_point('launcher==0.1', 'console_scripts', 'gamma-launcher')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/cli.py", line 60, in main
    args.cobject().run(args)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/commands/install.py", line 194, in run
    self._install_mods()
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/commands/install.py", line 156, in _install_mods
    self._install_mod(k, v)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/commands/install.py", line 123, in _install_mod
    extract_archive(file, dir)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/archive.py", line 10, in extract_archive
    {
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/archive.py", line 12, in <lambda>
    'rar': lambda f, p: RarFile(f).extractall(p),
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/rarfile.py", line 847, in extractall
    dst = self._extract_one(inf, path, pwd, not inf.is_dir())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/rarfile.py", line 912, in _extract_one
    return self._make_file(info, dstfn, pwd, set_attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/rarfile.py", line 927, in _make_file
    shutil.copyfileobj(src, dst)
  File "/usr/lib/python3.11/shutil.py", line 197, in copyfileobj
    buf = fsrc_read(length)
          ^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/rarfile.py", line 2197, in read
    raise BadRarFile("Failed the read enough data: req=%d got=%d" % (orig, len(data)))
rarfile.BadRarFile: Failed the read enough data: req=35629 got=0
fonikz commented 1 year ago

Fixed by installing unrar.

Note that pip install unrar was not enough, I had to apt install unrar

Mord3rca commented 1 year ago

To find the bad rar File, do a check-md5 and delete files from downloads folder if md5sums do not match remote one

fonikz commented 1 year ago
  - Using cached Aydins_Grass_Tweaks_4.0.7z
Traceback (most recent call last):
  File "/mnt/instant/Games/stalker/env/bin/gamma-launcher", line 33, in <module>
    sys.exit(load_entry_point('launcher==0.1', 'console_scripts', 'gamma-launcher')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/cli.py", line 60, in main
    args.cobject().run(args)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/commands/install.py", line 194, in run
    self._install_mods()
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/commands/install.py", line 156, in _install_mods
    self._install_mod(k, v)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/commands/install.py", line 123, in _install_mod
    extract_archive(file, dir)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/archive.py", line 10, in extract_archive
    {
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/archive.py", line 11, in <lambda>
    '7z': lambda f, p: SevenZipFile(f).extractall(p),
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 963, in extractall
    self._extract(path=path, return_dict=False, callback=callback)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 624, in _extract
    self.worker.extract(
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 1204, in extract
    self.extract_single(
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 1292, in extract_single
    raise e
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 1289, in extract_single
    self._extract_single(fp, files, path, src_end, q, skip_notarget)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 1358, in _extract_single
    crc32 = self.decompress(fp, f.folder, obfp, f.uncompressed, f.compressed, src_end)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 1416, in decompress
    fq.write(tmp)
OSError: [Errno 28] No space left on device

Now I'm getting this, currently troubleshooting. The device isn't out of space, there's 189GB free. I'll report back what I find.

On that note, MD5 checks out but I do have a couple errors about ERROR: 02 - [OPTIONAL] RESHADE SR - Film Reshade/bin do not exist. That's not the only mod with the error.

Mord3rca commented 1 year ago

Launcher will decompress in a tmpdir (located in /tmp by default.) this can be changed with the env variable TMPDIR ex: TMPDIR=/var/tmp Note: Be sure to have R/W access to the dir

fonikz commented 1 year ago
  - Using cached Aydins_Grass_Tweaks_4.0.7z
Traceback (most recent call last):
  File "/mnt/instant/Games/stalker/env/bin/gamma-launcher", line 33, in <module>
    sys.exit(load_entry_point('launcher==0.1', 'console_scripts', 'gamma-launcher')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/cli.py", line 60, in main
    args.cobject().run(args)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/commands/install.py", line 194, in run
    self._install_mods()
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/commands/install.py", line 156, in _install_mods
    self._install_mod(k, v)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/commands/install.py", line 123, in _install_mod
    extract_archive(file, dir)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/archive.py", line 10, in extract_archive
    {
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/launcher/archive.py", line 11, in <lambda>
    '7z': lambda f, p: SevenZipFile(f).extractall(p),
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 963, in extractall
    self._extract(path=path, return_dict=False, callback=callback)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 624, in _extract
    self.worker.extract(
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 1204, in extract
    self.extract_single(
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 1292, in extract_single
    raise e
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 1289, in extract_single
    self._extract_single(fp, files, path, src_end, q, skip_notarget)
  File "/mnt/instant/Games/stalker/env/lib/python3.11/site-packages/py7zr/py7zr.py", line 1361, in _extract_single
    raise CrcError(crc32, f.crc32, f.filename)
py7zr.exceptions.CrcError: (1250159788, 602651483, "Aydin's Grass Tweaks - WINTER 3.0/gamedata/textures/detail/ground_grass_04.dds")

Sometimes it gives me this error instead. Even after changing the tmpdir.

fonikz commented 1 year ago

As usual I was doing it wrong. export TMPDIR=tmp/ and then echo TMPDIR to check that it set correctly. It's moving along now.