[DEMI-SOLVED] servers fail to bind to port

Okay, well shortly before planning to submit this post I solved the issue. Apparently having set a value to server-ip in server.properties prevented the server from starting on its own. Not very intuitive of a problem source when I can start it manually with that line set to an IP.

Anyways, I am still going to post this because the issue remains that it cannot self-start with that property set. It may not be an issue for me anymore, but it still is an issue to be had.


Whenever the server machine reboots, mineos.service and minecraft.service will start via systemd, but the MineOS UI will display the servers as having -1/max players and the servers cannot be accessed by client. I am, however, able to manually stop/kill them by the MineOS UI and start them successfully.

Now, I saw this post on the old MineOS forums, but I believe that my situation is quite different. For one, all servers are recursively chmoded to 777 and chowned to yuri:root (my user). I am additionally in the wheel group.

Whenever the servers initially start after a reboot, the MineOS console will display such (as seen from my vanilla snapshot server):

[23:22:33] [Server thread/WARN] : Perhaps a server is already running on that port?
[23:22:33] [Server thread/WARN]: The exception was: java.net.BindException: Cannot assign requested address
[23:22:33] [Server thread/WARN]: **** FAILED TO BIND TO PORT!
[23:22:30] [Server thread/INFO]: Starting Minecraft server on 192.168.0.118:25567
[23:22:30] [Server thread/INFO]: Generating keypair
[23:22:30] [Server thread/INFO]: Default game type: SURVIVAL
[23:22:30] [Server thread/INFO]: Loading properties
[23:22:30] [Server thread/INFO]: Starting minecraft server version 1.8

This will show despite even if it is the sole server set to start on reboot, and none of the servers are overlapping in ports (even disabled servers).

Upon killing my Bukkit server (as stopping it when stuck on this -1 players doesn’t seem to have any effect), it will splew out this lovely error:

[23:24:54] [Server thread/ERROR] : This crash report has been saved to: /var/games/minecraft/servers/SuikaCraftRP/./crash-reports/crash-2014-09-05_23.24.54-server.txt
at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:477) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
at net.minecraft.server.v1_7_R3.DedicatedServer.a(DedicatedServer.java:238) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
at net.minecraft.server.v1_7_R3.DedicatedServer.aB(DedicatedServer.java:292) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
java.lang.NullPointerException

As far as I can tell, that’s just from me ungracefully killing the server.

---- Minecraft Crash Report ----
// Oh - I know what I did wrong!

Time: 5/09/14 11:56 PM
Description: Exception in server tick loop

java.lang.NullPointerException: Exception in server tick loop
at net.minecraft.server.v1_7_R3.DedicatedServer.aB(DedicatedServer.java:292)
at net.minecraft.server.v1_7_R3.DedicatedServer.a(DedicatedServer.java:238)
at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:477)
at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628)

A detailed walkthrough of the error, its code path and all known details is as follows:

– System Details –
Details:
Minecraft Version: 1.7.9
Operating System: Linux (amd64) version 3.16.1-1-ARCH
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 8229777040 bytes (7848 MB) / 8520204288 bytes (8125 MB) up to 8520204288 bytes (8125 MB)
JVM Flags: 5 total; -Xmx8192M -Xms8192M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+DisableExplicitGC
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
CraftBukkit Information:
Running:
Failed to handle CraftCrashReport:
java.lang.NullPointerException
at org.bukkit.Bukkit.getName(Bukkit.java:76)
at org.bukkit.craftbukkit.v1_7_R3.CraftCrashReport.call(CraftCrashReport.java:20)
at net.minecraft.server.v1_7_R3.CrashReportSystemDetails.a(SourceFile:74)
at net.minecraft.server.v1_7_R3.CrashReport.h(CrashReport.java:45)
at net.minecraft.server.v1_7_R3.CrashReport.(CrashReport.java:33)
at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:486)
at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628)

    Profiler Position: N/A (disabled)
    Is Modded: ~~ERROR~~ NullPointerException: null
    Type: Dedicated Server (map_server.txt)

The mineos.log looks perfectly clean, asides from rdiff-backups not being able to be made, but that’s a different issue for a different thread.

[06/Sep/2014:00:16:29] ENGINE Bus STARTING
[06/Sep/2014:00:16:29] ENGINE Forking once.
[06/Sep/2014:00:16:29] ENGINE Daemonized to PID: 354
[06/Sep/2014:00:16:29] ENGINE Forking twice.
[06/Sep/2014:00:16:29] ENGINE PID 354 written to ‘/var/run/mineos.pid’.
[06/Sep/2014:00:16:29] ENGINE Started monitor thread ‘Monitor’.
[06/Sep/2014:00:16:29] ENGINE Started monitor thread ‘_TimeoutMonitor’.
[06/Sep/2014:00:16:29] ENGINE Started monitor thread ‘Autoreloader’.
[06/Sep/2014:00:16:29] ENGINE Serving on 0.0.0.0:8080
[06/Sep/2014:00:16:29] ENGINE Bus STARTED

I have to set murmur.service to wait for ntpd.service, otherwise it will refuse clients to connect. Could it be that the Minecraft servers have to wait for something to clear the ports… are they just starting too early? And if so, what would be the best way to go around setting that delay?

More importantly, what is it you’re hoping to accomplish with your server listening on only a local address? Do you have a specific use case why you’d want to bind and listen only to 0.118–which outside users couldn’t connect to?

For future viewers, please note that this behavior is not MineOS-specific, nor is it even Minecraft-specific–it is universal to networking.

See these posts minecraftforum.net, bukkit.org, gaming.stackexchange.com for more details.