NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.31k stars 14.28k forks source link

Neo4j launch failure: Read-only file system #259542

Open MelihDarcanxyz opened 1 year ago

MelihDarcanxyz commented 1 year ago

Describe the bug

A clear and concise description of what the bug is.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install and configure neo4j with this config:
    { config, pkgs, ... }: {
    services.neo4j = {
    enable = true;
    };
    }
  2. Neither works: 2.1 neo4j console --verbose 2.2 systemctl start neo4j 2.3 Try to access web interface

Expected behavior

Neo4j to launch

Current behavior

[user@system:~]$ neo4j console --verbose
Directories in use:
home:         /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j
config:       /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/conf
logs:         /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/logs
plugins:      /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/plugins
import:       /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/import
data:         /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/data
certificates: /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/certificates
licenses:     /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/licenses
run:          /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/run
Starting Neo4j.
Executing command line: /nix/store/k0wfgwiz9m6zzjwxq462brwpjflgrh20-openjdk-11.0.19+7/lib/openjdk/bin/java -cp /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/plugins/*:/nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/conf/*:/nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/lib/* -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow -XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+TrustFinalNonStaticFields -XX:+DisableExplicitGC -XX:MaxInlineLevel=15 -XX:-UseBiasedLocking -Djdk.nio.maxCachedBufferSize=262144 -Dio.netty.tryReflectionSetAccessible=true -Djdk.tls.ephemeralDHKeySize=2048 -Djdk.tls.rejectClientInitiatedRenegotiation=true -XX:FlightRecorderOptions=stackdepth=256 -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -Dlog4j2.disable.jmx=true -Dfile.encoding=UTF-8 org.neo4j.server.CommunityEntryPoint --home-dir=/nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j --config-dir=/nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/conf
org.neo4j.server.startup.BootFailureException: Unexpected error while starting. Aborting. FileSystemException : /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/run/neo4j.pid: Read-only file system
    at org.neo4j.server.startup.ProcessManager.run(ProcessManager.java:209)
    at org.neo4j.server.startup.BootloaderOsAbstraction.console(BootloaderOsAbstraction.java:74)
    at org.neo4j.server.startup.UnixBootloaderOs.console(UnixBootloaderOs.java:57)
    at org.neo4j.server.startup.Bootloader.console(Bootloader.java:151)
    at org.neo4j.server.startup.Neo4jCommand$Console.call(Neo4jCommand.java:56)
    at org.neo4j.server.startup.Neo4jCommand$Console.call(Neo4jCommand.java:47)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
    at picocli.CommandLine.access$1300(CommandLine.java:145)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
    at picocli.CommandLine.execute(CommandLine.java:2078)
    at org.neo4j.server.startup.Neo4jCommand.main(Neo4jCommand.java:166)
Caused by: java.nio.file.FileSystemException: /nix/store/b6dgxh8yjqxwsrw8ichqz625w6xqc60s-neo4j-4.4.11/share/neo4j/run/neo4j.pid: Read-only file system
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
    at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
    at java.base/java.nio.file.Files.newOutputStream(Files.java:220)
    at java.base/java.nio.file.Files.write(Files.java:3425)
    at org.neo4j.server.startup.PidFileHelper.storePid(PidFileHelper.java:56)
    at org.neo4j.server.startup.ProcessManager.storePid(ProcessManager.java:292)
    at org.neo4j.server.startup.ProcessManager.run(ProcessManager.java:172)
    ... 13 more

Notify maintainers

@patternspandemic @jonringer

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.5.5, NixOS, 23.05 (Stoat), 23.05.20230930.32dcb45`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.5`
 - nixpkgs: `/nix/store/anh1m8q5k4b32aic8fnlzlpy07yb0ydh-source`
Artturin commented 1 year ago

The run dir is changed in the module https://github.com/NixOS/nixpkgs/blob/965f3a22ad779fd2b7ceb48d742ba24491fc9bce/nixos/modules/services/databases/neo4j.nix#L56

The config isn't used when running outside the systemd service https://github.com/NixOS/nixpkgs/blob/965f3a22ad779fd2b7ceb48d742ba24491fc9bce/nixos/modules/services/databases/neo4j.nix#L593-L625