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

Stuck on Connecting to Steam Public #541

Open get-got opened 1 year ago

get-got commented 1 year ago

I used to use this container previously and never had any issues but trying to get it going after the new game update, I keep getting stuck on "Connecting anonymously to Steam Public...". It gets hung up on this and never succeeds to download the server client. I tried binding 9001 and 80 to see if that made a difference but it didn't.

Ubuntu 22.04.1 LTS, amd64


    --name valheim-server \
    --cap-add=sys_nice \
    --stop-timeout 120 \
    -p 2456-2457:2456-2457/udp \
    -v /home/games/valheim/config:/config \
    -v /home/games/valheim/data:/opt/valheim \
    -e SERVER_NAME="My Server" \
    -e WORLD_NAME="Dec22" \
    -e SERVER_PASS="ragnar" \
    -e VALHEIM_PLUS=true \
    lloesche/valheim-server```
lloesche commented 1 year ago

This sounds like it might be a 32bit library compatibility issue that we saw with older kernels. Can you try the latest version to see if it resolves the issue? There's also the :debian10 container tag that uses the old libraries but has no crossplay support.

lozman commented 1 year ago

I am having the same issue, also on Jammy Ubuntu.

Linux docker 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

When you say try the latest version, what do you mean? The latest version of what?

lozman commented 1 year ago

Ok, I solved this in my case, which was specific to my environment. I am running my DNS resolver (pihole) also set up as a container. When this Valheim container started it didn't have any DNS resolution, because the pihole container is/was running on the same host. I had to tell the pihole container to use host networking instead of forwarded ports.

malake commented 1 year ago

I'm running this on a Synology NAS and have been struggling with the container auto-updating and never finishing/starting. I initially followed all of the steps to do an update (before lloesche updated the docker image) and had the same result. After he updated the image in Docker Hub it works like a charm now.

HorstBaerbel commented 1 year ago

I'm running this on a Synology NAS and have been struggling with the container auto-updating and never finishing/starting. I initially followed all of the steps to do an update (before lloesche updated the docker image) and had the same result. After he updated the image in Docker Hub it works like a charm now.

Could you describe what you did exactly? I have the same problem and have a feeling this is due to the firewall not allowing the container to access steam to update... Is port 2568 also needed to be forwarded from the container?

On a fresh container pull and start I get:

Feb 10 14:53:43 supervisord: valheim-updater [ 0%] Checking for available updates...
Feb 10 14:53:43 supervisord: valheim-updater [----] Verifying installation...
Feb 10 14:53:43 supervisord: valheim-updater [ 0%] Downloading update...
Feb 10 14:53:43 supervisord: valheim-updater [ 0%] Checking for available updates...
Feb 10 14:53:43 supervisord: valheim-updater [----] !!! Fatal Error: Steamcmd needs to be online to update. Please confirm your network connection and try again.

also

Feb 10 15:36:57 supervisord: valheim-updater valheim-server: started
Feb 10 15:37:01 cron[29]: (root) RELOAD (crontabs/root)
Feb 10 15:37:06 supervisord: valheim-server 02/10/2023 15:37:06: Zonesystem Start 503
Feb 10 15:37:06 assert_20230210153646_6.dmp[111]: Finished uploading minidump (out-of-process): success = no
Feb 10 15:37:06 assert_20230210153646_6.dmp[111]: error: Couldn't resolve host name
Feb 10 15:37:06 assert_20230210153646_6.dmp[111]: file ''/tmp/dumps/assert_20230210153646_6.dmp'', upload no: ''Couldn't resolve host name''
2023-02-10 15:37:07,649 INFO reaped unknown pid 111 (exit status 0)

lozman commented 1 year ago

Is port 2568 also needed to be forwarded from the container?

Valheim needs ports 2456-2458, however, unless you are doing something out of the ordinary incoming ports should not affect the server updating itself since that is an outbound connection and NAT'ed on the way out.

Feb 10 15:37:06 assert_20230210153646_6.dmp[111]: error: Couldn't resolve host name Feb 10 15:37:06 assert_20230210153646_6.dmp[111]: file ''/tmp/dumps/assert_20230210153646_6.dmp'', upload no: ''Couldn't resolve host name''

This looks like a DNS issue. Where is DNS running? If you console into the running container can you successfully resolve DNS addresses from within? My guess is no.

HorstBaerbel commented 1 year ago

But then do I need to bridge 2458 (TCP? UDP?) from the container to host / NAS too? By default the image only bridges 2456-2457...

My setup is:

After the server has restarted or the DynDNS kicked in (presumably) I see the message "supervisord: valheim-server 02/12/2023 10:41:32: Game server connected failed" and I can't even connect via LAN IP, which is odd...

I tried:

root@valheim-server:/# cat /etc/resolv.conf
nameserver

and LOCAL_ROUTER_IP points to the IP of my internet router (configure as gateway and DNS in NAS). Should should this point to a fixed DNS server here, e.g. 8.8.8.8? I'm not sure why this is necessary for LAN though...

EDIT: When I turn off the NAS firewall briefly the connection works. I can turn it on again after connecting (for playing) though. It only seems to prevent the connection, which is odd...

HorstBaerbel commented 1 year ago

Got this to work. It was a firewall problem. The container / docker was unable to talk to the NAS internally. What I did:

Take note of your docker bridge settings / IPs: grafik

Go to your firewall settings and add a rule: grafik

with the IP range of your docker bridge: grafik Note that the order of rules matters!

If you want your container to be reachable from the outside make sure to add a rule to open ports 2456-2457 in the synology firewall and forward them in your internet router too. Port 2458 is used by the Valheim server, but does not need to be forwarded.

Would be cool if this would make it into the server README to save people some time.