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 server.properties:
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.
Environment
Debian 10 (Buster)
Linux 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
openjdk 11.0.4 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Debian-1deb10u1, mixed mode, sharing)
BDS Version 1.12.0.28
Linked Issues
Comments10
History10
Added labels: awaiting-system-requirements
Added Confirmation Status: Unconfirmed
Resolution: Unresolved → Awaiting Response
Resolution: Awaiting Response → Unresolved
Resolution: Unresolved → Awaiting Response
Added labels: awaiting-response
Removed labels: awaiting-system-requirements
Added is duplicated by link: BDS-9198Bug - Bedrock server uses port 0 instead of the defined onesDuplicate
Resolution: Awaiting Response → Unresolved
Resolution: Unresolved → Incomplete
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:
Once ipv6 was disabled via sysctl, BDS would launch successfully:
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!
Just ran into the same.
When disabling with GRUB, it refused to start the server.
After sysctl, it starts.
But as in the log above, it seems really confused about what port to use.
@Paul Thanks for that!
Even with ipV6 disabled, if you specify just a random ipV6 port that happens to be in use by anything, the server says "IPv6 supported", then "Network port occupied". Same if you leave it undefined, same if you remove it from server.properties completely.
Even more head-scratching: if you set the port to something completely invalid, it starts up fine. I certainly appreciate that this is unsupported and basically a "gift" from Microsoft to have it available at all, but seriously - who writes this stuff?
"Failed successfully!"
Update - the 99999 port hack stopped working randomly.
Now I have to script it so a random, unused lower port is assigned to the server-portv6 line:
That works fine now. Just make sure to remove the kernel ipv6.disable=1 line if it's active, and then reboot. I found out on a different Ubuntu server that with that kernel option enabled, there is no work-around to this frustrating issue.
Does this issue happen on a Ubuntu 18+ install?
If so can someone please provide steps to reproduce:
The original report was for Debian which is not a supported OS for BDS and therefore would not be a valid report unless it can be reproduced on a new Ubuntu install.
This issue occurs on my install of Ubuntu 18.04.4 LTS on GCP.
I am using the service Multicraft to manage my dedicated bedrock alpha server, and with my server.properties file settings:
I get the error:
I have changed the sysctl rule to equal one, and have also tried to give my ipv6 port a wild number and neither methods worked. When I run:
No current processes are listed, and if I run lsof, no processes are using the ports above. I am not sure why it is trying to default them to 0 even though I have them set in system properties.
I also tried Zizzy's last method as well to no avail.
Edit: I fixed this issue, and it was related to using Multicraft to manage the bedrock server. In the bedrock.jar.conf file that is necessary to use the bedrock alpha software with multicraft, you must fill the relevant fields of info in so that Multicraft does not overwrite Minecraft's server.properties file with empty default values.
Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki
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!