Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] validation of mod files #3399

Closed
ACH1980 opened this issue Jun 21, 2021 · 12 comments
Closed

[Feature] validation of mod files #3399

ACH1980 opened this issue Jun 21, 2021 · 12 comments
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Enhancement GUI Issues affecting the interactive GUI

Comments

@ACH1980
Copy link

ACH1980 commented Jun 21, 2021

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).

@HebaruSan
Copy link
Member

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?

@ACH1980
Copy link
Author

ACH1980 commented Jun 22, 2021

  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
Copy link
Author

ACH1980 commented Jun 22, 2021

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...

@HebaruSan
Copy link
Member

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 HebaruSan added GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN and removed Needs more info We need more info labels Aug 21, 2022
@BloodyRain2k
Copy link

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 : (

@HebaruSan
Copy link
Member

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

@BloodyRain2k
Copy link

@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.

@HebaruSan
Copy link
Member

@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!

@ACH1980
Copy link
Author

ACH1980 commented Aug 26, 2023

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 🫣

@HebaruSan
Copy link
Member

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

@ACH1980
Copy link
Author

ACH1980 commented Aug 27, 2023

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

@HebaruSan
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Enhancement GUI Issues affecting the interactive GUI
Projects
None yet
Development

No branches or pull requests

3 participants