msmhq / msm

An init script for managing Minecraft servers
http://msmhq.com
GNU General Public License v3.0
1.22k stars 225 forks source link

Minecraft server unable to start #390

Open acokeaday opened 4 years ago

acokeaday commented 4 years ago

Installed a new virtual machine, ubuntu 18.04

installed using script on install page and Java default-jre

but i'm not able to run the server, no error is shown.

minecraft@sg-dev3:~/servers/mcsvr$ cat server.properties
msm-version=minecraft/1.7.0
minecraft@sg-dev3:~/servers/mcsvr$ msm mcsvr start

Maintaining world symbolic links... Done.
Synchronising flagged worlds on disk to RAM... Done.
Starting server... Done.
minecraft@sg-dev3:~/servers/mcsvr$ msm mcsvr status
Server "mcsvr" is stopped.
minecraft@sg-dev3:~/servers/mcsvr$

Any one able to assist with this? saw a previous post with regards to memory allocation (RAM) already im sure there is enough RAM

mikehebert commented 4 years ago

Check your log file. It looks like yours should be here: less ~/servers/mcsvr/logs/latest.log

jensfriisnielsen commented 4 years ago

I had this issue with openjdk-11 (ubuntu 18.04 default). It turned out to be deprecated java invocation arguments from https://github.com/msmhq/msm/blob/master/msm.conf#L165

I got it working again by changing invocation from

java -Xms{RAM}M -Xmx{RAM}M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -jar {JAR} nogui"

to

java -Xms{RAM}M -Xmx{RAM}M -jar {JAR} nogui"

in default /etc/msm.conf

horneraa commented 4 years ago

The fix described by @jensfriisnielsen was the solution for me as well. What tipped it off for me was is that logs were not being created in {server}/logs for any server I tried to start.

jeffrade commented 4 years ago

What tipped it off for me was is that logs were not being created in {server}/logs for any server I tried to start.

Same here.

Darkentik commented 4 years ago

Could the msm.conf please be update to actual java supported params? Struggled into this too. Not everybody is experienced enough to find this out.

Everytime we make a msm update the msm.conf could be overwritten.

tomscallon commented 3 years ago

Hey all, having this exact same issue.

$ msm Bean start
world-1-17-1
Maintaining world symbolic links... Done.
Synchronising flagged worlds on disk to RAM... Done.
Starting server...Ran as_userRan server_log_dots_for_lines Done.
$ msm Bean status
Server "Bean" is stopped.

Ignore the Ran as_user and Ran server_log_dots_for_lines, I added those while debugging.

Similarly I also get no logs:

$ pwd
/mnt/minecraft/msm/servers/Bean
$ ls
active       banned-players.json  server.jar     whitelist.json  worldstorage
banned-ips.json  ops.json         server.properties  world-1-17-1

My Java invocation line matches the recommended one shown above:

$ vi +165 /etc/msm.conf
# ...
DEFAULT_INVOCATION="java -Xms{RAM}M -Xmx{RAM}M -jar {JAR} nogui"
# ...

Is it likely this is also a Java issue? If so, how can I go about determining the issue?

tomscallon commented 3 years ago

Update! tl;dr Needed to use a newer version of Java.

More details: I modified the main msm script to print out the invocation it was using, then ran that manually. I got this:

$ java -Xms1024M -Xmx1024M -jar /mnt/minecraft/msm/servers/Bean/server.jar nogui
Error: LinkageError occurred while loading main class net.minecraft.server.Main
    java.lang.UnsupportedClassVersionError: net/minecraft/server/Main has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 55.0

Searching the error on the webs, I found this Reddit post. Running the following upgraded my JDK and fixed it for me:

$ sudo apt install openjdk-17-jdk

I'm sure I should have known about the increased Java version requirement (bad system admin), but glad it's all working now!

B-AiT commented 2 years ago

I am able to launch via command line:

/opt/jdk-17/bin/java -Xms2048M -Xmx2048M -jar server.jar nogui

that will drop a log file into the server /log directory.

If I launch with msm start I see the messages:

Maintaining world symbolic links... Done. Synchronising flagged worlds on disk to RAM... Done. Starting server... Done.

but a msm server list will show it as stopped and there is no log.

This only happens with the minecraft 1.19.2 server. I have 3 others that are on 1.17.1 and they load just fine.

I changed the /etc/msm.conf to support the OpenJDK 17 needed for MC 1.19.2 DEFAULT_INVOCATION="/opt/jdk-17/bin/java -Xms{RAM}M -Xmx{RAM}M -jar {JAR} nogui"

I run my worlds from ram and thought that might be causing my issue but I turned that to false. What other option in MSM could be causing it to not launch and not log anything?

*- turns out yes, I am missing "_chmod -R minecraft:minecraft _"on the new world folders. For whatever reason they were not owned by the minecraft account. Once I fixed that then MSM started the server.**