Calinou / scoop-games

Scoop bucket for open source/freeware games and game-related tools
Creative Commons Zero v1.0 Universal
293 stars 152 forks source link

[Bug]: Empty `metacache` file created by manifest crashes Prism Launcher at launch #1007

Closed qyurila closed 1 year ago

qyurila commented 1 year ago

Prerequisites

Package Name

prismlauncher / prismlauncher-qt5

Expected/Current Behaviour

I'm experiencing a crash every time I try to open the launcher. My friend had the same problem a few days ago.

Here are the last few lines of the log:

     0.037 D | Instance path              :  "instances"
     0.038 D | Loading Instances...
     0.038 D | Discovering instances in "C:/Users/Hyeon/scoop/apps/prismlauncher/current/instances"
     0.038 D | <> Instances loaded.
     0.038 D | Loading accounts...
     0.038 C | "Failed to parse account list file: illegal value at offset 0"
     0.038 D | <> Accounts loaded.
     0.038 C | Exception: "HttpMetaCache root is not an object"

According to https://github.com/PrismLauncher/PrismLauncher/issues/1094, Prism Launcher crashes raising "HttpMetaCache root is not an object" exception if there is a corrupt metacache file in its directory at launch. Currently, the manifest creates an empty metacache during pre_install and persists it. This seemed to be a problem.

First I deleted the file once and the launcher worked fine. And instead of deleting it, I modified the content of the metacache to {}, and that worked too.

Steps to Reproduce

> scoop install games/prismlauncher
Installing 'prismlauncher' (7.1) [64bit] from games bucket
Loading PrismLauncher-Windows-MSVC-Portable-7.1.zip from cache.
Checking hash of PrismLauncher-Windows-MSVC-Portable-7.1.zip ... ok.
Extracting PrismLauncher-Windows-MSVC-Portable-7.1.zip ... done.
Running pre_install script...
Linking ~\scoop\apps\prismlauncher\current => ~\scoop\apps\prismlauncher\7.1
Creating shim for 'prismlauncher'.
Creating shortcut for Prism Launcher (prismlauncher.exe)
...
Persisting metacache
...
Running post_install script...
'prismlauncher' (7.1) was installed successfully!

Possible Solution

Make pre_install write some valid content to metacache file. The minimal valid content I found is:

{}

Scoop and Buckets Version

> scoop --version
Current Scoop version:
v0.3.1 - Released at 2022-11-15

'games' bucket:
24e648a0 (HEAD -> master, origin/master, origin/HEAD) pcsx2-dev: Update to version 1.7.4734

Scoop Config

> scoop config

last_update           : 2023-07-16 오전 12:11:55
alias                 : @{gui=scoop-gui; force-update=scoop-force-update}
aria2-warning-enabled : False
scoop_repo            : https://github.com/ScoopInstaller/Scoop
scoop_branch          : master

PowerShell Version

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Additional Softwares

No response

mbalc commented 1 year ago

still an issue, awaiting pull request review/merge

pasting my logs (note that earlier on, there's also some notions that there's a missing translation file; I'm not sure if this is being addressed):

here's a full log that I am getting ```bash, PS C:\Users\micha> prismlauncher.exe prismlauncher.exe : The term 'prismlauncher.exe' is not recognized as the name of a cmdlet, function, script file, or o perable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try aga in. At line:1 char:1 + prismlauncher.exe + ~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (prismlauncher.exe:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\micha> scoop uninstall prismlauncher ERROR 'prismlauncher' isn't installed. PS C:\Users\micha> scoop install prismlauncher Installing 'prismlauncher' (7.2) [64bit] from games bucket Loading PrismLauncher-Windows-MSVC-Portable-7.2.zip from cache Checking hash of PrismLauncher-Windows-MSVC-Portable-7.2.zip ... ok. Extracting PrismLauncher-Windows-MSVC-Portable-7.2.zip ... done. Running pre_install script... Linking ~\scoop\apps\prismlauncher\current => ~\scoop\apps\prismlauncher\7.2 Creating shim for 'prismlauncher'. Creating shortcut for Prism Launcher (prismlauncher.exe) Persisting assets Persisting cache Persisting icons Persisting instances Persisting libraries Persisting logs Persisting meta Persisting mods Persisting themes Persisting translations Persisting accounts.json Persisting metacache Persisting prismlauncher.cfg Running post_install script... 'prismlauncher' (7.2) was installed successfully! Notes ----- To add Prism Launcher file association options for .ZIPs and .MRPACKS, run this: "C:\Users\micha\scoop\apps\prismlauncher\current\install-associations.reg" This package is now using the portable version of Prism Launcher, and data should have been migrated automatically. If you are using a global install on a system with more than one user, you will need to copy a user's data from %appdata% to the new Scoop PrismLauncher persist directory PS C:\Users\micha> prismlauncher.exe 0.000 D | Testing "C:/Users/micha/scoop/apps/prismlauncher/current/qtlogging.ini" ... 0.000 D | Loading logging rules from: "C:/Users/micha/scoop/apps/prismlauncher/current/qtlogging.ini" 0.000 D | Setting log rules: 0.000 D | "*.debug=true" 0.000 D | "launcher.auth.credentials.debug=false" 0.000 D | "launcher.task=false" 0.000 D | "launcher.task.net=true" 0.000 D | "launcher.task.net.download.debug=false" 0.000 D | "launcher.task.net.metacache=false" 0.000 D | "launcher.task.net.metacache.http=true" 0.003 D | "launcher.task.net.upload=true" 0.003 D | "qt.*.debug=false" 0.003 D | <> Log initialized. 0.003 D | <> No migration needed from "PolyMC" 0.003 D | <> No migration needed from "MultiMC" 0.003 D | "Prism Launcher" , (c) 2013-2021 "Prism Launcher Contributors\n� 2021-2022 PolyMC Contributors \n� 2012-2021 MultiMC Contributors" 0.003 D | Version : "7.2" 0.003 D | Platform : "official" 0.004 D | Git commit : "" 0.004 D | Git refspec : "refs/heads/stable" 0.004 D | Work dir before adjustment : "C:/Users/micha" 0.004 D | Work dir after adjustment : "C:/Users/micha/scoop/apps/prismlauncher/current" 0.004 D | Adjusted by : "Portable data path" 0.004 D | Binary path : "C:/Users/micha/scoop/apps/prismlauncher/current" 0.004 D | Application root path : "C:/Users/micha/scoop/apps/prismlauncher/current" 0.004 D | <> Paths set. 0.007 D | Detected default console font: "Courier New" , substitutions: "" 0.014 D | <> Settings loaded. 0.014 D | Detecting proxy settings... 0.014 D | Using no proxy is an option! 0.014 D | <> Network done. 0.015 C | Exception: "Unable to open C:/Users/micha/scoop/apps/prismlauncher/current/translations/index_v2.json for reading: The system cannot find the file specified." 0.015 C | Translations Download Failed: index file not readable 0.016 W | Selected invalid language "" , defaulting to "en_US" 0.016 D | Your language is "" 0.016 D | <> Translations loaded. 0.017 D | Started watching "C:/Users/micha/scoop/apps/prismlauncher/current/icons" 0.017 D | Sorting icon list... 0.017 D | <> Instance icons intialized. 0.018 D | [Theme] <> Icon themes initialized. 0.018 D | [Theme] <> Initializing Widget Themes 0.018 D | [Theme] Determining System Theme... 0.018 D | [Theme] System theme seems to be: "windowsvista" 0.018 D | [Theme] Considering theme from theme factory: "windowsvista" 0.018 D | [Theme] System theme has been determined to be: "windowsvista" 0.018 D | [Theme] Loading Built-in Theme: "system" 0.018 D | [Theme] Loading Built-in Theme: "dark" 0.018 D | [Theme] Loading Built-in Theme: "bright" 0.019 D | [Theme] Theme Folder Path: "C:/Users/micha/scoop/apps/prismlauncher/current/themes" 0.019 D | [Theme] <> Widget themes initialized. 0.019 D | Instance path : "instances" 0.019 D | Loading Instances... 0.020 D | Discovering instances in "C:/Users/micha/scoop/apps/prismlauncher/current/instances" 0.020 D | <> Instances loaded. 0.020 D | Loading accounts... 0.020 C | "Failed to parse account list file: illegal value at offset 0" 0.020 D | <> Accounts loaded. 0.020 C | Exception: "HttpMetaCache root is not an object" ```