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.89k stars 269 forks source link

Xbox client unable to connect with crossplay enabled #629

Closed kgadberry closed 1 year ago

kgadberry commented 1 year ago

I've set up the server using docker and docker-compose and crossplay doesn't appear to work. A friend with an xbox is unable to connect using PUBLIC_IP:2456. Port forwarding has been set up and verified using a PC client with an external IP address to the public address of the server, so I can rule out network configuration issues. PC clients using Steam are able to connect just fine. No messages are shown in the server log when the xbox client tries to connect.

This is the docker-compose.yml I use to run the server.

version: '3.3'
services:
    main:
        container_name: valheim-server
        image: ghcr.io/lloesche/valheim-server
        cap_add:
          - sys_nice
        ports:
            - '2456-2457:2456-2457/udp'
        volumes:
            - '/srv/valheim-server/config:/config'
            - '/srv/valheim-server/data:/opt/valheim'
        environment:
            - SERVER_NAME=TOAST
            - WORLD_NAME=TOAST
            - SERVER_PASS=redacted
            - SERVER_ARGS='-crossplay'
            - UPDATE_IF_IDLE=true
            - RESTART_IF_IDLE=true
            - SERVER_PUBLIC=false
        restart: always
        stop_grace_period: 2m
DavidMakin commented 1 year ago

Have you tried connecting using the 6 digit sever code that you can get when viewing the map or via the docker logs, should look something like Session "TOAST" registered with join code 676033

kgadberry commented 1 year ago

There is no join code in the docker logs or on the in-game map. This is my log from startup to a Steam client connecting and disconnecting: https://gist.github.com/kgadberry/8703f734e53b76862c7d62aca828d664

DavidMakin commented 1 year ago

There is only 1 mention of PlayFab in your logs, Sending PlayFab login request (attempt 1) which tells us you have the correct param.

There should be several more entries, something like this

PlayFab custom ID set to "PlayFab_F1lthy Casuals_2456_bcfe26b5c5087490d820ddc7430720c5"
Sending PlayFab login request (attempt 2)
Worldgenerator version setup:2
PlayFab logged in as "PlayFab_F1lthy Casuals_2456_bcfe26b5c5087490d820ddc7430720c5"
PlayFab local entity ID is DDE9FAFC452F884F
New session server "F1lthy Casuals" that has join code , now 0 player(s)
Register PlayFab server "F1lthy Casuals" with IP <your External IP>:2456
Server 'F1lthy Casuals' begin PlayFab create and join network for server 

You do also have the entry

May 20 03:45:36 supervisord: valheim-updater ERROR - 3.72 GiB is not enough memory - read https://github.com/lloesche/valheim-server-docker#system-requirements

but I have no idea if this would cause this problem.

1 obvious thing to check is that you have the latest docker image. Stop your container, update docker pull ghcr.io/lloesche/valheim-server:latest, restart and fingers crossed

kgadberry commented 1 year ago

I'm not entirely sure what actually happened, but changing the environment variables from the format of - SERVER_NAME="TOAST" to SERVER_NAME: "TOAST" seems to have fixed it. I'm guessing not all the environment variables were being passed properly? I'm going to blame Docker for this one, because that format hasn't given me issues in the past.