Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Valheim Not Listening on Configured Port #4748

Open
gvschilling opened this issue Jan 14, 2025 · 0 comments
Open

[Bug]: Valheim Not Listening on Configured Port #4748

gvschilling opened this issue Jan 14, 2025 · 0 comments

Comments

@gvschilling
Copy link

gvschilling commented Jan 14, 2025

User story

As a user, I want vhserver to listen on the configured gameport

Game

Valheim

Linux distro

Ubuntu 20.04

Command

command: start, command: details

Further information

My vhserver instance (running as a pod in k8s) is configured to run on the standard port 2456, but the server is listening on 33240 instead.

Relevant log output

./vhserver details:

Distro Details
============================================================================================================================================================
Date:         Tue Jan 14 21:46:47 UTC 2025
Distro:       Ubuntu 20.04.6 LTS
Arch:         x86_64
Kernel:       5.4.0-204-generic
Hostname:     [k8s pod name]
Environment:  docker
Uptime:       26d, 2h, 25m
tmux:         3.0a
glibc:        2.31

Server Resource
============================================================================================================================================================
CPU
Model:      Intel(R) Xeon(R) E-2124 CPU @ 3.30GHz
Cores:      4
Frequency:  3900.000MHz
Avg Load:   7.17, 6.17, 5.77

Memory
Mem:       total  used  free   cached  available
Physical:  55GB   32GB  23GB   8.0GB   23GB
Swap:      8.0GB  94MB  8.0GB

Storage
Filesystem:  /dev/rbd14
Total:       98G
Used:        2.4G
Available:   96G

Network
IP:           0.0.0.0
Internet IP:  [public ip]

Valheim Resource Usage
============================================================================================================================================================
CPU Used:  177%
Mem Used:  1%    608MB

Storage
Total:        2.4G
Serverfiles:  2.3G

Valheim Server Details
============================================================================================================================================================
Server name:      [server name]
App ID:           896660
Server IP:        0.0.0.0:2456
Internet IP:      [public ip]:2456
Server password:  [server password]
Game world:       vhserver
Save interval:    1800s
Master server:    not listed
Status:           STARTED

vhserver Script Details
============================================================================================================================================================
Script name:       vhserver
LinuxGSM version:  v24.3.4
glibc required:    2.15
Discord alert:     off
Email alert:       off
Gotify alert:      off
IFTTT alert:       off
Pushbullet alert:  off
Pushover alert:    off
Rocketchat alert:  off
Slack alert:       off
Telegram alert:    off
Update on start:   off
User:              linuxgsm
Location:          /opt/linuxgsm

Backups
============================================================================================================================================================
No Backups created

Command-line Parameters
============================================================================================================================================================
 ./valheim_server.x86_64 -name '[server name]' -password [server password] -port 2456 -world vhserver -public 0 -savedir '/opt/linuxgsm/.config/unity3d/IronGate/Valheim' -saveinterval 1800 -backups 4 -backupshort 7200 -backuplong 43200 -crossplay -instanceid 1

Ports
============================================================================================================================================================
Change ports by editing the parameters in:
/opt/linuxgsm/lgsm/config-lgsm/vhserver

Useful port diagnostic command:
ss -tuplwn | grep valheim_server.

DESCRIPTION  PORT  PROTOCOL  LISTEN
Game         2456  udp       0
Query        1     udp       0

Status: STARTED

ss -tuplwn | grep valheim_server

udp     UNCONN   0        0                0.0.0.0:2457           0.0.0.0:*      users:(("valheim_server.",pid=38028,fd=46))

udp     UNCONN   0        0                0.0.0.0:49582          0.0.0.0:*      users:(("valheim_server.",pid=38028,fd=50))

udp     UNCONN   0        0                      *:33240                *:*      users:(("valheim_server.",pid=38028,fd=45))

tcp     LISTEN   0        128            127.0.0.1:46109          0.0.0.0:*      users:(("valheim_server.",pid=38028,fd=33))

Steps to reproduce

  1. Create a new vhserver instance as a Kubernetes service
  2. In the service's ports spec, have a non-standard port be setup to forward towards the standard port, i.e.:
ports:
- name: game
  nodePort: 30000
  port: 2456
  protocol: UDP
  targetPort: 2456
  1. Have the container, as a statefulset, be set to listen to the standard port, i.e.:
containers:
- name: {{ .Chart.Name }}
  securityContext:
    {{- toYaml .Values.securityContext | nindent 12 }}
  image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  imagePullPolicy: {{ .Values.image.pullPolicy }}
  ports:
  - name: game
    containerPort: 2456
    protocol: UDP
  1. Have port-forwarding setup at the router-level so that inbound traffic to port 30000 goes to the Kubernetes cluster
  2. Start the server
  3. Run the ss -tuplwn | grep valheim_server command
  4. Notice that the listening port is not 2456
  5. Have users attempt to connect to [public ip address]:30000
  6. Users fail to connect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 New Issues
Development

No branches or pull requests

1 participant