NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.05k stars 14.1k forks source link

starsector #193852

Closed lizelive closed 1 year ago

lizelive commented 2 years ago
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: ./starsector.log (Permission denied)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
    at org.apache.log4j.FileAppender.setFile(FileAppender.java:273)
    at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:156)
    at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:152)
    at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:123)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:645)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:500)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:406)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:432)
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
    at org.apache.log4j.Logger.getLogger(Logger.java:107)
    at com.fs.starfarer.StarfarerLauncher.<clinit>(Unknown Source)
Exception in thread "main" java.lang.ClassFormatError: Illegal field name "public.String" in class com/fs/starfarer/settings/StarfarerSettings
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
    at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
    at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)

https://github.com/NixOS/nixpkgs/blob/nixos-22.05/pkgs/games/starsector/default.nix

on nix os installed using nix-shell -p starsector or as a user package

@bbigras and @ncfavier

lizelive commented 2 years ago

keepalive

Alejandro-Villa commented 2 years ago

I have the same issue, looking at how the starsector.sh and .starsector.sh-wrapped work I suspect that the argument -Dcom.fs.starfarer.settings.paths.logs=. is the main problem because the nix store is read-only and the game tries to write to a log file.

I will try to submit a patch but I leave the probable cause here just in case someone else has the same issue.

nixos-discourse commented 2 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/game-configuring-saves-directory-for-starsector/22799/1