[GH-ISSUE #4821] [Bug]: After Valheim Update LGSM 'monitor' command no longer able to detect if Valheim is up #2990

Open
opened 2026-02-27 03:06:39 +03:00 by kerem · 9 comments
Owner

Originally created by @rychannel on GitHub (Sep 9, 2025).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4821

User story

As a Server Admin, I want LinuxGSM 'monitor' command to detect that Valheim is down and restart Valheim so that I can maintain a high SLA

Game

Valheim

Linux distro

Debian 12

Command

command: monitor

Further information

vhserver@valheim:~$ ./vhserver monitor
[  OK  ] Monitoring vhserver: Checking session ... OK
[ FAIL ] Monitoring vhserver: Querying port: gsquery: 127.0.0.1:2457 : 60/5 ... FAIL
[  OK  ] Monitoring vhserver: Sending Discord alert
[  OK  ] Stopping vhserver: Graceful: CTRL+c: 4 ... OK
[  OK  ] Starting vhserver: The Royal Refuge

Relevant log output


Steps to reproduce

  1. Run ./vhserver monitor
Originally created by @rychannel on GitHub (Sep 9, 2025). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4821 ### User story As a Server Admin, I want LinuxGSM 'monitor' command to detect that Valheim is down and restart Valheim so that I can maintain a high SLA ### Game Valheim ### Linux distro Debian 12 ### Command command: monitor ### Further information ```bash vhserver@valheim:~$ ./vhserver monitor [ OK ] Monitoring vhserver: Checking session ... OK [ FAIL ] Monitoring vhserver: Querying port: gsquery: 127.0.0.1:2457 : 60/5 ... FAIL [ OK ] Monitoring vhserver: Sending Discord alert [ OK ] Stopping vhserver: Graceful: CTRL+c: 4 ... OK [ OK ] Starting vhserver: The Royal Refuge ``` ### Relevant log output ```shell ``` ### Steps to reproduce 1. Run ./vhserver monitor
Author
Owner

@bryanhiestand commented on GitHub (Sep 9, 2025):

I have the same issue. Removing vhserver monitor from my cron stopped the restarts, but monitor just fails.

tcpdump shows udp packets

$ sudo tcpdump -ni any port 2457
tcpdump: data link type LINUX_SLL2
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes

21:19:19.681037 lo    In  IP 127.0.0.1.52224 > 127.0.0.1.2457: UDP, length 25
21:19:21.684736 lo    In  IP 127.0.0.1.52224 > 127.0.0.1.2457: UDP, length 25
21:19:39.410283 lo    In  IP 127.0.0.1.51771 > 127.0.0.1.2457: UDP, length 25
21:19:59.941070 lo    In  IP 127.0.0.1.38532 > 127.0.0.1.2457: UDP, length 25

I initially did not have gamedig installed. I thought installing it might resolve my issue, but gamedig also fails:

vhserver@nuc:~$ gamedig --type valheim --host 127.0.0.1 --port 2457 --debug --attempts 5 --socketTimeout 2000
Q#0 Starting
Q#0 Protocol: valve
Q#0 Options: {
  socketTimeout: 2000,
  attemptTimeout: 10000,
  maxRetries: 1,
  stripColors: true,
  portCache: true,
  noBreadthOrder: false,
  ipFamily: 0,
  requestPlayers: true,
  port: 2458,
  protocol: 'valve',
  pretty: false,
  debug: true,
  givenPortOnly: false,
  requestRules: false,
  requestRulesRequired: false,
  requestPlayersRequired: false,
  checkOldIDs: false,
  rejectUnauthorized: false,
  type: 'valheim',
  host: '127.0.0.1',
  attempts: 5
}
Q#0 DNS Lookup: 127.0.0.1
Q#0 Raw IP Address: 127.0.0.1
Q#0 Requesting info ...
127.0.0.1:2458 UDP(38532)-->
Buffer length: 25 bytes
ff ff ff ff 54 53 6f 75 72 63 65 20 45 6e 67 69 6e 65 20 51 75
            T  S  o  u  r  c  e     E  n  g  i  n  e     Q  u
65 72 79 00
e  r  y

Q#0 UDP timeout detected
Q#0 Query failed with error Error: UDP - Timed out after 2000ms
    at Timeout.<anonymous> (file:///usr/lib/node_modules/gamedig/lib/Promises.js:7:18)
    at listOnTimeout (node:internal/timers:588:17)
    at process.processTimers (node:internal/timers:523:7)
Q#1 Starting
Q#1 Protocol: valve
Q#1 Options: {
  socketTimeout: 2000,
  attemptTimeout: 10000,
  maxRetries: 1,
  stripColors: true,
  portCache: true,
  noBreadthOrder: false,
  ipFamily: 0,
  requestPlayers: true,
  port: 2457,
  protocol: 'valve',
  pretty: false,
  debug: true,
  givenPortOnly: false,
  requestRules: false,
  requestRulesRequired: false,
  requestPlayersRequired: false,
  checkOldIDs: false,
  rejectUnauthorized: false,
  type: 'valheim',
  host: '127.0.0.1',
  attempts: 5
}
Q#1 DNS Lookup: 127.0.0.1
Q#1 Raw IP Address: 127.0.0.1
Q#1 Requesting info ...
127.0.0.1:2457 UDP(38532)-->
Buffer length: 25 bytes
ff ff ff ff 54 53 6f 75 72 63 65 20 45 6e 67 69 6e 65 20 51 75
            T  S  o  u  r  c  e     E  n  g  i  n  e     Q  u
65 72 79 00
e  r  y

Q#1 UDP timeout detected
Q#1 Query failed with error Error: UDP - Timed out after 2000ms
    at Timeout.<anonymous> (file:///usr/lib/node_modules/gamedig/lib/Promises.js:7:18)
    at listOnTimeout (node:internal/timers:588:17)
    at process.processTimers (node:internal/timers:523:7)
Error: Failed all 2 attempts
    at QueryRunner.run (file:///usr/lib/node_modules/gamedig/lib/QueryRunner.js:108:17)
    at async GameDig.query (file:///usr/lib/node_modules/gamedig/lib/gamedig.js:11:12)
Attempt #1 - Port=2458 Retry=0:
Error: UDP - Timed out after 2000ms
    at Timeout.<anonymous> (file:///usr/lib/node_modules/gamedig/lib/Promises.js:7:18)
    at listOnTimeout (node:internal/timers:588:17)
    at process.processTimers (node:internal/timers:523:7)
Attempt #2 - Port=2457 Retry=0:
Error: UDP - Timed out after 2000ms
    at Timeout.<anonymous> (file:///usr/lib/node_modules/gamedig/lib/Promises.js:7:18)
    at listOnTimeout (node:internal/timers:588:17)
    at process.processTimers (node:internal/timers:523:7)

The query port does not appear to be working? My server is otherwise online and working.

ss -tuplwn | grep valheim_server.

udp   UNCONN 0      0                               0.0.0.0:49077      0.0.0.0:*    users:(("valheim_server.",pid=524203,fd=51))
udp   UNCONN 19200  0                               0.0.0.0:2457       0.0.0.0:*    users:(("valheim_server.",pid=524203,fd=50))
udp   UNCONN 0      0                                     *:41373            *:*    users:(("valheim_server.",pid=524203,fd=46))
tcp   LISTEN 0      128                           127.0.0.1:41413      0.0.0.0:*    users:(("valheim_server.",pid=524203,fd=34))
<!-- gh-comment-id:3272322900 --> @bryanhiestand commented on GitHub (Sep 9, 2025): I have the same issue. Removing `vhserver monitor` from my cron stopped the restarts, but monitor just fails. tcpdump shows udp packets ``` $ sudo tcpdump -ni any port 2457 tcpdump: data link type LINUX_SLL2 tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes 21:19:19.681037 lo In IP 127.0.0.1.52224 > 127.0.0.1.2457: UDP, length 25 21:19:21.684736 lo In IP 127.0.0.1.52224 > 127.0.0.1.2457: UDP, length 25 21:19:39.410283 lo In IP 127.0.0.1.51771 > 127.0.0.1.2457: UDP, length 25 21:19:59.941070 lo In IP 127.0.0.1.38532 > 127.0.0.1.2457: UDP, length 25 ``` I initially did not have gamedig installed. I thought installing it might resolve my issue, but gamedig also fails: ``` vhserver@nuc:~$ gamedig --type valheim --host 127.0.0.1 --port 2457 --debug --attempts 5 --socketTimeout 2000 Q#0 Starting Q#0 Protocol: valve Q#0 Options: { socketTimeout: 2000, attemptTimeout: 10000, maxRetries: 1, stripColors: true, portCache: true, noBreadthOrder: false, ipFamily: 0, requestPlayers: true, port: 2458, protocol: 'valve', pretty: false, debug: true, givenPortOnly: false, requestRules: false, requestRulesRequired: false, requestPlayersRequired: false, checkOldIDs: false, rejectUnauthorized: false, type: 'valheim', host: '127.0.0.1', attempts: 5 } Q#0 DNS Lookup: 127.0.0.1 Q#0 Raw IP Address: 127.0.0.1 Q#0 Requesting info ... 127.0.0.1:2458 UDP(38532)--> Buffer length: 25 bytes ff ff ff ff 54 53 6f 75 72 63 65 20 45 6e 67 69 6e 65 20 51 75 T S o u r c e E n g i n e Q u 65 72 79 00 e r y Q#0 UDP timeout detected Q#0 Query failed with error Error: UDP - Timed out after 2000ms at Timeout.<anonymous> (file:///usr/lib/node_modules/gamedig/lib/Promises.js:7:18) at listOnTimeout (node:internal/timers:588:17) at process.processTimers (node:internal/timers:523:7) Q#1 Starting Q#1 Protocol: valve Q#1 Options: { socketTimeout: 2000, attemptTimeout: 10000, maxRetries: 1, stripColors: true, portCache: true, noBreadthOrder: false, ipFamily: 0, requestPlayers: true, port: 2457, protocol: 'valve', pretty: false, debug: true, givenPortOnly: false, requestRules: false, requestRulesRequired: false, requestPlayersRequired: false, checkOldIDs: false, rejectUnauthorized: false, type: 'valheim', host: '127.0.0.1', attempts: 5 } Q#1 DNS Lookup: 127.0.0.1 Q#1 Raw IP Address: 127.0.0.1 Q#1 Requesting info ... 127.0.0.1:2457 UDP(38532)--> Buffer length: 25 bytes ff ff ff ff 54 53 6f 75 72 63 65 20 45 6e 67 69 6e 65 20 51 75 T S o u r c e E n g i n e Q u 65 72 79 00 e r y Q#1 UDP timeout detected Q#1 Query failed with error Error: UDP - Timed out after 2000ms at Timeout.<anonymous> (file:///usr/lib/node_modules/gamedig/lib/Promises.js:7:18) at listOnTimeout (node:internal/timers:588:17) at process.processTimers (node:internal/timers:523:7) Error: Failed all 2 attempts at QueryRunner.run (file:///usr/lib/node_modules/gamedig/lib/QueryRunner.js:108:17) at async GameDig.query (file:///usr/lib/node_modules/gamedig/lib/gamedig.js:11:12) Attempt #1 - Port=2458 Retry=0: Error: UDP - Timed out after 2000ms at Timeout.<anonymous> (file:///usr/lib/node_modules/gamedig/lib/Promises.js:7:18) at listOnTimeout (node:internal/timers:588:17) at process.processTimers (node:internal/timers:523:7) Attempt #2 - Port=2457 Retry=0: Error: UDP - Timed out after 2000ms at Timeout.<anonymous> (file:///usr/lib/node_modules/gamedig/lib/Promises.js:7:18) at listOnTimeout (node:internal/timers:588:17) at process.processTimers (node:internal/timers:523:7) ``` The query port does not appear to be working? My server is otherwise online and working. ``` ss -tuplwn | grep valheim_server. udp UNCONN 0 0 0.0.0.0:49077 0.0.0.0:* users:(("valheim_server.",pid=524203,fd=51)) udp UNCONN 19200 0 0.0.0.0:2457 0.0.0.0:* users:(("valheim_server.",pid=524203,fd=50)) udp UNCONN 0 0 *:41373 *:* users:(("valheim_server.",pid=524203,fd=46)) tcp LISTEN 0 128 127.0.0.1:41413 0.0.0.0:* users:(("valheim_server.",pid=524203,fd=34)) ```
Author
Owner

@bryanhiestand commented on GitHub (Sep 11, 2025):

It looks like whatever changed might be in the crossplay/PlayFab path?

I don't see an option for it in lgsm, but removing -crossplay from startparameters fixes queries again (so monitor would work). In my case, I just did this since I don't think I need crossplay

cat <<'EOF' >> ~/lgsm/config-lgsm/vhserver/vhserver.cfg
startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${worldname} -public ${public} -savedir '${savedir}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} -instanceid ${instanceid} ${logFile:+ -logFile '${logFile}'} ${worldmodifiers:+ ${worldmodifiers}}"
EOF
<!-- gh-comment-id:3277048778 --> @bryanhiestand commented on GitHub (Sep 11, 2025): It looks like whatever changed might be in the crossplay/PlayFab path? I don't see an option for it in lgsm, but removing `-crossplay` from `startparameters` fixes queries again (so monitor would work). In my case, I just did this since I don't think I need crossplay ```bash cat <<'EOF' >> ~/lgsm/config-lgsm/vhserver/vhserver.cfg startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${worldname} -public ${public} -savedir '${savedir}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} -instanceid ${instanceid} ${logFile:+ -logFile '${logFile}'} ${worldmodifiers:+ ${worldmodifiers}}" EOF ```
Author
Owner

@Khufuhk commented on GitHub (Sep 13, 2025):

While taking crossplay out of the config allowed monitor to work again, it made it so the server no longer showed up in the community server browser.

<!-- gh-comment-id:3288692067 --> @Khufuhk commented on GitHub (Sep 13, 2025): While taking crossplay out of the config allowed monitor to work again, it made it so the server no longer showed up in the community server browser.
Author
Owner

@irobot73 commented on GitHub (Sep 16, 2025):

It looks like whatever changed might be in the crossplay/PlayFab path?

I don't see an option for it in lgsm, but removing -crossplay from startparameters fixes queries again (so monitor would work). In my case, I just did this since I don't think I need crossplay

cat <<'EOF' >> ~/lgsm/config-lgsm/vhserver/vhserver.cfg
startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${worldname} -public ${public} -savedir '${savedir}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} -instanceid ${instanceid} ${logFile:+ -logFile '${logFile}'} ${worldmodifiers:+ ${worldmodifiers}}"
EOF

LGSM used to have CROSSPLAY as optional (before it was officially supported). I've pulled it in to utilize in my /data/config-lgsm/vhserver.cfg

`
# If crossplay is empty, it's off. Fill with any text to make true
crossplay="1"

startparameters="-name "${servername}" -password ${serverpassword} -port ${port} -world "${worldname}" -public ${public} ${crossplay:+-crossplay} -savedir '${savedir}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} -instanceid ${instanceid} ${logFile:+ -logFile '${logFile}'} ${worldmodifiers:+ ${worldmodifiers}}"
`

<!-- gh-comment-id:3299645314 --> @irobot73 commented on GitHub (Sep 16, 2025): > It looks like whatever changed might be in the crossplay/PlayFab path? > > I don't see an option for it in lgsm, but removing `-crossplay` from `startparameters` fixes queries again (so monitor would work). In my case, I just did this since I don't think I need crossplay > > cat <<'EOF' >> ~/lgsm/config-lgsm/vhserver/vhserver.cfg > startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${worldname} -public ${public} -savedir '${savedir}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} -instanceid ${instanceid} ${logFile:+ -logFile '${logFile}'} ${worldmodifiers:+ ${worldmodifiers}}" > EOF LGSM used to have CROSSPLAY as optional (before it was officially supported). I've pulled it in to utilize in my /data/config-lgsm/vhserver.cfg ` \# If crossplay is empty, it's off. Fill with any text to make true crossplay="1" startparameters="-name \"${servername}\" -password ${serverpassword} -port ${port} -world \"${worldname}\" -public ${public} ${crossplay:+-crossplay} -savedir '${savedir}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} -instanceid ${instanceid} ${logFile:+ -logFile '${logFile}'} ${worldmodifiers:+ ${worldmodifiers}}" `
Author
Owner

@irobot73 commented on GitHub (Sep 16, 2025):

While taking crossplay out of the config allowed monitor to work again, it made it so the server no longer showed up in the community server browser.

Made sure all your networking/port-forwarding is Kosher? IIRC, that's the only thing that dorked mine showing in the Comm. Server list....then I went CROSSPLAY (which negates any need for networking, but I kept it in case I ever had to disable C.P.)

<!-- gh-comment-id:3299666749 --> @irobot73 commented on GitHub (Sep 16, 2025): > While taking crossplay out of the config allowed monitor to work again, it made it so the server no longer showed up in the community server browser. Made sure all your networking/port-forwarding is Kosher? IIRC, that's the only thing that dorked mine showing in the Comm. Server list....then I went CROSSPLAY (which negates any need for networking, but I kept it in case I ever had to disable C.P.)
Author
Owner

@bryanhiestand commented on GitHub (Sep 17, 2025):

This may have been fixed with a small Valheim update last night. This now works for me

vhserver@nuc:~$ ./vhserver monitor
[  OK  ] Monitoring vhserver: Checking session ... OK
[  OK  ] Monitoring vhserver: Querying port: gamedig: 127.0.0.1:2457 : 0/1 ... OK

core_exit.sh exiting with code: 0
<!-- gh-comment-id:3304477963 --> @bryanhiestand commented on GitHub (Sep 17, 2025): This may have been fixed with a small Valheim update last night. This now works for me ``` vhserver@nuc:~$ ./vhserver monitor [ OK ] Monitoring vhserver: Checking session ... OK [ OK ] Monitoring vhserver: Querying port: gamedig: 127.0.0.1:2457 : 0/1 ... OK core_exit.sh exiting with code: 0 ```
Author
Owner

@Khufuhk commented on GitHub (Sep 17, 2025):

Problem persists for me after running all updates and restarting container. Crossplay on breaks Monitor and Crossplay off removes server from community list.

<!-- gh-comment-id:3304625920 --> @Khufuhk commented on GitHub (Sep 17, 2025): Problem persists for me after running all updates and restarting container. Crossplay on breaks Monitor and Crossplay off removes server from community list.
Author
Owner

@JustinTArthur commented on GitHub (Sep 17, 2025):

I can confirm that Valheim made this change in the Call to Arms update. In a way it was a bug for it to start Steam lobby registration and expose the query port in Crossplay mode since you wouldn't be able to connect to the Steam-facilitated gameplay port in that mode anyway.

As others have suggested, LinuxGSM would either need to pick a querymode based on whether Crossplay was enabled or switch to session-based monitoring in the vhserver default config (allowing power users to override for gamedig or gsquery in the Steam/non-Crossplay mode).

<!-- gh-comment-id:3304793016 --> @JustinTArthur commented on GitHub (Sep 17, 2025): I can confirm that Valheim made this change in the Call to Arms update. In a way it was a bug for it to start Steam lobby registration and expose the query port in Crossplay mode since you wouldn't be able to connect to the Steam-facilitated gameplay port in that mode anyway. As others have suggested, LinuxGSM would either need to pick a `querymode` based on whether Crossplay was enabled or switch to session-based monitoring in the vhserver default config (allowing power users to override for gamedig or gsquery in the Steam/non-Crossplay mode).
Author
Owner

@bryanhiestand commented on GitHub (Sep 17, 2025):

Problem persists for me after running all updates and restarting container. Crossplay on breaks Monitor and Crossplay off removes server from community list.

I am so sorry for the false noise on this issue! I forgot to re-enable crossplay before testing

<!-- gh-comment-id:3304800666 --> @bryanhiestand commented on GitHub (Sep 17, 2025): > Problem persists for me after running all updates and restarting container. Crossplay on breaks Monitor and Crossplay off removes server from community list. I am so sorry for the false noise on this issue! I forgot to re-enable crossplay before testing
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#2990
No description provided.