TheRemote / MinecraftBedrockServer

Sets up a Minecraft Bedrock dedicated server on Ubuntu with options for automatic updates and running at startup
https://jamesachambers.com/minecraft-bedrock-edition-ubuntu-dedicated-server-guide/
MIT License
801 stars 157 forks source link

Server will not start ubuntu 18.04 #80

Closed stxdigitizing closed 3 years ago

stxdigitizing commented 3 years ago

It worked for a whole year until just recently. When I run ./Start.sh it runs fine shows it starts but then shows it's not running. not sure what's going on.

start-sh-output.txt

cbr-tech commented 3 years ago

I have it working great on the latest version of Ubuntu (Ubuntu 20.04). You can try to copy your worlds to another folder, delete the entire minecraftbe folder, and then use the scripts to re-install it.

murkyl commented 3 years ago

I would start with just trying to run the server without 'screen' or the script. In the directory with the executable, bedrock_server, on the CLI do:

LD_LIBRARY_PATH=`pwd` ./bedrock_server

If that starts then at least the server is running. If it doesn't start then check the file permissions on bedrock_server ls -l

You should see something like this: -rwxr--r-- 1 minecraft minecraft 69196632 Apr 23 10:39 bedrock_server

The important bit is the rwx above. You need the 'x' or execute bit enabled. If it is not enabled you can do: chmod u+x bedrock_server

If the server does run then try copy/pasting just the screen command at the end of the start.sh script to see if it starts up screen. If it doesn't then there is a problem with the screen command.

stxdigitizing commented 3 years ago

@murkyl I really appreciate the help! turned out to be the permissions on the Bedrock_Server. Soon as I changed it and did as you instructed it worked. I shut down the server and reran the start.sh script and it started right up. Thanks for your help!

on my second server didn't have much luck. I get this error when starting the server it self. Crash [INFO] Failed to open curl lib from binary, use libcurl.so instead

so i did some testing. when i run start.sh it actually works however, when you check status of the service it's shows failed but it worked. So i'm assuming something to do the service file. This is what mine looks lik.

[Unit] Description=bedrock minecraft server After=network-online.target

[Service] User=XXXXXX WorkingDirectory=/home/jlopez/minecraftbe/bedrock Type=forking ExecStart=/bin/bash /home/jlopez/minecraftbe/bedrock/start.sh ExecStop=/bin/bash /home/jlopez/minecraftbe/bedrock/stop.sh GuessMainPID=no TimeoutStartSec=600

[Install] WantedBy=multi-user.target

Goodsoldier commented 3 years ago

My server was dead and alive again after restart with "chomod +x bedrock_server"

And it has been twice happening.

Is there will be some update to correct this behaviour?

2021-05-01 오전 7:53에 stxdigitizing 이(가) 쓴 글:

@murkyl https://github.com/murkyl I really appreciate the help! turned out to be the permissions on the Bedrock_Server. Soon as I changed it and did as you instructed it worked. I shut down the server and reran the start.sh script and it started right up. Thanks for your help!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/TheRemote/MinecraftBedrockServer/issues/80#issuecomment-830442943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPUN6SNJMQ3L3EMWOJXQETTLMYG7ANCNFSM43WFFTZA.

murkyl commented 3 years ago

The new script already fixes the permissions. If you do a re-install of the script you should be all set. The permission is a problem because the archive is in the Zip format. This doesn't preserve UNIX permissions and the execute bit doesn't exist for any file.

For the service normally the service status is tracked using a PID (process ID) of the launched program. That allows the system to check if something is alive or note. I'm not sure which system you are running on.

stxdigitizing commented 3 years ago

That did the Trick... Thanks Murkyl!

DevDevDave commented 3 years ago

That libcurl error is also listed in https://bugs.mojang.com/browse/BDS-12751

I'm having the issue and can't find any resolution (and I've downloaded and installed everything fresh yesterday and today)

Edit: the only resolution i found was to follow the https://bugs.mojang.com/browse/BDS-3989 advice and compile a hacky nasty thing, which will need the systemd unit updated

murkyl commented 3 years ago

What are the entries in your server.properties for the server-port and server-portv6? One of the errors the bug mentions is using different ports for the server for IPv4 and IPv6

Also with all the Minecraft servers off run this to look at what is listening on the different ports: sudo netstat -plantu

murkyl commented 3 years ago

I just did a test and if you have your Bedrock server trying to use a port that is already in use, you get this error: Crash [INFO] Failed to open curl lib from binary, use libcurl.so instead

So double check your server.properties and see what port it is configured to use. If it cannot open BOTH the IPv4 and IPv6 ports the server will not start.

DevDevDave commented 3 years ago

so my server.properties has

server-port=19132
# Which IPv4 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]

server-portv6=19133
# Which IPv6 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]

which I had been changing around, but are back to default. There are no double entries and the syntax for the file seems ok - and with that hacky thing the server starts and is what I'd expect.

Netstat - plantu shows that there is indeed a port in use!

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      726/systemd-resolve
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      801/sshd: /usr/sbin
tcp        0    196 192.168.1.53:22         192.168.1.36:61870      ESTABLISHED 14029/sshd: dcu [pr
tcp6       0      0 :::21                   :::*                    LISTEN      771/vsftpd
tcp6       0      0 :::22                   :::*                    LISTEN      801/sshd: /usr/sbin
udp        0      0 127.0.0.53:53           0.0.0.0:*                           726/systemd-resolve
udp        0      0 192.168.1.53:68         0.0.0.0:*                           723/systemd-network
udp        0      0 192.168.1.53:33008      54.36.229.139:19132     ESTABLISHED 755/phantom-linux
udp        0      0 0.0.0.0:51630           0.0.0.0:*                           755/phantom-linux
udp        0      0 0.0.0.0:19132           0.0.0.0:*                           755/phantom-linux
udp6       0      0 fe80::aa1e:84ff:fed:546 :::*                                723/systemd-network

I'd forgotten about phantom for my console players!

Netstat -a just wasn't showing it :(

if I change the both the v4 and v6 ports in server.properties to 19134 and 19135 then the server will start with a normal startup command LD_LIBRARY_PATH=. ./bedrock_server

and I can start using systemctl start and it runs detached!

The netstat -plantu was exactly what I needed - I'm keeping that one for future use (yes, I'm really out of practice with *nix servers)

top thanks!