layday / instawow

World of Warcraft add-on manager CLI and GUI
GNU General Public License v3.0
153 stars 9 forks source link

Windows 2.2.0 install fails (Windows 10 Pro) #130

Closed j-hickman closed 3 months ago

j-hickman commented 1 year ago

After a direct upgrade (msi) from 2.1.1 to 2.2.0, this error pops up:

Traceback (most recent call last):
  File "app\instawow_gui_wrapper\__main__.py", line 32, in <module>
  File "app\instawow_gui_wrapper\__main__.py", line 28, in main
  File "app_packages\loguru\_logger.py", line 1251, in catch_wrapper
  File "app_packages\click\core.py", line 1130, in __call__
  File "app_packages\click\core.py", line 1055, in main
  File "app_packages\click\core.py", line 1657, in invoke
  File "app_packages\click\core.py", line 1404, in invoke
  File "app_packages\click\core.py", line 760, in invoke
  File "app_packages\click\decorators.py", line 26, in new_func
  File "app_packages\instawow\cli.py", line 1209, in gui
  File "app_packages\instawow_gui\app.py", line 23, in __init__
  File "app_packages\toga\app.py", line 323, in __init__
  File "app_packages\toga\platform.py", line 73, in get_platform_factory
RuntimeError: No Toga backend could be loaded.

I suspect there's a missing dependency not in the msi package for 2.2.0

layday commented 1 year ago

I can't repro this. Could you try uninstalling and reinstalling? The dependencies are all there.

j-hickman commented 1 year ago

Yes, I tried a full uninstall and reinstall using the 2.2.0 msi. I reinstalled 2.1.1 and it works fine.

j-hickman commented 1 year ago

I also tried 2.3.0 (latest release) and it has identical errors (but different line numbers for those errors) to this issue.

Traceback (most recent call last):
  File "app\instawow_gui_wrapper\__main__.py", line 32, in <module>
  File "app\instawow_gui_wrapper\__main__.py", line 28, in main
  File "app_packages\loguru\_logger.py", line 1251, in catch_wrapper
  File "app_packages\click\core.py", line 1130, in __call__
  File "app_packages\click\core.py", line 1055, in main
  File "app_packages\click\core.py", line 1657, in invoke
  File "app_packages\click\core.py", line 1404, in invoke
  File "app_packages\click\core.py", line 760, in invoke
  File "app_packages\click\decorators.py", line 26, in new_func
  File "app_packages\instawow\cli.py", line 1212, in gui
  File "app_packages\instawow_gui\app.py", line 23, in __init__
  File "app_packages\toga\app.py", line 323, in __init__
  File "app_packages\toga\platform.py", line 73, in get_platform_factory
RuntimeError: No Toga backend could be loaded.
layday commented 1 year ago

Could you please check if there is a toga_winforms-0.3.1.dist-info folder in app_packages? It should have an entry_points.txt inside.

j-hickman commented 1 year ago

image

The directory appears to be there, but entry_points.txt is not.

layday commented 1 year ago

That's "toga-0.3.1.dist-info"; we are looking for "toga_winforms-0.3.1.dist-info" :)

j-hickman commented 1 year ago

Yes, contents are:

[toga.backends] windows = toga_winforms

layday commented 1 year ago

Just to understand this a little better, you launch instawow-gui.exe and then that error pops up on the screen - where? In an alert?

j-hickman commented 1 year ago

Starting the app (yes, instawow-gui.exe) the error pops up in an application dialog box:

image

Then closes, it never properly starts.

j-hickman commented 1 year ago

Of note, in case this comes up, I also tried right clicking on the MSI and doing a repair. It didn't resolve the issue (for 2.2.0 or 2.3.0).

layday commented 1 year ago

Could you give the version from https://github.com/layday/instawow/actions/runs/4833972401 a shot?

j-hickman commented 1 year ago

Sure, tried it. No change, same error. If there's a way to turn on debugging for you and provide you the result, I can do that as well.

layday commented 1 year ago

You might be able to find a more complete stack trace in %APPDATA%/Roaming/instawow/profiles/__jsonrpc__/error.log.

j-hickman commented 1 year ago

2023-04-28 11:25:17.375 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (33416), thread 'MainThread' (35560): Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper__main__.py", line 32, in

File "app\instawow_gui_wrapper__main__.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1209, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded. 2023-04-28 11:26:50.978 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (22440), thread 'MainThread' (33936): Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper__main__.py", line 32, in

File "app\instawow_gui_wrapper__main__.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1209, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded. 2023-04-28 11:27:56.426 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (33232), thread 'MainThread' (30188): Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper__main__.py", line 32, in

File "app\instawow_gui_wrapper__main__.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1212, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded. 2023-04-28 11:41:05.423 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (19876), thread 'MainThread' (39364): Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper__main__.py", line 32, in

File "app\instawow_gui_wrapper__main__.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1212, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded. 2023-04-28 12:20:52.350 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (38116), thread 'MainThread' (40464): Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper__main__.py", line 32, in

File "app\instawow_gui_wrapper__main__.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1212, in gui

File "app_packages\instawow_gui\app.py", line 23, in init

File "app_packages\toga\app.py", line 323, in init

File "app_packages\toga\platform.py", line 73, in get_platform_factory

RuntimeError: No Toga backend could be loaded.

j-hickman commented 1 year ago

I did find the log, as you can see above, but it doesn't seem to contain anything useful as far as I can tell.

layday commented 1 year ago

Could you try the version from https://github.com/layday/instawow/actions/runs/4838097274? It'll log a few more things in your error.log that should hopefully help with debugging the issue.

j-hickman commented 1 year ago

Interesting detail this time and I can at least confirm the log is correct:

2023-05-01 09:39:42.297 | INFO | instawow.cli:gui:1215 - sys.path=['C:\Users\J\AppData\Local\Programs\layday\instawow-gui\python310.zip', 'C:\Users\J\AppData\Local\Programs\layday\instawow-gui', 'C:\Users\J\AppData\Local\Programs\layday\instawow-gui\app_packages', 'C:\Users\J\AppData\Local\Programs\layday\instawow-gui\app'] 2023-05-01 09:39:42.297 | INFO | instawow.cli:gui:1216 - sys.meta_path=[<class '_frozen_importlib.BuiltinImporter'>, <class '_frozen_importlib.FrozenImporter'>, <class '_frozen_importlib_external.PathFinder'>] 2023-05-01 09:39:42.301 | INFO | instawow.cli:gui:1217 - entry_points()={'console_scripts': [EntryPoint(name='alembic', value='alembic.config:main', group='console_scripts')], 'distutils.setup_keywords': [EntryPoint(name='cffi_modules', value='cffi.setuptools_ext:cffi_modules', group='distutils.setup_keywords')], 'pyinstaller40': [EntryPoint(name='hook-dirs', value='rapidfuzz.pyinstaller:get_hook_dirs', group='pyinstaller40'), EntryPoint(name='tests', value='rapidfuzz.pyinstaller:get_PyInstaller_tests', group='pyinstaller40')], 'pytest11': [EntryPoint(name='anyio', value='anyio.pytest_plugin', group='pytest11')]} 2023-05-01 09:39:42.306 | INFO | instawow.cli:gui:1218 - entry_points(group="toga.backends")=[] 2023-05-01 09:39:42.306 | INFO | instawow.cli:gui:1224 - toga_winforms.files=None 2023-05-01 09:39:42.306 | ERROR | main:main:28 - An error has been caught in function 'main', process 'MainProcess' (2180), thread 'MainThread' (4120): Traceback (most recent call last):

File "runpy.py", line 196, in _run_module_as_main

File "runpy.py", line 86, in _run_code

File "app\instawow_gui_wrapper__main__.py", line 32, in

File "app\instawow_gui_wrapper__main__.py", line 28, in main

File "app_packages\click\core.py", line 1130, in call

File "app_packages\click\core.py", line 1055, in main

File "app_packages\click\core.py", line 1657, in invoke

File "app_packages\click\core.py", line 1404, in invoke

File "app_packages\click\core.py", line 760, in invoke

File "app_packages\click\decorators.py", line 26, in new_func

File "app_packages\instawow\cli.py", line 1226, in gui

File "pathlib.py", line 1134, in read_text

File "pathlib.py", line 1119, in open

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\J\AppData\Local\Programs\layday\instawow-gui\app_packages\toga_winforms-0.3.0.dev36.dist-info\entry_points.txt'

I checked that directory and confirmed there is no file with that name:

image

layday commented 1 year ago

So you've got two toga_winforms-<version>.dist-info folders side by side? That would seem to point to an uninstallation....hiccup. Could you try uninstalling instawow and deleting %APPDATA/Local/Programs/layday before reinstalling? I guess Python's picking up the first metadata folder alphabetically which is for the older toga_winforms version.

j-hickman commented 1 year ago

I agree. I looked through the installed apps on the system and an uninstall does not perform the typical uninstall via Windows Apps uninstall, so it looks like there were 5 installed versions of the app on my system (despite it being a reinstall). I went through and removed each version and then removed the %APPDATA/Local/Programs/layday folder as requested. I then reinstalled the version you provided and that fixed the issue.

My guess, based on this data, is that uninstall doesn't correctly follow the Windows installer uninstall process and it is leaving folders as well to later trip up future updates of the app.

layday commented 1 year ago

What I assume happened is that an old upgrade failed, and since that particular folder wasn't in any of the newer installers' manifests, it just stayed there until it tripped up the new backend finder in the latest version of toga, which depends on the presence of entry_points.txt. I (briefly) discussed this with the developers of the upstream library and we can't definitively say why dist-info was cleared out but the uninstaller failed to delete the folder. Perhaps instawow was running at the time and had a handle on the folder? Maybe the uninstaller was interrupted? Not sure. I suppose it'd be better if the uninstaller were to simply delete everything under "layday/instawow"; I'd have to look into how to configure it to do that.

layday commented 1 year ago

Also opened https://github.com/python/importlib_metadata/issues/457 to avoid silent failures like we've seen here.