Infinidoge / nix-minecraft

An attempt to better support Minecraft-related content for the Nix ecosystem
MIT License
245 stars 26 forks source link

Errors when starting server #79

Closed greysilly7 closed 1 month ago

greysilly7 commented 3 months ago

Please help me I cant figure it out

code

{ pkgs, lib, ... }: let modpack = pkgs.fetchPackwizModpack { url = "https://github.com/Alpaca-Industries/iremia-comeback/raw/1.0.0/pack.toml"; packHash = "sha256-i+W0WA/eH/tNmYzguP2/v/rJb1LUnCV4WmMO9FpjcdI="; }; mcVersion = modpack.manifest.versions.minecraft; fabricVersion = modpack.manifest.versions.fabric; serverVersion = lib.replaceStrings ["."] ["_"] "fabric-${mcVersion}"; in { services.minecraft-servers.servers.iremia = { enable = true; autoStart = true; package = pkgs.fabricServers.${serverVersion}.override {loaderVersion = fabricVersion;};

serverProperties = {
  server-port = 18611;
  /*
  difficulty = 3;
  gamemode = 1;
  max-players = 5;
  motd = "IREMIA!";
  white-list = false;
  */
  enable-rcon = true;
  "rcon.password" = "password";
};

symlinks = {
  "mods" = "${modpack}/mods";
  # "config" = "${modpack}/config";
};

}; }

errors:

Jun 30 15:28:01 greyserver wqnygk7snd6hzyswf2aigwv0pi6yazpn-minecraft-start-iremia[192689]: error connecting to /run/minecraft/iremia.sock (Permission denied) Jun 30 15:28:01 greyserver wqnygk7snd6hzyswf2aigwv0pi6yazpn-minecraft-start-iremia[192690]: error connecting to /run/minecraft/iremia.sock (Permission denied) Jun 30 15:28:01 greyserver systemd[1]: minecraft-server-iremia.service: Control process exited, code=exited, status=1/FAILURE`

× minecraft-server-iremia.service - Minecraft Server iremia Loaded: loaded (/etc/systemd/system/minecraft-server-iremia.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Sun 2024-06-30 15:28:02 EDT; 5min ago Process: 192667 ExecStartPre=/nix/store/zmf8qdrgvavixb95gfdf27957cai4560-unit-script-minecraft-server-iremia-pre-start/bin/minecraft-server-iremia-pre-start (code=exited, status=0/SUCC> Process: 192682 ExecStart=/nix/store/wqnygk7snd6hzyswf2aigwv0pi6yazpn-minecraft-start-iremia (code=exited, status=1/FAILURE) Process: 192692 ExecStopPost=/nix/store/bsw2fzdnqr6ihx1w96arv9f9252nj5qb-unit-script-minecraft-server-iremia-post-stop/bin/minecraft-server-iremia-post-stop (code=exited, status=0/SUCC> IP: 0B in, 0B out CPU: 89ms

Jun 30 15:28:02 greyserver systemd[1]: minecraft-server-iremia.service: Scheduled restart job, restart counter is at 5. Jun 30 15:28:02 greyserver systemd[1]: minecraft-server-iremia.service: Start request repeated too quickly. Jun 30 15:28:02 greyserver systemd[1]: minecraft-server-iremia.service: Failed with result 'exit-code'. Jun 30 15:28:02 greyserver systemd[1]: Failed to start Minecraft Server iremia.`

bluelinden commented 3 months ago

i fixed this same issue on my end by stopping minecraft-server-[NAME].service with [sudo] systemctl stop [servicename], deleting /run/minecraft/[NAME].sock and starting minecraft-server-[NAME].service again.

edit: never mind, that's caused a different issue where it claims there's no server running in the /run/minecraft tmux socket.

Infinidoge commented 3 months ago

Strange. What are the permissions on /run/minecraft?

greysilly7 commented 3 months ago

It was just the server crashing, trying to figure out how to change the java version now, I keep getting "Caused by: java.lang.IllegalArgumentException: The requested compatibility level JAVA_21 could not be set. Level is not supported by the active JRE or ASM version (Java 21.0, ASM 9.2 (ASM10_EXPERIMENTAL)) "

mechan1sm commented 2 months ago

I get the same error related to "JAVA_21 compability level could not be set" when using Fabric 1.21 with following mods:

UPD: Changed jre_headless from jdk21_headless to jdk22_headless, didn't help...