CKAN icon indicating copy to clipboard operation
CKAN copied to clipboard

[Feature] validation of mod files

Open ACH1980 opened this issue 3 years ago • 4 comments

Problem

Is your feature request related to a problem? Please describe. I see often problems (from me or even from others) caused by corrupted mod files.

Suggestions

Describe the solution you'd like I'd suggest to build a validation function (like steams "validate game Files", which obviously doesn't work for mods as steam doesn't know how they should look like) to validate the files of the mods. The only problem would be dynamic mod files. One solution would be to make a file which lists them to ignore in validation (like .gitignore for git; maybe something like .ckanignore to ignore when validating or .validateignore), or another idea would be to list the (maybe) corrupted files and let the user choose if to replace all or which to replace.

Describe alternatives you've considered An alternative that would also bring a acceptable solution would be a "ReInstall"-Button to reinstall installed mods easily and not from cache (because obviously if they're broken by first download they're broken there too). This would make reinstallation much easier, however the user would still need to figure out which mods are broken.

Additional context I think validation should be possible by hashing the files (best idea I think hashing every mod file separately, because so there would be the possibility to find which files caused the validation to fail).

ACH1980 avatar Jun 21 '21 23:06 ACH1980

Can you give us any more details about instances when files have been "corrupted"? Which files exactly? What changed about them, extra content, missing content, changed content, etc.? Is it known what caused the corruption?

HebaruSan avatar Jun 22 '21 01:06 HebaruSan

  1. Several files that let the mod work and shouldn't be modified normally. E.G. Part Configs or Binarys
  2. Sometimes thei're empty, sometimes the contents differ from the original contents.
  3. I don't know. Sometimes it seems to be a problem with the download and sometimes it happens after a few runs of the game.

ACH1980 avatar Jun 22 '21 12:06 ACH1980

I think it's not one specific cause, I think several original-problems could cause this, like a crashed game, an interrupted download or so. But the result is often the same, files don't contain what they shouldn't what causes the game to crash...

ACH1980 avatar Jun 22 '21 12:06 ACH1980

An alternative that would also bring a acceptable solution would be a "ReInstall"-Button to reinstall installed mods easily and not from cache

This can already be done via the main mod list's right click menu:

image

  1. Purge Contents to remove the mod from the cache
  2. Reinstall

HebaruSan avatar Jun 27 '21 00:06 HebaruSan

I've tried to follow this because I have some issues with some of my mods and tried to fix them this way.

Unfortunately is "Reinstall" incapable of reinstalling mods that are depended on by others. In my case I've tried to "fix" ModuleManager as instructed, and now I purged it and can't reinstall it, because it complains about

Already contains module: RealChute
Error during installation!
If the above message indicates a download error, please try again. Otherwise, please open an issue for us to investigate.
If you suspect a metadata problem: https://github.com/KSP-CKAN/NetKAN/issues/new/choose
If you suspect a bug in the client: https://github.com/KSP-CKAN/CKAN/issues/new/choose

Now I have to uninstall almost every single mod just to reinstall them and hope I don't lose configs along the way, which was exactly what I was trying to prevent in the first place : (

BloodyRain2k avatar Jan 06 '23 05:01 BloodyRain2k

@BloodyRain2k, that sounds like #3725, fixed in #3726. You could try the dev build if you're interested in testing:

  • https://ksp-ckan.s3-us-west-2.amazonaws.com/ckan.exe

HebaruSan avatar Jan 06 '23 06:01 HebaruSan

@HebaruSan thanks, that version seems to queue the required actions properly so no errors occur. Tried it with a lib that Stage Recovery depends on and it reinstalled both fine.

BloodyRain2k avatar Jan 06 '23 09:01 BloodyRain2k

@ACH1980, you said you see this corruption often; can you find an example or two and share some links or screenshots? It would really help us to understand how best to handle it. Thanks!

HebaruSan avatar Aug 26 '23 14:08 HebaruSan

ATM I don't have any of these as my PC failed recently and on my laptop I've a pretty fresh setup with also much less mods so I currently doesn't have this issues and as I have not many mods the likelihood of the issue appearing soon is not very big.

Anyway I can give you some thoughts about this: 1.: I don't think the corruptions are caused by CKAN, I think they're either by files gotten overwritten or got hit by some hardware malfunction causing them to be incorrect. 2.: Often those files are 0 bytes in size (which makes no sense for craft files for example) 3.: Even though this issue is not caused by CKAN I guess it would be nice to be able to validate them, for example by hashing them and comparing their hashes to the ones from the repositories, if validation fails I'd suggest asking the user whether to redownload them or not.

That's also why I marked it as a feature request and not as a bug report 🫣

ACH1980 avatar Aug 26 '23 17:08 ACH1980

@ACH1980, thanks. What about reports by other users? If this happens often, have you seen any recent reports of it?

HebaruSan avatar Aug 26 '23 17:08 HebaruSan

No, but I don't read that many KSP-Mod related issues.

ACH1980 avatar Aug 27 '23 00:08 ACH1980

OK, in that case we don't have enough information to work on this. If you do manage to capture observations of this problem or see them reported by anyone else, please do let us know so we can re-open this.

HebaruSan avatar Aug 27 '23 00:08 HebaruSan