No Server Starts Unless on Default Port

I just installed the nodejs version and imported a server; I also created a new server. The imported server was on port 25566 but wouldn’t start; the new server was created on default port 25565 and started without a hitch.

I changed the imported server’s port to 25565 and it started. Curious, I changed the new server’s port to 25566 and it wouldn’t start.

When I say “won’t start”, I mean the webUI “Start” buttons on the Server Status page and in the EULA popup box do nothing. The mineos.log file shows the normal info:

{"level":"info","message":"[SSC] 192.168.2.16 issued command : \"start\"","timestamp":"2016-04-22T04:01:53.428Z"} {"level":"info","message":"[SSC] received request \"start\"","timestamp":"2016-04-22T04:01:53.429Z"}

It simply comes down to the server not starting. And I made sure I opened port 25566 in iptables before doing any of this:

root@server:~# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:25566

Chain FORWARD (policy ACCEPT) target prot opt source destination

`Chain OUTPUT (policy ACCEPT)
target prot opt source destination``

Hi derklempner,

I had a small error like yours once, but I got the “server not binding to port” error because I had two servers pointing to the same port.

Not your issue I know, I just like to chat.

Another time I had used SFTP as root to open a port by modify the iptables. I thought “job done”. Wrong, I had to make the changes in the command prompt. (Because “as root”, I think I did not restart service in SFTP, that might not be what was wrong, but for some reason did not work.)

Another time I had issue was when I opened a port I forgot to “save the change and restart the service”.

I guess pointing out how many ways a guy like me can mess things up, ROTFL.

Good luck,

tNt

An update:

More testing has confirmed a strange behavior. The imported world (SSC) runs fine on port 25565, as does the test world (TEST). Changing SSC to port 25566 and trying to start it does nothing; it’s the same behavior I described in my first post. However, changing TEST to port 25566 and starting the world actually shows the world start, then after a few seconds it stops. Here’s the info after trying to start TEST on port 25566 and then starting SSC on 25565:

{"level":"info","message":"[Test_Server] 192.168.2.16 issued command : \"start\"","timestamp":"2016-04-22T21:57:09.922Z"} {"level":"info","message":"[Test_Server] received request \"start\"","timestamp":"2016-04-22T21:57:09.923Z"} {"level":"info","message":"[SSC] 192.168.2.16 issued command : \"start\"","timestamp":"2016-04-22T21:57:35.431Z"} {"level":"info","message":"[SSC] received request \"start\"","timestamp":"2016-04-22T21:57:35.433Z"}

So basically, it’s trying to start and still says it started, but it’s not really running. This got me thinking about other ports, just to be sure it’s not 25566 that’s a problem, so I used the example port in the iptables wiki page to see if I could get something to run on 25570:

root@server:~# iptables -A INPUT -p tcp -m tcp --dport 25570 -j ACCEPT root@server:~# iptables-save > /etc/iptables-rules root@server:~# iptables-restore < /etc/iptables-rules

Let’s see the iptable rules:

root@caym:~# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:25566 ACCEPT tcp -- anywhere anywhere tcp dpt:25570

Chain FORWARD (policy ACCEPT) target prot opt source destination

Chain OUTPUT (policy ACCEPT) target prot opt source destination

Okay, so now I’ve also changed TEST to port 25570 in the webUI. Just for fun, let’s also change the program version from 1.9.2 to 1.9 and see what happens. I clicked start and… it started! It’s staying up! What the hell?

Okay, so let’s see if it’s 1.9.2 that’s the problem. I stopped the server, changed back to 1.9.2, and clicked start again. It started again, and it kept running. No sudden stop like before. Hrmm, maybe it’s port 25566? Let’s try SSC on 25570 and see what happens, shall we? Changed the port and fired it up. Sure enough, it’s running fine on 25570.

In conclusion, it looks like it’s a problem with port 25566, not any of the other ports. I’m not sure what could be causing this behavior, but I’m hoping Hex can chime in and shed some light on the issue.

One last thing…

I deleted all the worlds except SSC, which is running on 25570. I decided to have a peek at my ports in use, and netstat -l showed me these on consecutive lines:

tcp6 0 0 0.0.0.0:25566 [::]:* LISTEN tcp6 0 0 0.0.0.0:25570 [::]:* LISTEN

Why is port 25566 open if I’m not using anything except port 25570? I have my router port forwarding 25570 to the server on 25570. Is there something in the webUI or the MineOS packages that might be using 25566?

The only explanation is that there is a process hanging that are bound to port 25566. open a shell (ssh) and write :

sudo killall java

This will kill all servers you have running, and should stop the one hanging on port 25566.

And there it is. I just did a server reboot, and no more port 25566 in use. Thanks for the help!

1 Like