lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.94k stars 272 forks source link

Game server doesn't stay connected #141

Closed DailytheNoob closed 3 years ago

DailytheNoob commented 3 years ago

I am able to connect to the server on the local network, but outside connections aren't staying connected.

Here's my NAT: image

I have this running on a CentOS 7 VM on a Ubuntu 20.04 host. Here's my docker-compose.yaml that's based on the run command because the version indicated on the file in this repo doesn't exist yet.

version: '3.3'
services:
    valheim-server:
        container_name: valheim-server
        ports:
            - '2455-2458:2455-2458/udp'
        volumes:
            - '/valheim/config:/config'
            - '/valheim/data:/opt/valheim'
        environment:
            - SERVER_NAME=Daily Server
            - WORLD_NAME=World name
            - SERVER_PASS=secret
            - BACKUPS=true
            - BACKUPS_CRON=*3***
            - BACKUPS_MAX_AGE=3
            - SERVER_PUBLIC=true
        image: lloesche/valheim-server
        restart: unless-stopped

Here's the error: image

The timezone in the docker container is also UTC, could that be the issue?

InB4DevOps commented 3 years ago

Maybe also add 2455 to the compose yml...

DailytheNoob commented 3 years ago

Sadly that didn't change anything

lloesche commented 3 years ago

@DailytheNoob Valheim doesn't use TCP; UDP only. What's your UDP conntrack timeouts look like? I.e. net.netfilter.nf_conntrack_udp_timeout and net.netfilter.nf_conntrack_udp_timeout_stream. I'd try setting to something like 20 minutes (1200) and see if it changes anything. My thinking is, since it is working internally but not externally I would assume the issue is likely with whatever gateway device is in between.

Also out of curiosity, why running in a CentOS VM on an Ubuntu host? Like why not just run the container on the Ubuntu host directly? 🤔

DailytheNoob commented 3 years ago

Sadly I am still getting the same error messages after restarting the container and docker. https://asciinema.org/a/396181

Why the VM on the Ubuntu Host? Cause I have a few other OSes running in there, like VyOS, and I don't want to inevitably bork the connection I'm using to control the OS, so I've got the second interface bridged and that's what all the VMs can use. Its a bit complicated, I know. Moving up in the world.

lloesche commented 3 years ago

Oh, this is your outgoing connection, from the game server to Steam we're talking about? I thought the incoming connection from your game client was getting disconnected.

In that case I don't really know what the issue could be. The guys in #140 seem to have found a workaround by starting the container with host networking. But there I'm now unclear on whether that fixed incoming or outgoing connections (or potentially both).

DailytheNoob commented 3 years ago

Tried it with the network_mode: host set and still the same issue, looks like that's not the issue, as discovered with #140.

lloesche commented 3 years ago

@DailytheNoob that's unfortunate. I don't think there's anything we can do inside the container image. As soon as the devs release a bugfix the container will download and apply it. We can leave this issue open to track status/progress but I don't see anything that can be done from our side.

DailytheNoob commented 3 years ago

closing issue since there's nothing that can be fixed with the container itself. Thank you very much for making it and supporting it.