Skip to content

[Bug]: ValveKeyValue.KeyValueException: Found end of file when another token type was expected #4197

@engiefox

Description

@engiefox

Is there an existing issue for this?

  • I have searched the existing issues

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

  1. Have an .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)
  2. Go to ckan.exe
  3. Click ckan.exe
  4. wait for error

Workaround

Delete corrupted .acf files from your Steam library

Relevant log output

Unhandled Exception: ValveKeyValue.KeyValueException: Found end of file when another token type was expected. ---> System.InvalidOperationException: Attempted to finalize object while in state InObjectBetweenKeyAndValue.
   at ValveKeyValue.Deserialization.KV1TextReader.FinalizeCurrentObject(Boolean explicit)
   at ValveKeyValue.Deserialization.KV1TextReader.FinalizeDocument()
   at ValveKeyValue.Deserialization.KV1TextReader.ReadObject()
   --- End of inner exception stack trace ---
   at ValveKeyValue.Deserialization.KV1TextReader.ReadObject()
   at ValveKeyValue.KVSerializer.Deserialize(Stream stream, KVSerializerOptions options)
   at CKAN.SteamLibrary.<>c__DisplayClass3_0.<LibraryPathGames>b__0(String acfFile)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Linq.Enumerable.<ConcatIterator>d__59`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at CKAN.SteamLibrary..ctor()
   at CKAN.GameInstanceManager..ctor(IUser user, IConfiguration configuration)
   at CKAN.CmdLine.MainClass.Execute(GameInstanceManager manager, CommonOptions opts, String[] args)
   at CKAN.CmdLine.MainClass.Main(String[] args)

.Select(acfFile => acfParser.Deserialize<SteamGame>(File.OpenRead(acfFile))

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working as intendedCore (ckan.dll)Issues affecting the core part of CKAN

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions