Lauriethefish/QuestPatcher

Auto-delete mod if no `mod.json` file found

Closed this issue · 3 comments

I'm suffering from these errors.

QuestPatcher.Core.AdbException: remote object '/sdcard/QuestPatcher/com.beatgames.beatsaber/installedMods/OculusDB_CoreMods_1.28.0_4124311467/ mod-list/ questui/mod.json' does not exist

at QuestPatcher.Core.AndroidDebugBridge.RunCommand(String command, Int32[] allowedExitCodes) in D:\a\QuestPatcher\QuestPatcher\QuestPatcher.Core\AndroidDebugBridge.cs:line 150
at QuestPatcher.Core.AndroidDebugBridge.DownloadFile(String name, String destination) in D:\a\QuestPatcher\QuestPatcher\QuestPatcher.Core\AndroidDebugBridge.cs:line 188
at QuestPatcher.Core.Modding.QModProvider.LoadLegacyMods() in D:\a\QuestPatcher\QuestPatcher\QuestPatcher.Core\Modding\QModProvider.cs:line 300
at QuestPatcher.Core.Modding.ModManager.LoadModsForCurrentApp() in D:\a\QuestPatcher\QuestPatcher\QuestPatcher.Core\Modding\ModManager.cs:line 177
at QuestPatcher.Core.QuestPatcherService.RunStartup() in D:\a\QuestPatcher\QuestPatcher\QuestPatcher.Core\QuestPatcherService.cs:line 136
at QuestPatcher.Services.QuestPatcherUiService.LoadAndHandleErrors() in D:\a\QuestPatcher\QuestPatcher\QuestPatcher\Services\QuestPatcherUiService.cs:line 94

Guess having kinda same issue but my error looks a bit different:

QuestPatcher.Core.AdbException: Code 1: adb: error: failed to stat remote object '/sdcard/QuestPatcher/com.beatgames.beatsaber/installedMods/bsml/mod.json': No such file or directory
at QuestPatcher.Core.AndroidDebugBridge.RunCommand(String command, Int32[] allowedExitCodes) in /Users/runner/work/QuestPatcher/QuestPatcher/QuestPatcher.Core/AndroidDebugBridge.cs:line 433
at QuestPatcher.Core.AndroidDebugBridge.DownloadFile(String name, String destination) in /Users/runner/work/QuestPatcher/QuestPatcher/QuestPatcher.Core/AndroidDebugBridge.cs:line 471
at QuestPatcher.Core.Modding.QModProvider.LoadLegacyMods() in /Users/runner/work/QuestPatcher/QuestPatcher/QuestPatcher.Core/Modding/QModProvider.cs:line 171
at QuestPatcher.Core.Modding.ModManager.LoadModsForCurrentApp() in /Users/runner/work/QuestPatcher/QuestPatcher/QuestPatcher.Core/Modding/ModManager.cs:line 242
at QuestPatcher.Core.QuestPatcherService.RunStartup() in /Users/runner/work/QuestPatcher/QuestPatcher/QuestPatcher.Core/QuestPatcherService.cs:line 137
at QuestPatcher.Services.QuestPatcherUiService.LoadAndHandleErrors() in /Users/runner/work/QuestPatcher/QuestPatcher/QuestPatcher/Services/QuestPatcherUiService.cs:line 96

Cannot find solution on the internet

UPD: alright, here is solution: #110 (comment)

I've just removed /sdcard/QuestPatcher directory via SideQuest and relaunched QP and it worked

Yeah this suggests you've got a corrupted mod in the /sdcard/QuestPatcher directory.

I'll change this issue to be for better error handling in this situation.

The aim would be to detect any mods that are missing a mod.json, treat them as corrupted and delete the folder.
This would also apply for any mods who's mod.jsons don't match the qmod schema.