MineOS on Ubuntu Server - Connection forcibly closed by remote host

I have mineos running on a ubuntu server distro on a laptop.
I tried a lot of things over the last 2 days, but couldnt make it work.
I already had it running like 6 months ago.
I updated mineos and now it wont work. I tired reinstalling it, reset everything, but it still wont work. I even redid my ubuntu server from scratch.
When i try to connect myself to the server, i cant and it expells me with:
Connection forcibly closed by remote host

I looked up a lot of things and found out that it had to be something with my ubuntus or mineos firewall (of course i disabled them both (ufw and iptables)), and i couldnt make it work. I tried to host an local server on my pc and i could connect, so its not the router and neither my pc… has to be the laptop with mineos.

I tried everything i could and now im asking here for help - i hope someone can help me out, thanks in advance!


With problems, let’s take a look at the logs first: /var/log/mineos.log.

My guess is you updated nodejs to a version that isn’t supported by the Node code itself.

node -v i think will tell us the version.

Seems to suggest it’s definitely the node version.

When we’re helping troubleshoot, please keep in mind we might likely ask you to show us what commands you ran and what output you get, because saying we did something and seeing what was actually typed is a huge source of miscommunication that often leads to longer fix-times.

thanks for the quick reply.
my node version is : v10.19.0
my mineos.log:

i ran iptable --list and it told me:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
(if i understood it correctly that means that nothing is blocked)

and i did sudo ufw status:
Status: inactive

So there you have it.

Alright, well the most common reason doesn’t seem to be apparently the case. What exactly doesn’t work, because I would’ve guessed you couldn’t get into the webui, but now I’m seeing logs that suggests thats not the issue.

What specifically? Like, you can get in the webui, but you cant start any server? Or you can’t start a specific version of some software?

im sorry, i didnt explained it enought, i can access the webui and can start a mc server, but cant connect and the error message tells me that Connection forcibly closed by remote host.

Check your server.properties. Ensure that the server-ip field and server-port fields exist, and that server-port is filled out correctly. server-ip should be empty.

These fields can also be checked in the server directory, /var/games/minecraft/servers/123/server.properties.

That doesnt work. I tried it already multiple times with the ip, nothing, localhost and with different ports which i all forwarded on my router. Still tells me the same thing.

what doesn’t work?

Because I look at your logs and I see errors like:

{"level":"error","message":"Cannot bind broadcaster to ip","timestamp":"2020-03-31T13:22:38.917Z"}

This suggests to me you have tried filling it in with invalid values, which would have prevented the minecraft server from starting.

Beyond that, I don’t know what the current values are.

{"level":"error","message":"Cannot bind broadcaster to ip undefined","timestamp":"2020-03-31T14:17:47.416Z"}

For example, an empty field for the IP should never be undefined, it would be (empty). If it is undefined, it could be that the file itself is somehow not right. Perhaps it’s owned by root, instead of div. Maybe permissions won’t let the webui read it.

It’s hard to tell, but you need to be more precise than repeatedly saying “that doesn’t work.”

With it doesnt work i meant i cant connect to the server.

i could change the permissions with chmod.
For your first suggestion, i can assure you that the server started. i get the usual logs on the webui, so i dont think the server isnt starting.

i did chmod 777 games in /var with root, ill try that out now.

Edit: I tried it with the new permissions, but it didnt worked.
Edit2: I deleted the mineos.log to see what happens when i reboot and start the server, so far no same error in there:
{“level”:“info”,“message”:"[123] Discovered server",“timestamp”:“2020-03-31T16:30:56.659Z”}
{“level”:“info”,“message”:"[123] Created tail on logs/latest.log",“timestamp”:“2020-03-31T16:30:56.663Z”}
{“level”:“error”,“message”:"[123] Create tail on server.log failed",“timestamp”:“2020-03-31T16:30:56.663Z”}
{“level”:“info”,“message”:"[123] Watching for file generation: server.log",“timestamp”:“2020-03-31T16:30:56.663Z”}
{“level”:“error”,“message”:"[123] Create tail on proxy.log.0 failed",“timestamp”:“2020-03-31T16:30:56.673Z”}
{“level”:“info”,“message”:"[123] Watching for file generation: proxy.log.0",“timestamp”:“2020-03-31T16:30:56.673Z”}
{“level”:“error”,“message”:"[123] Create tail on logs/fml-server-latest.log failed",“timestamp”:“2020-03-31T16:30:56.673Z”}
{“level”:“info”,“message”:"[123] Watching for file generation: logs/fml-server-latest.log",“timestamp”:“2020-03-31T16:30:56.673Z”}
{“level”:“info”,“message”:"[123] Using skipDirEntryPatterns: world,world_the_end,world_nether,dynmap,plugins,web,region,playerdata,stats,data",“timestamp”:“2020-03-31T16:30:56.674Z”}
{“level”:“info”,“message”:“Starting up server, using commit: 9cf8fe1 minecraft protocol displays if no profile is selected on dash\n”,“timestamp”:“2020-03-31T16:30:56.765Z”}
{“level”:“info”,“message”:"[123] eula.txt detected: ACCEPTED (eula=true)",“timestamp”:“2020-03-31T16:30:57.149Z”}
{“level”:“info”,“message”:"[123] autostart = false",“timestamp”:“2020-03-31T16:31:01.700Z”}
{“level”:“error”,“message”:"[123] Aborted server startup; condition not met: true",“timestamp”:“2020-03-31T16:31:01.701Z”}
{“level”:“info”,“message”:"[WEBUI] div connected from",“timestamp”:“2020-03-31T16:32:06.285Z”}
{“level”:“info”,“message”:“Downloaded information for collection: Mojang Official Minecraft Jars (449 entries)”,“timestamp”:“2020-03-31T16:32:06.532Z”}
{“level”:“info”,“message”:“Downloaded information for collection: Feed the Beast Server Packs (566 entries)”,“timestamp”:“2020-03-31T16:32:07.000Z”}
{“level”:“info”,“message”:“Downloaded information for collection: PaperSpigot (5 entries)”,“timestamp”:“2020-03-31T16:32:07.119Z”}
{“level”:“info”,“message”:“Downloaded information for collection: Feed the Beast Third-Party Server Packs (278 entries)”,“timestamp”:“2020-03-31T16:32:07.120Z”}
{“level”:“info”,“message”:“Downloaded information for collection: Spigot (1 entries)”,“timestamp”:“2020-03-31T16:32:07.124Z”}
{“level”:“info”,“message”:“Downloaded information for collection: Imagicalmine (1 entries)”,“timestamp”:“2020-03-31T16:32:07.124Z”}
{“level”:“info”,“message”:"[123] div ( joined server namespace",“timestamp”:“2020-03-31T16:32:07.125Z”}
{“level”:“info”,“message”:“Downloaded information for collection: Mianite (23 entries)”,“timestamp”:“2020-03-31T16:32:07.828Z”}
{“level”:“info”,“message”:“Downloaded information for collection: Forge Mod (42 entries)”,“timestamp”:“2020-03-31T16:32:08.826Z”}
{“level”:“info”,“message”:“Downloaded information for collection: SpongeVanilla (0 entries)”,“timestamp”:“2020-03-31T16:32:08.897Z”}
{“level”:“info”,“message”:“Downloaded information for collection: Nukkit (2 entries)”,“timestamp”:“2020-03-31T16:32:08.898Z”}
{“level”:“info”,“message”:“Downloaded information for collection: Cuberite C++ Server (4 entries)”,“timestamp”:“2020-03-31T16:32:09.005Z”}
{“level”:“info”,“message”:“Downloaded information for collection: BungeeCord (10 entries)”,“timestamp”:“2020-03-31T16:32:09.902Z”}
{“level”:“info”,“message”:"[WEBUI] div connected from",“timestamp”:“2020-03-31T16:32:21.479Z”}
{“level”:“info”,“message”:"[123] div ( joined server namespace",“timestamp”:“2020-03-31T16:32:22.508Z”}
{“level”:“info”,“message”:"[123] transmittting existing file contents: logs/latest.log (627 bytes)",“timestamp”:“2020-03-31T16:32:22.531Z”}
{“level”:“info”,“message”:"[123] issued command : “start”",“timestamp”:“2020-03-31T16:32:30.350Z”}
{“level”:“info”,“message”:"[123] received request “start”",“timestamp”:“2020-03-31T16:32:30.354Z”}

Servers aren’t supposed to be run as root, they’re supposed to be managed entirely by your non-root user, such as div. Files shouldn’t be owned by them either.

Ultimately, if this is a connectivity issue, then:

There are firewall related things here, and netstat to show that each server is actually listening out loud. What is the output to those commands for you?

While i try to connect to the server i ran netstat:
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 mcserver:ssh GEILO-PC.fritz.bo:56204 ESTABLISHED
tcp 0 304 mcserver:ssh GEILO-PC.fritz.bo:56248 ESTABLISHED
tcp 0 0 mcserver:8443 GEILO-PC.fritz.bo:62472 ESTABLISHED
tcp 0 0 mcserver:ssh GEILO-PC.fritz.bo:56216 ESTABLISHED
tcp 0 0 mcserver:ssh GEILO-PC.fritz.bo:56216 ESTABLISHED
tcp6 2 0 localhost:25565 localhost:34454 ESTABLISHED
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ] DGRAM 32261 /run/user/1000/systemd/notify
unix 3 [ ] DGRAM 16477 /run/systemd/notify
unix 9 [ ] DGRAM 16499 /run/systemd/journal/dev-log
unix 9 [ ] DGRAM 16508 /run/systemd/journal/socket
unix 2 [ ] DGRAM 16527 /run/systemd/journal/syslog
unix 3 [ ] STREAM CONNECTED 23004
unix 3 [ ] STREAM CONNECTED 32402
unix 2 [ ] DGRAM 32315
unix 3 [ ] DGRAM 16478
unix 3 [ ] STREAM CONNECTED 32401
unix 3 [ ] STREAM CONNECTED 16686
unix 3 [ ] DGRAM 16479
unix 2 [ ] DGRAM 31472
unix 3 [ ] STREAM CONNECTED 21197 /run/systemd/journal/stdout
unix 2 [ ] STREAM CONNECTED 30173
unix 3 [ ] STREAM CONNECTED 17291 /run/systemd/journal/stdout
unix 2 [ ] DGRAM 15054
unix 2 [ ] DGRAM 24708
unix 3 [ ] STREAM CONNECTED 26074 /var/run/dbus/system_bus_socket
unix 3 [ ] DGRAM 17387
unix 2 [ ] DGRAM 21309
unix 3 [ ] STREAM CONNECTED 24709
unix 3 [ ] STREAM CONNECTED 25064
unix 3 [ ] STREAM CONNECTED 24860
unix 3 [ ] STREAM CONNECTED 25004
unix 3 [ ] STREAM CONNECTED 17289
unix 3 [ ] STREAM CONNECTED 26116 /var/run/dbus/system_bus_socket
unix 2 [ ] DGRAM 32248
unix 3 [ ] STREAM CONNECTED 21287
unix 3 [ ] STREAM CONNECTED 24710
unix 3 [ ] STREAM CONNECTED 25198
unix 2 [ ] DGRAM 17381
unix 3 [ ] STREAM CONNECTED 26283 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 26689 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 24702
unix 3 [ ] STREAM CONNECTED 31224 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 23840 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 24096 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 24713 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 32238
unix 3 [ ] STREAM CONNECTED 23926 /run/systemd/journal/stdout
unix 2 [ ] DGRAM 25020
unix 3 [ ] DGRAM 17388
unix 3 [ ] STREAM CONNECTED 23015 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 23257
unix 2 [ ] DGRAM 32245
unix 3 [ ] STREAM CONNECTED 24095
unix 3 [ ] DGRAM 32262
unix 2 [ ] DGRAM 32143
unix 3 [ ] STREAM CONNECTED 24005
unix 3 [ ] STREAM CONNECTED 30622
unix 3 [ ] STREAM CONNECTED 23499
unix 2 [ ] DGRAM 25921
unix 3 [ ] STREAM CONNECTED 26854 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 25920
unix 3 [ ] STREAM CONNECTED 26058 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 24329
unix 2 [ ] DGRAM 16572
unix 3 [ ] STREAM CONNECTED 24562 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 17437 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 25714
unix 3 [ ] STREAM CONNECTED 24561
unix 3 [ ] STREAM CONNECTED 24006 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 30621
unix 3 [ ] STREAM CONNECTED 23370
unix 2 [ ] DGRAM 16688
unix 3 [ ] DGRAM 32263
unix 3 [ ] DGRAM 22512
unix 3 [ ] STREAM CONNECTED 27666
unix 3 [ ] STREAM CONNECTED 24563 /run/systemd/journal/stdout
unix 3 [ ] DGRAM 17389
unix 3 [ ] STREAM CONNECTED 26242 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 26688
unix 3 [ ] STREAM CONNECTED 23132 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 23171 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 25193

GEILO-PC is my computer,
mcserver ist the laptop running mineos on ubuntu
fritz.box is my router.

Seems fine to me.

iptables–list, on the other side does not show the same as in your post on the megathread;
mine only says:

root@mcserver:/home/div# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

compared to yours:
root@mineos ~# iptables --list
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all – anywhere anywhere
ACCEPT tcp – anywhere anywhere tcp dpt:ssh
ACCEPT tcp – anywhere anywhere tcp dpt:8443
ACCEPT tcp – anywhere anywhere tcp dpt:25565
ACCEPT all – anywhere anywhere state RELATED,ESTABLISHED

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Could be something up with iptables or is it normal?

This says that there’s a server running but is bound to the localhost IP address. This is not the correct IP address, as it means only interfaces local to the server can connect.

What is the value filled in for server-ip because it should not be filled and should definitely not be filled with localhost ( is ideal)

Thanks, i didnt knew that, but i wrote nothing in it. I wrote in it but it still wont work.

Edit: with put in, it wont appear in netstat even when i try it during connecting.
Edit 2: I also forgot to say that i can only see the server throught the lan scanning network section. When i add a server with the ip, its red and when i try to connect it tells me the same thing as when i connect using lan local network thing.

The URL I linked above gave the command netstat -ntlp, can you please execute that?

From your desktop (minecraft client machine) are you able to telnet a.b.c.d 25565?

Right now this seems very much like a connectivity issue rather than a minecraft configuration issue. That said, since the state of your server is prone to change in ways not described here with output, we’ll have to simply tackle it slowly and methodically and hope we find it.

root@mcserver:/home/div# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0* LISTEN 897/systemd-resolve
tcp 0 0* LISTEN 1120/sshd
tcp 0 0* LISTEN 1332/node
tcp6 0 0 :::22 :::* LISTEN 1120/sshd
tcp6 0 0 :::* LISTEN 2027/java


C:\Windows\system32>telnet a.b.c.d 25565
Connecting To a.b.c.d…Could not open connection to the host, on port 25565: Connect failed

I think it just wont let me connect but the port seems to be open…

So it was probably apparent in the initial netstat but it is clear as day right now, but the server is only hosting Minecraft on IPv6. Whereas you can see tcp listed for ssh and the webui, we can only see tcp6 for 25565, which is why it’s not connecting.

What server are you attempting to run? I don’t recall vanilla servers doing this, but it could be something else entirely.

Here’s what we’re probably looking at, for a fix: https://stackoverflow.com/questions/53109946/java-minecraft-server-cannot-run-listen-on-ipv4-at-a-linux-virtual-server-machin


Add that to your java args. Are you using OpenJDK or a different Java distriibution?

-Djava.net.preferIPv4Stack=true didnt do anything sadly. I put it in both the java argument and also changed some settings to try, but no luck.
I ran netstat again, and still no ipv4:
div@mcserver:~$ netstat -ntlp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0* LISTEN -
tcp 0 0* LISTEN -
tcp 0 0* LISTEN -
tcp6 0 0 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -

Here are my java versions:

div@mcserver:~$ java -version
openjdk version “11.0.6” 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)
Ill try to install oracle java.

I installed openjdk 8 because oracle java didnt work/ was to hard to install hehe,
and it works… but now i only have half of the profiles left, no mojang or spigot … wiierd.
ill update the webui