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

Preferences file could not be read #2244

Closed
dhardy opened this issue May 20, 2021 · 7 comments
Closed

Preferences file could not be read #2244

dhardy opened this issue May 20, 2021 · 7 comments
Labels

Comments

@dhardy
Copy link

dhardy commented May 20, 2021

Describe the bug
On first start (or after deleting client.prefs), the client starts as expected. On subsequent starts (whether or not any settings have been changed in the UI), the game fails to start with the following log message:

2021-05-20 17:40:53.727  WARN 252182 --- [JavaFX-Launcher] c.f.c.preferences.PreferencesService     : Preferences file /home/dhardy/.faforever/client.prefs could not be read

java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.String java.net.HttpCookie.name accessible: module java.base does not "opens java.net" to unnamed module @470e2030
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:177)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:171)
	at com.google.gson.internal.reflect.UnsafeReflectionAccessor.makeAccessible(UnsafeReflectionAccessor.java:44)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:159)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
	at com.google.gson.Gson.getAdapter(Gson.java:458)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53)
	at com.google.gson.Gson.getAdapter(Gson.java:458)
	at com.google.gson.internal.bind.MapTypeAdapterFactory.create(MapTypeAdapterFactory.java:126)
	at com.google.gson.Gson.getAdapter(Gson.java:458)
	at com.google.gson.Gson.fromJson(Gson.java:926)
	at com.google.gson.Gson.fromJson(Gson.java:994)
	at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162)
	at com.faforever.client.preferences.gson.PropertyTypeAdapter.deserialize(PropertyTypeAdapter.java:123)
	at com.faforever.client.preferences.gson.PropertyTypeAdapter.deserialize(PropertyTypeAdapter.java:41)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
	at com.google.gson.Gson.fromJson(Gson.java:927)
	at com.google.gson.Gson.fromJson(Gson.java:865)
	at com.faforever.client.preferences.PreferencesService.readExistingFile(PreferencesService.java:254)
	at com.faforever.client.preferences.PreferencesService.afterPropertiesSet(PreferencesService.java:173)

That doesn't sound like an error in the preferences file to me?

Other than that the client seems to work okay (able to launch games).

To Reproduce
Installed on Fedora Linux as per instructions (except using openjdk 16 from Fedora packages, which I have successfully used in the past).

OS
Fedora Linux 34

@dhardy dhardy added the bug label May 20, 2021
@dhardy
Copy link
Author

dhardy commented May 24, 2021

It turns out the prefs file ended eight lines short (line 125 of 133). Adding } to the end was enough to make the client start.

No idea why this happened (repeatedly), but I might as well close this.

@dhardy dhardy closed this as completed May 24, 2021
@dhardy
Copy link
Author

dhardy commented May 29, 2021

This is not solved. Usually the lua file is syntactically valid but still fails to load, as above.

@dhardy dhardy reopened this May 29, 2021
@Brutus5000
Copy link
Member

We encountered the same if we run the client on Java 16. Are you sure you run on java 15 ?

@Sheikah45
Copy link
Member

Brutus beat me to asking about the java version

@dhardy
Copy link
Author

dhardy commented May 29, 2021

Yes, running on Java 16.

@Sheikah45
Copy link
Member

Yes then you need to run with java 15 as we are not yet compatible with java 16

@dhardy
Copy link
Author

dhardy commented May 29, 2021

Aha, thanks.

@dhardy dhardy closed this as completed May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants