Startup Issue with Minecraft - Server crashes when trying to start it

System Information

Field Value
Operating System Linux - Debian GNU/Linux 12 on x86_64
Product AMP ‘Callisto’ v2.5.1.6 (Mainline)
Virtualization Docker
Application Minecraft
Module MinecraftModule
Running in Container Yes
Current State Failed

Problem Description

Issue

Can’t seem to find anything in logs. unsure.

Reproduction Steps

  • Press Start
  • Let server start up
  • It crashes

Be sure that you’re using the right Java runtime for the version of MC you’re running.

1 Like

Yup, should be the correct one. Just in case i tried with 17, 18 and 21. All failed to start the server

I’m having the same problem, except my issue is clearly a ports problem.
This is running a fresh VM within Proxmox, same OS, Product, also using docker for containerization of instances. Minecraft server crashes as follows:

01:33:22
Starting net.minecraft.server.Main
ServerMain/INFO01:33:27
Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
01:33:28
Loaded 1290 recipes
01:33:29
Loaded 1399 advancements
Server thread/INFO01:33:29
Starting minecraft server version 1.21.1
Loading properties
Default game type: SURVIVAL
Generating keypair
Starting Minecraft server on 192.168.15.248:25565
Using epoll channel type
Server thread/WARN01:33:29
**** FAILED TO BIND TO PORT!
The exception was: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
Perhaps a server is already running on that port?
Server thread/ERROR01:33:29
Encountered an unexpected exception
Console01:33:29
java.lang.IllegalStateException: Failed to initialize server
at net.minecraft.server.MinecraftServer.y(SourceFile:716) ~[server-1.21.1.jar:?]
at net.minecraft.server.MinecraftServer.a(SourceFile:281) ~[server-1.21.1.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Server thread/ERROR01:33:29
This crash report has been saved to: /AMP/Minecraft/crash-reports/crash-2024-08-30_08.33.29-server.txt
Server thread/INFO01:33:29
Stopping server
Saving worlds
Server thread/ERROR01:33:29
Exception stopping the server
Console01:33:29
java.lang.NullPointerException: Cannot invoke "aqu.C_()" because "$$5" is null
at net.minecraft.server.MinecraftServer.a(SourceFile:561) ~[server-1.21.1.jar:?]
at net.minecraft.server.MinecraftServer.v(SourceFile:620) ~[server-1.21.1.jar:?]
at apn.v(SourceFile:561) ~[server-1.21.1.jar:?]
at net.minecraft.server.MinecraftServer.y(SourceFile:735) ~[server-1.21.1.jar:?]
at net.minecraft.server.MinecraftServer.a(SourceFile:281) ~[server-1.21.1.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]

Is there potentially some issue with the docker image not binding ports to host properly? After the instance fails to start, I took a look at docker ps:

CONTAINER ID   IMAGE                     COMMAND                  CREATED          STATUS          PORTS     NAMES
2d9546b57095   cubecoders/ampbase:java   "/ampstart.sh +Core.…"   21 minutes ago   Up 21 minutes             AMP_minecraft0101

as well as ampinstmgr ports minecraft01:

[Info/1] AMP Instance Manager v2.5.1.6 built 16/08/2024 03:11
[Info/1] Stream: Mainline / Release - built by CUBECODERS/buildbot on CCL-DEV
[Info/1] Port usage for minecraft0101 (minecraft01)
[Info/1] Instance is currently running.
[Info/1] LISTENING      25565   TCP     (Core.Webserver.Port)
[Info/1] LISTENING      2456    TCP     (FileManagerPlugin.SFTP.SFTPPortNumber)
[Info/1] LISTENING      25565   Both    (MinecraftModule.Minecraft.PortNumber)

and finally, lsof -i -P:

COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
AMP_Linux 32374  amp    5u  IPv4  54884      0t0  UDP *:12820
AMP_Linux 32374  amp   11u  IPv4  54886      0t0  TCP *:2223 (LISTEN)
AMP_Linux 32374  amp   15u  IPv4  54899      0t0  TCP *:8080 (LISTEN)
AMP_Linux 47449  amp    5u  IPv4  85564      0t0  UDP localhost:57699->localhost:12820
AMP_Linux 47449  amp    7u  IPv4  87588      0t0  TCP garnet-games:2456 (LISTEN)
AMP_Linux 47449  amp   12u  IPv4  90756      0t0  TCP garnet-games:25565 (LISTEN)

(garnet-games is the hostname of the server)
I set “Application Port Ranges” in Configuration > Instance Deployments > Networking as in this screenshot:

Basically just some ports for Minecraft, Terraria, source, Valheim, and some generic ports. I set all the default IP bindings for new instances to my local network interface as shown.

Hopefully this helps figure this out, excited to get started in AMP!

@CubeCoders-Bot can you help this user find out what’s occupying their servers port and deal with it please.

Alright, @Ezlo, it looks like your server isn’t starting because the port it needs (25565) is already in use. This kind of conflict can happen if another server is running on the same port. Here’s a quick check: try using the ampinstmgr ShowAllInstancePorts to confirm which ports are in use by all AMP instances【9:0†ampinstmgr command line reference.txt】.

Once you have the details, you can use ampinstmgr RebindInstance [Instance Name] [New IP Binding] [New Port Number] to change the port of one of your instances if needed【9:0†ampinstmgr command line reference.txt】.

Check those ports and let me know what you find! If you need more help tweaking settings or further investigation, I’m here to help. Just throw the info my way! :blush:


:robot: This post was produced by an AI controlled by CubeCoders Limited - Feedback

After doing some more research, I discovered the issue was that AMP tried to place the individual instance webserver socket on the same port as the gameserver. Not sure why it wouldn’t throw an error for no webserver ports available instead! I simply added 8081:8090 to my list of allowed ports, recreated my instance, and that seems to have resolved it. Hopefully this helps @Nyandere too.

Glad to hear you figured it out, @Ezlo! :tada:

Sometimes it’s the sneaky little details like port and socket overlaps. It’s good to ensure there’s enough distinct ports available for all services. Your solution of adding a range of allowed ports is spot on. Hopefully, this will help others like @Nyandere facing a similar issue.

If any more gremlins show up or if @Nyandere needs a hand, just shout! :rocket:


:robot: This post was produced by an AI controlled by CubeCoders Limited - Feedback

Thank you for the suggestion, however it didn’t seem to solve my issue. I’ve also looked for a crash report but am unable to find it.

No worries, @Nyandere! Let’s tackle this together. Since you’re not finding a crash report and you’re still facing issues, let’s go through a couple of things:

  1. Check Minecraft Server Output: Head over to the “Console” tab in AMP and see if there are any error messages or logs that hint at what’s going wrong.

  2. Port Configuration: Ensure again that your Minecraft server port (usually 25565) isn’t conflicting with any other instance or service. Ezlo’s experience with webserver socket overlap might be worth checking on your end, too. Look at your instances’ assigned ports in AMP using ampinstmgr ShowAllInstancePorts.

  3. Java Version: Ensure your Minecraft server is set to use a Java runtime version compatible with your Minecraft version. This can be done in the Configuration → Java and Memory settings in AMP.

Let me know if any of these shed some light on the problem! :star2:


:robot: This post was produced by an AI controlled by CubeCoders Limited - Feedback

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.