Closed engiefox closed 1 month ago
Same problem here, is there any fix possible while the bug gets corrected?
Also having this exception. My newly downloaded CKAN is at G:\Games\CKAN_2\ckan.exe
and the path of my Steam install of KSP is G:\Games\Steam Library\steamapps\common\Kerbal Space Program
, in case that's relevant. The path of my ACF file for KSP is G:\Games\Steam Library\steamapps\appmanifest_220200.acf
. Could it be the space in the path?
Hi @engiefox and @TheMainMan23 and @eecano and @kretze and @ZolderonGitHub and @Halbann, thanks for reporting this!
This error indicates a problem parsing one or more of the .acf
files in your C:\Program Files (x86)\Steam\steamapps
folder (or one of your other Steam library folders, if you have multiple) while CKAN is searching Steam for game instances. These files define the properties of your installed games, one per file, in Valve's proprietary KeyValue format (which looks oddly like KSP's .cfg format!), and typically they look like this:
We will probably have to simply ignore parsing errors in this step (presumably with some logging so it's clear which files won't parse), but it would be best to figure out what specifically is going wrong with those files. If you're able to help, please put your .acf
files in a ZIP file and share it here so we can analyze them. (Do NOT ZIP the entire folder, since that will include all of your games, which in addition to being a copyright infringement to share, would also be extremely large! Just the .acf
files, please.)
Or if you're comfortable browsing your .acf
files in a text editor, feel free to do that instead or as well and let us know if you notice anything amiss.
Thanks!
I stepped through the code and found it was just one acf file responsible that was just a few hundred null bytes with no text. I don't own the game it was for anymore. I deleted the file and CKAN worked fine after that.
Side note: the file was last modified in 2018 so it had obviously been there corrupted for some time without Steam cleaning it up.
I have several instances of ksp in my steam. All additional instances are added as a non-steam game.
Original Kerbal Space Program
Back then I created KSP_x64_start.exe files using a BAT-to-EXE converter by setting the SteamAppID before KSP.exe is started. So that the additional instances are registered as KSP in steam. I have no idea whether this still has an impact on the data stored in Steam.
Batch to exe Converter -> KSP_x64_start.exe @echo off set SteamAppId=220200 KSP_x64.exe -single-instance
Manifest File appmanifest_220200.acf.txt
Hi @kretze, thanks for replying. The thing that would help us to investigate this would be a ZIP file containing all of your .acf
files (just one .acf
file tells us nothing because other ones could be corrupted and causing this error).
I'm going to "hide" your comment as off-topic because it introduces a number of topics that do not seem to be related to this issue thus far, and I don't want this discussion to get sidetracked. If you would like to discuss other things, please start a new issue. Thanks!
Problem found
File deleted. CKAN can start without errors
Steam libraries were repeatedly transferred from PC / HDD to newer ones and integrated again. There must have been some old leftovers there.
@kretze, cool! #4200 should address a zero-byte file as well.
For anyone still having this issue, the fix is in the dev build now (Settings→CKAN settings→Use dev builds
to switch to them), and we will probably wait 3–7 days for the next stable release in case any other high priority issues come up.
steamapps_acfs.zip Here is my bundle of acfs. I also have migrated drives, maybe that has something to do with it
I have multiple drives, do you need acfs from all of them?
Hi @engiefox, thanks! The best thing to do first is to test the fix as explained in my comment above: https://github.com/KSP-CKAN/CKAN/issues/4197#issuecomment-2379921085
We can look into these files if you still have issues with that build.
The dev build is accessible here: https://ksp-ckan.s3-us-west-2.amazonaws.com/ckan.exe
since you can’t launch ckan to get to the settings menu :p
No issues with the dev build
I tested with the dev version. 2x 0 byte files created for testing. CKAN starts and skips the faulty files. But the cmd window disappears so quickly that you can't even see which files were affected. Maybe you should create a log for this, then you can check these files and/or fix the issue.
I just had to create a desktop recording so I could take a snipplet of the window.
@kretze, there's a --show-console
command line option that keeps the window open after the GUI is started. If a person really needed to know which of their Steam files were corrupted, I would have them use that. But if alerting the user about such files isn't a priority for Steam, then it isn't one for CKAN either.
Just located the offending file, it was an acf_back file called appmanifest_970960.acf_back and it was just an empty file. I checked the corresponding acf file with the same number and it was for Rebel Cops, don't know if that helps any.
i couldnt find any corrupted files, but the dev build works
FYI, dev build CKAN v1.35.1.24278 - KSP 1.12.5.3190 writes this to the console:
215 [1] WARN CKAN.SteamLibrary (null) - Failed to parse D:\\Steam\SteamApps\appmanifest_253250.acf:
ValveKeyValue.KeyValueException: Found end of file when another token type was expected. ---> System.InvalidOperationException: Attempted to finalize object while in state InObjectBetweenKeyAndValue.
bei ValveKeyValue.Deserialization.KV1TextReader.FinalizeCurrentObject(Boolean explicit)
bei ValveKeyValue.Deserialization.KV1TextReader.FinalizeDocument()
bei ValveKeyValue.Deserialization.KV1TextReader.ReadObject()
--- Ende der internen Ausnahmestapelüberwachung ---
bei ValveKeyValue.Deserialization.KV1TextReader.ReadObject()
bei ValveKeyValue.KVSerializer.Deserialize(Stream stream, KVSerializerOptions options)
bei CKAN.SteamLibrary.<>c__DisplayClass6_0.<LibraryPathGames>b__0(String acfFile)
bei CKAN.Utilities.DefaultIfThrows[T](Func`1 func, Func`2 onThrow)
257 [1] WARN CKAN.SteamLibrary (null) - Failed to parse D:\\Steam\SteamApps\appmanifest_724180.acf:
ValveKeyValue.KeyValueException: Found end of file when another token type was expected. ---> System.InvalidOperationException: Attempted to finalize object while in state InObjectBetweenKeyAndValue.
bei ValveKeyValue.Deserialization.KV1TextReader.FinalizeCurrentObject(Boolean explicit)
bei ValveKeyValue.Deserialization.KV1TextReader.FinalizeDocument()
bei ValveKeyValue.Deserialization.KV1TextReader.ReadObject()
--- Ende der internen Ausnahmestapelüberwachung ---
bei ValveKeyValue.Deserialization.KV1TextReader.ReadObject()
bei ValveKeyValue.KVSerializer.Deserialize(Stream stream, KVSerializerOptions options)
bei CKAN.SteamLibrary.<>c__DisplayClass6_0.<LibraryPathGames>b__0(String acfFile)
bei CKAN.Utilities.DefaultIfThrows[T](Func`1 func, Func`2 onThrow)
WIndows 10. It seems to work though.
@sizilium yup, it's supposed to do that for people with corrupted files so we can tell which files are corrupted and what problems they caused. If you don't like it, you can delete those files (after inspecting them to confirm they're corrupted).
@HebaruSan thx, I can confirm the file is corrupt and will delete it (content is 00...00
)
Is there an existing issue for this?
Operating System
Windows 11
CKAN Version
1.35.0
Games
KSP 1
Game Version
1.12.5
Did you make any manual changes to your game folder (i.e., not via CKAN)?
No
Describe the bug
Launching CKAN after updating to 1.35.0 from 1.34.4 fails to launch, only displaying a command window with the attached log
Steps to reproduce
.acf
file in your Steam library with something weird about it (still investigating, but so far one user has found a file containing nothing but null bytes)Workaround
Delete corrupted
.acf
files from your Steam libraryRelevant log output
https://github.com/KSP-CKAN/CKAN/blob/7568b2eb119ae8d929040add2bb5934d51a6068a/Core/SteamLibrary.cs#L60