arkmanager / ark-server-tools

Set of server tools used to manage ARK: Survival Evolved servers on Linux
MIT License
684 stars 144 forks source link

Connection Timeout #1119

Closed anthonee619 closed 4 years ago

anthonee619 commented 4 years ago

I am running my server on a Ubuntu 18.04 machine with the following docker image boerngenschmidt/ark-docker.

The image was built with arkmanager v1.6, however, I upgrade to the most current version with host-machine $ docker exec -it ark bash and then docker-container $ arkmanager upgrade-tools within the docker container itself.

Everything was running smoothly until a couple of days ago, in which I am no longer able to connect to the server. When attempting to connect to the server in Ark's server browser I am getting a Connection Timeout error message. I don't have any mods installed on my server, so that should not cause any problems.

The ports I have open are the default ports recommended by the docker image. (Ark server ports 7778 and 27015 udp/tcp, and RCON port 32330 tcp) Also, the firewall on the machine is disables since this server is behind a firewall on my network.

docker-container $ arkmanager status output is:

Running command 'status' for instance 'main'
 Server running:   Yes
 Server PID:   203
 Server listening:   Yes
Server Name: xxxxxxxxxxxx - (v311.302)
Players: 0 / 25
Active Players: 0
 Server online:   No
 Server build ID:   5192336

Note: Server online eventually switches to yes and has the URLs it is supposed to provide.

My initial step was to make sure that my host machine is listening to all the ports. And I used the following command to check this.

host-machine $ sudo lsof -i | grep docker output is:

docker-pr 124447            root    4u  IPv6 917951      0t0  TCP *:32330 (LISTEN)
docker-pr 124460            root    4u  IPv6 918948      0t0  TCP *:27015 (LISTEN)
docker-pr 124473            root    4u  IPv6 918989      0t0  UDP *:27015
docker-pr 124487            root    4u  IPv6 919013      0t0  TCP *:7778 (LISTEN)
docker-pr 124502            root    4u  IPv6 919044      0t0  UDP *:7778

From this output I believe that the host machine is listening to the ports correctly. And according to this; it being IPv6 is not the issue because linux will open both IPv6 and IPv4 ports.

I then wanted to make sure that the docker container is listening to the correct ports, and used this resource and ran:

host-machine $ docker inspect -f '{{.State.Pid}}' container_name_or_id5

to get the PID for the container and use the resulting PID in the following command: Note: I switched netstat -na from the resource I provided to lsof -i in order to keep outputs of the host machine and docker similar.

host-machine $ sudo nsenter -t PID -n lsof -i

which output is:

COMMAND      PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
dockerd      915    root   51u  IPv4 918384      0t0  UDP 127.0.0.11:40317
dockerd      915    root   53u  IPv4 918385      0t0  TCP 127.0.0.11:41581 (LISTEN)
ShooterGa 124887 anthony   10u  IPv4 920059      0t0  UDP *:27015
ShooterGa 124887 anthony   19u  IPv4 921333      0t0  UDP *:7777
ShooterGa 124887 anthony   20u  IPv4 920547      0t0  TCP *:32330 (LISTEN)
ShooterGa 124887 anthony   23u  IPv4 922540      0t0  UDP *:7778

As you can see only port 32330 is being listened to inside the docker container, which leads me to believe that the Ark server script is not binding to ports 7778 and 27015.

Any help is appreciated as even running a new docker container does not seem to fix the issues.

klightspeed commented 4 years ago

You need to add 7777 to the ports being forwarded by docker. Also, the game server binds to the UDP ports (there is no such thing as listen for UDP).

anthonee619 commented 4 years ago

Thank you. This seems to have fixed the issue!

Did ark change the default port bindings recently?

klightspeed commented 4 years ago

Yes, in update 311.x, the ARK server went from only binding to Port + 1 to binding to both Port and Port + 1, with clients now using Port instead of Port + 1.

anthonee619 commented 4 years ago

Gotcha, so I still need to have port 7778 open as well.

Fireant456 commented 4 years ago

I seem to be running into this issue as well but I am forwarding ports 7777, 7778 and 27015 on TCP and UDP

Fireant456 commented 4 years ago

It seems the docker container sets the game port one lower than what you configure it to in the env vars. šŸ¤¦ Fixed it by changing my env from 7777 to 7778

klightspeed commented 4 years ago

If the docker container is using an up-to-date armanager, you should be able to add arkNoPortDecrement="true" to your arkmanager config.

From the README:

Setting Description
arkNoPortDecrement="" True if theĀ PortĀ option should be passed untouched. False for the old behaviour of decrementing theĀ Port.