mindstorm38 / portablemc

A fast, reliable and cross-platform command-line Minecraft launcher and API for developers. Including fast and easy installation of common mod loaders such as Fabric, Forge, NeoForge and Quilt.
https://pypi.org/project/portablemc/
GNU General Public License v3.0
372 stars 20 forks source link

Unexpected Error while loading libraries / startup #138

Closed michaelkargl closed 1 year ago

michaelkargl commented 1 year ago

Hey there! Just upgraded to the latest version (pip install portablemc==3.3.0). Unfortunately, the application runs into an unhandled exception on start:

PS C:\Users\Michael\AppData\Roaming\.minecraft> pip uninstall portablemc
PS C:\Users\Michael\AppData\Roaming\.minecraft> pip install portablemc==3.3.0
PS C:\Users\Michael\AppData\Roaming\.minecraft> portablemc.exe start fabric:1.19.2 --microsoft --anonymise --login 'm@mail.com'
  [  OK  ] Resolving fabric loader for 1.19.2...
  [  OK  ] Resolved version fabric-1.19.2-0.14.19.
  [  OK  ] Loaded version JAR.
  [  OK  ] Checked 3390 assets.
  [  OK  ] Loaded pretty logger.
  [      ] Loading libraries...
  [FAILED] An unexpected error happened, please report it to the authors:
  Traceback (most recent call last):
    File "D:\SDKs\Python\Python311\Lib\site-packages\portablemc\cli.py", line 350, in cmd
      handler(ns, new_context(ns))
    File "D:\SDKs\Python\Python311\Lib\site-packages\portablemc\cli.py", line 808, in wrapper
      return func(orig_func, *w_args, **w_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Michael\AppData\Roaming\Python\Python311\site-packages\portablemc_fabric\__init__.py", line 29, in cmd_start
      return old(ns, ctx)
             ^^^^^^^^^^^^
    File "D:\SDKs\Python\Python311\Lib\site-packages\portablemc\cli.py", line 493, in cmd_start
      version.prepare_libraries(predicate=libraries_predicate)
    File "D:\SDKs\Python\Python311\Lib\site-packages\portablemc\__init__.py", line 499, in prepare_libraries
      raise ValueError("No download entry.", lib_spec)
  ValueError: ('No download entry.', <portablemc.LibrarySpecifier object at 0x0000022553C9E680>)

That command worked fine in the previous version

PS C:\Users\Michael\AppData\Roaming\.minecraft> pip uninstall portablemc
PS C:\Users\Michael\AppData\Roaming\.minecraft> pip install portablemc==3.2.1
  Successfully installed portablemc-3.2.1
PS C:\Users\Michael\AppData\Roaming\.minecraft> portablemc.exe start fabric:1.19.2
  [  OK  ] Resolving fabric loader for 1.19.2...
  [  OK  ] Resolved version fabric-1.19.2-0.14.19.
  [  OK  ] Loaded version JAR.
  [  OK  ] Checked 3390 assets.
  [  OK  ] Loaded pretty logger.
  [  OK  ] Loaded 70 libraries.
  [  OK  ] Loaded Mojang Java 17.0.3.
  [      ] Downloading fabric-1.19.2-0.14.19.jar                  10.90% 464.6kB/s
           Interrupted.

Some environment information:

PS C:\Users\Michael\AppData\Roaming\.minecraft> python --version
Python 3.11.2
PS C:\Users\Michael\AppData\Roaming\.minecraft> pip list -v
Package           Version   Location                                                        Installer
----------------- --------- --------------------------------------------------------------- ---------
certifi           2022.12.7 D:\SDKs\Python\Python311\Lib\site-packages                      pip
portablemc        3.3.0     D:\SDKs\Python\Python311\Lib\site-packages                      pip
portablemc-fabric 2.0.1     C:\Users\Michael\AppData\Roaming\Python\Python311\site-packages pip
pip               23.0.1    D:\SDKs\Python\Python311\Lib\site-packages                      pip
setuptools        65.5.0    D:\SDKs\Python\Python311\Lib\site-packages                      pip

Is there anything I can do to help?

mindstorm38 commented 1 year ago

I'll test this, thank you for the feedback! I was a bit afraid of this happening when adding a hard error on such cases. For know, you can revert, I'll push a fix today.... Definitely lacking tests

mindstorm38 commented 1 year ago

Perfect! I can reproduce it

mindstorm38 commented 1 year ago

Should work now!

mindstorm38 commented 1 year ago

I'll yank the 3.3.0 version.

michaelkargl commented 1 year ago

That was impressingly fast! We just used v3.3.1 in our scripts and it works great. Thanks a lot for the quick fix 🚀 Happy weekend!

mindstorm38 commented 1 year ago

Thank you!