mojira.dev
BDS-1264

Unable to launch - Network port occupied, can't start server.

Upon trying to launched bedrock server, it appears that it is ignoring both options within {color:#ff0000}server.properties{color}:

 

server-port=19132
server-portv6=19133

 

The following output is observed:

# LD_LIBRARY_PATH=. ./bedrock_server
NO LOG FILE! - setting up server logging...
[2019-08-08 13:58:15 INFO] Starting Server
[2019-08-08 13:58:15 INFO] Version 1.12.0.28
[2019-08-08 13:58:15 INFO] Session ID e0d9fbf4-a584-4d6e-8df1-03e76330598f
[2019-08-08 13:58:15 INFO] Level Name: Bedrock level
[2019-08-08 13:58:15 INFO] Game mode: 0 Survival
[2019-08-08 13:58:15 INFO] Difficulty: 1 EASY
[2019-08-08 13:58:16 INFO] IPv4 supported, port: 0
[2019-08-08 13:58:16 INFO] IPv6 supported, port: 0
[2019-08-08 13:58:16 ERROR] Network port occupied, can't start server.
Quit correctly

It appears that BDS is trying to bind both IPv6 and IPv4 to port 0.

Also, it is incorrectly identifying IPv6 as being supported, as this is disabled on the host via grub upon launch:

default/grub:10:GRUB_CMDLINE_LINUX="ipv6.disable=1"

This is with a fresh copy of BDS, with default config values present:

server-name=Dedicated Server
gamemode=survival
difficulty=easy
allow-cheats=false
max-players=10
online-mode=true
white-list=false
server-port=19132
server-portv6=19133
view-distance=10
tick-distance=4
player-idle-timeout=30
max-threads=8
level-name=Bedrock level
level-seed=
default-player-permission-level=member
texturepack-required=false
content-log-file-enabled=false

No other processes or services are running on the ports set within the configuration.

Linked issues

Comments 27

After some further digging, it appears that BDS doesn't respect using the kernel boot-time option ipv6.disable=1 and relies entirely on ipv6 being disabled via sysctl:

sysctl net.ipv6.conf.all.disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1

Once ipv6 was disabled via sysctl, BDS would launch successfully:

NO LOG FILE! - setting up server logging...
[2019-08-08 15:04:12 INFO] Starting Server
[2019-08-08 15:04:12 INFO] Version 1.12.0.28
[2019-08-08 15:04:12 INFO] Session ID 41d3e2e9-0e7a-4b0c-bbd4-2554fc0b8b08
[2019-08-08 15:04:12 INFO] Level Name: Bedrock level
[2019-08-08 15:04:12 INFO] Game mode: 0 Survival
[2019-08-08 15:04:12 INFO] Difficulty: 1 EASY
[2019-08-08 15:04:14 INFO] IPv4 supported, port: 19132
[2019-08-08 15:04:14 INFO] IPv6 not supported
[2019-08-08 15:04:14 INFO] IPv4 supported, port: 50531
[2019-08-08 15:04:14 INFO] IPv6 not supported
[2019-08-08 15:04:15 INFO] Server started.

After some further digging, it appears that BDS doesn't respect using the kernel boot-time option ipv6.disable=1 and relies entirely on ipv6 being disabled via sysctl:

sysctl net.ipv6.conf.all.disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1

Once ipv6 was disabled via sysctl, BDS would launch successfully:

NO LOG FILE! - setting up server logging...
[2019-08-08 15:04:12 INFO] Starting Server
[2019-08-08 15:04:12 INFO] Version 1.12.0.28
[2019-08-08 15:04:12 INFO] Session ID 41d3e2e9-0e7a-4b0c-bbd4-2554fc0b8b08
[2019-08-08 15:04:12 INFO] Level Name: Bedrock level
[2019-08-08 15:04:12 INFO] Game mode: 0 Survival
[2019-08-08 15:04:12 INFO] Difficulty: 1 EASY
[2019-08-08 15:04:14 INFO] IPv4 supported, port: 19132
[2019-08-08 15:04:14 INFO] IPv6 not supported
[2019-08-08 15:04:14 INFO] IPv4 supported, port: 50531
[2019-08-08 15:04:14 INFO] IPv6 not supported
[2019-08-08 15:04:15 INFO] Server started.

After some further digging, it appears that BDS doesn't respect using the kernel boot-time option ipv6.disable=1 and relies entirely on ipv6 being disabled via sysctl:

sysctl net.ipv6.conf.all.disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1

Once ipv6 was disabled via sysctl, BDS would launch successfully:

NO LOG FILE! - setting up server logging...
[2019-08-08 15:04:12 INFO] Starting Server
[2019-08-08 15:04:12 INFO] Version 1.12.0.28
[2019-08-08 15:04:12 INFO] Session ID 41d3e2e9-0e7a-4b0c-bbd4-2554fc0b8b08
[2019-08-08 15:04:12 INFO] Level Name: Bedrock level
[2019-08-08 15:04:12 INFO] Game mode: 0 Survival
[2019-08-08 15:04:12 INFO] Difficulty: 1 EASY
[2019-08-08 15:04:14 INFO] IPv4 supported, port: 19132
[2019-08-08 15:04:14 INFO] IPv6 not supported
[2019-08-08 15:04:14 INFO] IPv4 supported, port: 50531
[2019-08-08 15:04:14 INFO] IPv6 not supported
[2019-08-08 15:04:15 INFO] Server started.

For the record, Minecraft exits with this weird error if it's unable to write to data directories. I unpacked the ZIP file accidentaly by root, executed as minecraft user and the error was the exactly same one. Beware!

For the record, Minecraft exits with this weird error if it's unable to write to data directories. I unpacked the ZIP file accidentaly by root, executed as minecraft user and the error was the exactly same one. Beware!

17 more comments

This is still broken on Ubuntu 18 with Bedrock Server v1.16.201.3.

If IPv6 is disabled completely via GRUB, Bedrock Server crashes during startup. There doesn't appear to be a way to tell it to only use IPv4, even when the entire server has already been configured to do so.

/etc/apt/apt.conf.d/99force-ipv4:
Acquire::ForceIPv4 "true";

/etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
net.ipv6.bindv6only=1

/etc/default.grub:
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"

IPv6 causes nothing but problems on every server I've ever encountered, which is why we always disable it completely. If something odd is going on with networking/DNS/etc., disabling IPv6 and rebooting usually does the trick.

This is still broken on Ubuntu 18 with Bedrock Server v1.16.201.3.

If IPv6 is disabled completely via GRUB, Bedrock Server crashes during startup. There doesn't appear to be a way to tell it to only use IPv4, even when the entire server has already been configured to do so.

/etc/apt/apt.conf.d/99force-ipv4:
Acquire::ForceIPv4 "true";

/etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
net.ipv6.bindv6only=1

/etc/default.grub:
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"

IPv6 causes nothing but problems on every server I've ever encountered, which is why we always disable it completely. If something odd is going on with networking/DNS/etc., disabling IPv6 and rebooting usually does the trick.

@Zizzy zizzy
“Failed successfully”. I laughed so hard that I spelt my coffee, luckily not on the keyboard.

I’ve been running a Bedrock server in Docker for about a year and suddenly started having the port ‘0’ issue. (bds v 1.17.1.01)

After reading this I’ve set-up my server.properties

SERVER_PORT_V6: “disable”

Fails perfectly!

 

 

@Zizzy zizzy
“Failed successfully”. I laughed so hard that I spelt my coffee, luckily not on the keyboard.

I’ve been running a Bedrock server in Docker for about a year and suddenly started having the port ‘0’ issue. (bds v 1.17.1.01)

After reading this I’ve set-up my server.properties

SERVER_PORT_V6: “disable”

Fails perfectly!

 

 

@Zizzy zizzy
“Failed successfully”. I laughed so hard that I spelt my coffee, luckily not on the keyboard.

I’ve been running a Bedrock server in Docker for about a year and suddenly started having the port ‘0’ issue. (bds v 1.17.1.01)

After reading this I’ve set-up my server.properties

SERVER_PORT_V6: “disable”

Fails perfectly!

 

 

Paul Bramhall

(Unassigned)

Unconfirmed

awaiting-response

Retrieved