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

JsonSyntaxException MalformedJsonException from AutoConfigManager.load #4642

Closed
keturn opened this issue May 1, 2021 · 3 comments · Fixed by #4660
Closed

JsonSyntaxException MalformedJsonException from AutoConfigManager.load #4642

keturn opened this issue May 1, 2021 · 3 comments · Fixed by #4660
Assignees
Labels
Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Type: Bug Issues reporting and PRs fixing problems
Milestone

Comments

@keturn
Copy link
Member

keturn commented May 1, 2021

What you were trying to do

Start the game.

What actually happened

Before getting to the main menu, the game crashes with

[main] ERROR o.t.engine.core.TerasologyEngine - Failed to initialise Terasology
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 4 path $
        at com.google.gson.Gson.assertFullConsumption(Gson.java:908)
        at com.google.gson.Gson.fromJson(Gson.java:871)
        at org.terasology.engine.persistence.typeHandling.gson.GsonPersistedDataReader.read(GsonPersistedDataReader.java:33)
        at org.terasology.engine.persistence.typeHandling.gson.GsonPersistedDataReader.read(GsonPersistedDataReader.java:16)
        at org.terasology.persistence.serializers.Serializer.deserialize(Serializer.java:84)
        at org.terasology.engine.config.flexible.AutoConfigManager.loadSettingsFromDisk(AutoConfigManager.java:81)

there may be other errors shown adjacent to this as things crash.

There's a config file that contains

{}debugEnabled":true}

which looks like something probably opened an existing file without truncating it and wrote the empty object {}.

Log details and game version

running develop sometime after 4.3.0

@keturn keturn added Type: Bug Issues reporting and PRs fixing problems Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness labels May 1, 2021
@keturn keturn added this to the v4.4.0 milestone May 1, 2021
@keturn
Copy link
Member Author

keturn commented May 1, 2021

this is a thing that should get improved error reporting (which file had the syntax error?) as well as a fix.

@keturn
Copy link
Member Author

keturn commented May 1, 2021

@DarkWeird
Copy link
Contributor

My error.
I did use invalid OpenOptions for config files.
fixed at #4660

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
2 participants