SteamDeckHomebrew / decky-loader

A plugin loader for the Steam Deck.
https://decky.xyz
GNU General Public License v2.0
4.27k stars 154 forks source link

[BUG] _download_remote_binaries_for_plugin_with_name seems to be broken #533

Open wheaney opened 10 months ago

wheaney commented 10 months ago

Please confirm

Bug Report Description

Installing a plugin where the package.json file contains a remote_binary config seems to break the install.

See the attahced log. If it was a hash mismatch failure, it would have logged Fatal Error: Hash Mismatch for remote binary. The except case in helpers.py download_remote_binary_to_path unfortunately doesn't log any debug info, so that's where our failure is getting swallowed. I suspect it has something to do with these lines, either opening the ClientSession or the actual GET call to download the file:

            async with ClientSession() as client:
                res = await client.get(url, ssl=get_ssl_context())

After this, the installation never completes. My plugin and bin directories still have the 777 chmod flags set on them because it never completes.

Expected Behaviour

It should download the binaries, verify their hashes, and put them in the bin directory.

SteamOS version

SteamOS 3.4.10 Stable

Selected Update Channel

Stable

Have you modified the read-only filesystem at any point?

Yes

Logs

I set my log level to DEBUG, this is what I got (without all the inotify logs):

Sep 04 18:46:07 steamdeck PluginLoader[3939]: [browser][INFO]: uninstalling XREAL Air Driver
Sep 04 18:46:07 steamdeck PluginLoader[3939]: [browser][INFO]:  at dir /home/deck/homebrew/plugins/decky-xrealAir
Sep 04 18:46:07 steamdeck PluginLoader[3939]: [browser][DEBUG]: calling frontend unload for XREAL Air Driver
Sep 04 18:46:07 steamdeck PluginLoader[3939]: [browser][DEBUG]: result of unload from UI: {'id': 1, 'result': {'result': {'type': 'undefined'}}}
Sep 04 18:46:07 steamdeck PluginLoader[3939]: [browser][DEBUG]: Plugin XREAL Air Driver was found
Sep 04 18:46:07 steamdeck PluginLoader[3939]: [browser][DEBUG]: Plugin XREAL Air Driver was stopped
Sep 04 18:46:07 steamdeck PluginLoader[3939]: [browser][DEBUG]: Plugin XREAL Air Driver was removed from the dictionary
Sep 04 18:46:07 steamdeck PluginLoader[3939]: [browser][DEBUG]: Removed any settings for plugin XREAL Air Driver
Sep 04 18:46:07 steamdeck PluginLoader[3939]: [browser][DEBUG]: removing files XREAL Air Driver
Sep 04 18:46:18 steamdeck PluginLoader[3939]: [browser][INFO]: Installing XREAL Air Driver from URL (Version: 0.1.2-7ad3e09)
Sep 04 18:46:18 steamdeck PluginLoader[3939]: [browser][DEBUG]: Fetching https://cdn.tzatzikiweeb.moe/file/steam-deck-homebrew/versions/de89cefa68a7ec662fb8a9b785cc86011f017aea8d3664969f0620608adff82c.zip
Sep 04 18:46:18 steamdeck PluginLoader[3939]: [base_events][ERROR]: Unclosed client session
Sep 04 18:46:18 steamdeck PluginLoader[3939]: client_session: <aiohttp.client.ClientSession object at 0x7f45e2417c10>
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [browser][DEBUG]: Got 200. Reading...
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [browser][DEBUG]: Read 47437 bytes
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [browser][DEBUG]: Unzipping...
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file created: /home/deck/homebrew/plugins/decky-xrealAir/main.py
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file modified: /home/deck/homebrew/plugins/decky-xrealAir/main.py
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file created: /home/deck/homebrew/plugins/decky-xrealAir/dist/index.js
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file created: /home/deck/homebrew/plugins/decky-xrealAir/dist/index.js
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file modified: /home/deck/homebrew/plugins/decky-xrealAir/dist/index.js
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file modified: /home/deck/homebrew/plugins/decky-xrealAir/dist/index.js
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file modified: /home/deck/homebrew/plugins/decky-xrealAir/main.py
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file modified: /home/deck/homebrew/plugins/decky-xrealAir/dist/index.js
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file modified: /home/deck/homebrew/plugins/decky-xrealAir/main.py
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file modified: /home/deck/homebrew/plugins/decky-xrealAir/dist/index.js
Sep 04 18:46:20 steamdeck PluginLoader[3939]: [loader][DEBUG]: file modified: /home/deck/homebrew/plugins/decky-xrealAir/main.py
Sep 04 18:51:21 steamdeck PluginLoader[3939]: [browser][DEBUG]: Error Downloading Remote Binary xrealAirLinuxDriver.tar.gz@https://github.com/wheaney/xrealAirLinuxDriver/releases/download/0.3.2/xrealAirLinuxDriver.tar.gz with hash 02193b33ad5024af83706ccda4c7e6e6d5a31f5a3395713a4b867ac8fb9f025a to /home/deck/homebrew/plugins/decky-xrealAir/bin/xrealAirLinuxDriver.tar.gz
Sep 04 18:51:21 steamdeck PluginLoader[3939]: [browser][CRITICAL]: Failed Downloading Remote Binaries
wheaney commented 10 months ago

With the CLI PR I submitted, I think this _download_remote_binaries_for_plugin_with_name code should be removed entirely.