gekware / minecraft-server-hibernation

Autostart and stop minecraft-server when players join/leave
GNU General Public License v3.0
379 stars 37 forks source link

Listen tcp 0.0.0.0:25555: bind: address already in use #204

Closed onrecc closed 1 year ago

onrecc commented 1 year ago

Current Behavior (🐛 Bug)

Does not start after building, filling config and running ./msh, just throws an error.

Expected Behavior

It should start up and do its thing

Steps to Reproduce

Built using GO 1.19, then filled out the config file

{
  "Server": {
    "Folder": "/opt/mcsmanager/daemon/data/InstanceData/8a68516513a7499fb1d44a85eecd63be",
    "FileName": "paper1.19.3.jar",
    "Version": "",
    "Protocol": 761
  },
  "Commands": {
    "StartServer": "java -jar paper1.19.3.jar nogui",
    "StartServerParam": "-Xmx1024M -Xms1024M -Dfile.encoding=UTF-8",
    "StopServer": "stop",
    "StopServerAllowKill": 30
  },
  "Msh": {
    "Debug": 3,
    "ID": "781...1da9",
    "ListenPort": 25555,
    "TimeBeforeStoppingEmptyServer": 120,
    "SuspendAllow": false,
    "SuspendRefresh": -1,
    "InfoHibernation": "                   §fserver status:\n                   §b§lHIBERNATING",
    "InfoStarting": "                   §fserver status:\n                    §6§lWARMING UP",
    "NotifyUpdate": true,
    "NotifyMessage": true,
    "Whitelist": [],
    "WhitelistImport": false
  }
}

ran using ./msh

MSH Logs

image

MSH-Version

2.4.10

Operating system

Ubuntu 22.04

System architecture?

I386

Minecraft Version

1.19.3 Purpur, and a Waterfall Bungeecord server (I think 1.19.3)

Minecraft Server Software?

Other (Add to Minecraft Version)

Is there an existing issue for this?

gekigek99 commented 1 year ago

Address already in use means that there is an other program running on the same port.

Usually its an othe rinstance of msh that you forgot to kill.

onrecc commented 1 year ago

Well what port should I use other than the one I use for Waterfall?

gekigek99 commented 1 year ago

Explain better your setup please (addresses connections proxyes ecc...).

Or you can solve it by using a port different from 25555 i guess.

onrecc commented 1 year ago

I have a Waterfall proxy running on port 25555, a hub server running on 25565, then a couple more servers ranging from 25566-25569.

gekigek99 commented 1 year ago

Clients connect to the waterfall proxy on port 25555?

Msh accepts clients on which port?

What is the ms server port?

onrecc commented 1 year ago

Players connect to the proxy on port 25555 and then get sent to the Hub which is on port 25565.

gekigek99 commented 1 year ago

Use netstat -tulpn | grep ':25555' to understand which process is already listening on port 25555 and kill it.

onrecc commented 1 year ago

A java process is listening on port 25555 which I assume is my Waterfall proxy

gekigek99 commented 1 year ago

Ok then change msh port.

I'll close the issue as it's not related to msh but to specific user config.

onrecc commented 1 year ago

What should I change the port into then if not the port that the players use to join??

gekigek99 commented 1 year ago

Change msh port to 24444 and tell players to connect to that port

onrecc commented 1 year ago

Alright well then I only want it to shut down some of my servers not the whole proxy, but I assume that is not possible if it just redirects to the server you have entered in your config.

gekigek99 commented 1 year ago

Idk... I've no experience with waterfall proxy.

There are some users that had the same problem and maybe found a workaround.

You can try and ask on the discord server.