[Bug]: Cannot query lgsm server when crossplay is enabled (a2s_info won't connect)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
报告中没有确定任何 LinuxGSM 文件或测试。首先,在启用和禁用 crossplay 的情况下,使用 ./vhserver start、文档中的 nc A2S 查询以及 ./vhserver dt 和 qr 诊断来复现比较结果。完成的标准是确定一项 LinuxGSM 侧的变更(如果存在受支持的变更),以恢复预期的查询行为。
由索引模型根据 Issue 内容生成。
描述
User story
As a dedicated server host, using cloud service providers, I want to be able to query my lgsm server so that I can automate server operations (startup / shutdown).
Game
Valheim
Linux distro
Ubuntu 24.04
Command
command: details, command: monitor
Further information
Context
I've been hosting a Valheim Server for a group of friends off-and-on for several years. The game server is VM on GCP -- it starts lgsm / vhserver as soon as it boots. Then I built a discord bot that listens in our discord, and can turn the VM off/on using pub/sub messages attached to a "Cloud Function."
My Discord bot uses Steam's a2s_info query to determine if the server is up, and if so, state how many people are logged in. It uses the a2s_info query to tell people when the server is up (e.g. "Starting.... Started!"), so it's an important part of my setup.
Problem
When crossplay is enabled, Steam's server queries are broken (e.g. A2S_info, A2S_ping).
At first I thought this was a port forwarding issue, but I think there's a more significant reason why this doesn't work. Specifically, when crossplay is enabled, queries are broken on the host itself.
With Crossplay Turned on.
$ ./vhserver start
$ echo -n -e "\xff\xff\xff\xff\x54\x53\x6f\x75\x72\x63\x65\x20\x45\x6e\x67\x69\x6e\x65\x20\x51\x75\x65\x72\x79\x00" | nc -u 127.0.0.1 2457
With Crossplay Turned off:
$ ./vhserver start
$ echo -n -e "\xff\xff\xff\xff\x54\x53\x6f\x75\x72\x63\x65\x20\x45\x6e\x67\x69\x6e\x65\x20\x51\x75\x65\x72\x79\x00" | nc -u 127.0.0.1 2457
I$servername$$servername$valheim
dl1.0.0.0 ̧8@g=0.221.12,n=36,m=*
Prior Issue: https://github.com/GameServerManagers/LinuxGSM/issues/4748
Expected Behavior
Whether crossplay is enabled or not:
- Players can join the game via the Valheim game client.
- a2s_info server queries return server information.
Game Startup
With Crossplay
./valheim_server.x86_64 -name $servername -password $passwd -port 2456 -world $worldname -public 1 -savedir '/home/vhserver/.config/unity3d/IronGate/Valheim' -saveinterval 1800 -backups 4 -backupshort 7200 -backuplong 43200 -crossplay -instanceid 1
Without Crossplay
./valheim_server.x86_64 -name $servername -password $passwd -port 2456 -world $worldname -public 1 -savedir '/home/vhserver/.config/unity3d/IronGate/Valheim' -saveinterval 1800 -backups 4 -backupshort 7200 -backuplong 43200 -instanceid 1
Server Query
There are several ways to query a server.
- URL, using the Steam API: https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=$ip_addr
- Note: Replace $ip_addr with the public-facing IP of the game server.
- If successful the
servers:list in the reply will not be empty.
- CLI: On the game server itself, attempt to send the A2S Challenge:
echo -n -e "\xff\xff\xff\xff\x54\x53\x6f\x75\x72\x63\x65\x20\x45\x6e\x67\x69\x6e\x65\x20\x51\x75\x65\x72\x79\x00" | nc -u 127.0.0.1 2457- If successful, a chunk of data will be returned on the command line,:
I$server_name$valheim
^C1.0.0.0 8@g=0.221.12,n=36,m=*
If run from a remote host, the steam game server could issue a challenge, which looks like several random characters in response. Otherwise, a failure looks like nothing happens.
Network Setup
IP
The game server, hosted on GCP, has a static, publicly routable IP. It's pingable from my home workstation as well as from another VM.
Firewall
I've opened the following ports (ingress) from 0.0.0.0/0:
tcp:
2456-2458,
27015-27030,
27036-27037
udp:
2456-2458,
4380,
27000-27031,
27036
Relevant log output
### Without Crossplay Enabled ###
$ ./vhserver dt
Distro Details
================================================================================================================
Date: Mon Mar 23 04:13:49 UTC 2026
Distro: Debian GNU/Linux 13 (trixie)
Arch: x86_64
Kernel: 6.12.73+deb13-cloud-amd64
Hostname: instance-20260322-040156
Environment: google
Uptime: 0d, 1h, 39m
tmux: 3.5a
glibc: 2.41
Server Resource
================================================================================================================
CPU
Model: AMD EPYC 7B13
Cores: 2
Frequency: 2449.998MHz
Avg Load: 0.14, 0.03, 0.01
Memory
Mem: total used free cached available
Physical: 7.8GB 1.3GB 6.4GB 866MB 6.4GB
Swap: 0B 0B 0B
Storage
Filesystem: /dev/sda1
Total: 9.7G
Used: 5.2G
Available: 4.0G
Network
IP: 0.0.0.0
Internet IP: 34.42.187.172
Valheim Resource Usage
================================================================================================================
CPU Used: 64.1%
Mem Used: 13.4% 1065MB
Storage
Total: 1.9G
Serverfiles: 1.7G
Valheim Server Details
================================================================================================================
Server name: $servername
App ID: 896660
Server IP: 0.0.0.0:2456
Internet IP: 34.42.187.172:2456
Server password: $passwd
Save interval: 1800s
Master server: not listed
Status: STARTED
vhserver Script Details
================================================================================================================
Script name: vhserver
LinuxGSM version: v25.2.0
glibc required: 2.15
IFTTT alert: off
Update on start: off
User: vhserver
Location: /home/vhserver
Backups
================================================================================================================
No Backups created
Command-line Parameters
================================================================================================================
./valheim_server.x86_64 -name $servername -password $passwd -port 2456 -world $worldname -public 1 -savedir '/home/vhserver/.config/unity3d/IronGate/Valheim' -saveinterval 1800 -backups 4 -backupshort 7200 -backuplong 43200 -instanceid 1
Ports
================================================================================================================
Change ports by editing the parameters in:
/home/vhserver/lgsm/config-lgsm/vhserver
Useful port diagnostic command:
ss -tuplwn | grep valheim_server.
DESCRIPTION PORT PROTOCOL LISTEN
Game 2456 udp 0
Query 2457 udp 1
Status: STARTED
core_exit.sh exiting with code: 0
$ ./vhserver qr
Valheim Developer Query Raw
=================================
IP Addresses Variables
=================================
IP: 0.0.0.0
HTTP IP: 10.128.0.4
Public IP: 35.208.212.176
Telnet IP: 10.128.0.4
Display IP:
Query IP Addresses
=================================
127.0.0.1
10.128.0.4
35.208.212.176
Game Server Ports
=================================
Port Name Port Number Status TCP UDP
Game: 2456 0
Query: 2457 1 UNCONN
API:
App:
BattleEye:
Beacon:
ReliableMessaging:
Client:
File:
HTTP:
HTTP Query:
Web Interface:
Game: Master:
RAW UDP Socket:
RCON:
Steam:
Steamworks P2P:
Steam: Auth:
Telnet:
Stats:
SourceTV:
UDP Link:
Voice:
Voice (Unused):
SS Output
=================================
Useful port diagnostic command:
ss -tuplwn | grep valheim_server.
udp UNCONN 0 0 0.0.0.0:2457 0.0.0.0:* users:(("valheim_server.",pid=37871,fd=36))
udp UNCONN 0 0 0.0.0.0:36565 0.0.0.0:* users:(("valheim_server.",pid=37871,fd=50))
udp UNCONN 0 0 *:47464 *:* users:(("valheim_server.",pid=37871,fd=35))
tcp LISTEN 0 128 127.0.0.1:39921 0.0.0.0:* users:(("valheim_server.",pid=37871,fd=32))
Query Port (2457) - Gamedig Output
=================================
PORT: 2456
QUERY PORT: 2457
Is My Game Server Online?
=================================
Game server status: https://ismygameserver.online//35.208.212.176:2457
Gamedig Raw Output
=================================
Failure! gamedig not installed
Query Port (2457) - gsquery Output
=================================
./query_gsquery.py -a "127.0.0.1" -p "2457" -e ""
usage: usage: python3 query_gsquery.py [options]
query_gsquery.py: error: argument -e/--engine: invalid choice: '' (choose from protocol-valve, protocol-quake2, protocol-quake3, protocol-gamespy1, protocol-unreal2, ut3, minecraft, minecraftbe, jc2m, mumbleping, soldat, teeworlds)
./query_gsquery.py -a "10.128.0.4" -p "2457" -e ""
usage: usage: python3 query_gsquery.py [options]
query_gsquery.py: error: argument -e/--engine: invalid choice: '' (choose from protocol-valve, protocol-quake2, protocol-quake3, protocol-gamespy1, protocol-unreal2, ut3, minecraft, minecraftbe, jc2m, mumbleping, soldat, teeworlds)
./query_gsquery.py -a "35.208.212.176" -p "2457" -e ""
usage: usage: python3 query_gsquery.py [options]
query_gsquery.py: error: argument -e/--engine: invalid choice: '' (choose from protocol-valve, protocol-quake2, protocol-quake3, protocol-gamespy1, protocol-unreal2, ut3, minecraft, minecraftbe, jc2m, mumbleping, soldat, teeworlds)
Query Port (2457) - TCP Output
=================================
bash -c 'exec 3<> /dev/tcp/'127.0.0.1'/'2457''
bash: connect: Connection refused
bash: line 1: /dev/tcp/127.0.0.1/2457: Connection refused
TCP query FAIL
bash -c 'exec 3<> /dev/tcp/'10.128.0.4'/'2457''
bash: connect: Connection refused
bash: line 1: /dev/tcp/10.128.0.4/2457: Connection refused
TCP query FAIL
bash -c 'exec 3<> /dev/tcp/'35.208.212.176'/'2457''
bash: connect: Connection refused
bash: line 1: /dev/tcp/35.208.212.176/2457: Connection refused
TCP query FAIL
Game Port (2456) - TCP Output
=================================
TCP Raw Output
=================================
bash -c 'exec 3<> /dev/tcp/'127.0.0.1'/'2456''
bash: connect: Connection refused
bash: line 1: /dev/tcp/127.0.0.1/2456: Connection refused
TCP query FAIL
bash -c 'exec 3<> /dev/tcp/'10.128.0.4'/'2456''
bash: connect: Connection refused
bash: line 1: /dev/tcp/10.128.0.4/2456: Connection refused
TCP query FAIL
bash -c 'exec 3<> /dev/tcp/'35.208.212.176'/'2456''
bash: connect: Connection refused
bash: line 1: /dev/tcp/35.208.212.176/2456: Connection refused
TCP query FAIL
Steam Master Server Response
=================================
curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=35.208.212.176
Response: false
core_exit.sh exiting with code: 0
### With Crossplay Enabled ###
vhserver@instance-20260322-040156:~$ ./vhserver dt
Distro Details
================================================================================================================
Date: Mon Mar 23 04:59:58 UTC 2026
Distro: Debian GNU/Linux 13 (trixie)
Arch: x86_64
Kernel: 6.12.73+deb13-cloud-amd64
Hostname: instance-20260322-040156
Environment: google
Uptime: 0d, 2h, 25m
tmux: 3.5a
glibc: 2.41
Server Resource
================================================================================================================
CPU
Model: AMD EPYC 7B13
Cores: 2
Frequency: 2449.998MHz
Avg Load: 0.52, 0.17, 0.09
Memory
Mem: total used free cached available
Physical: 7.8GB 1.2GB 6.4GB 910MB 6.4GB
Swap: 0B 0B 0B
Storage
Filesystem: /dev/sda1
Total: 9.7G
Used: 5.3G
Available: 4.0G
Network
IP: 0.0.0.0
Internet IP: 35.208.212.176
Valheim Resource Usage
================================================================================================================
CPU Used: 65.3%
Mem Used: 11.6% 924MB
Storage
Total: 1.9G
Serverfiles: 1.7G
Valheim Server Details
================================================================================================================
Server name: $servername
App ID: 896660
Server IP: 0.0.0.0:2456
Internet IP: 35.208.212.176:2456
Server password: #passwd
Save interval: 1800s
Master server: not listed
Status: STARTED
vhserver Script Details
================================================================================================================
Script name: vhserver
LinuxGSM version: v25.2.0
glibc required: 2.15
IFTTT alert: off
Update on start: off
User: vhserver
Location: /home/vhserver
Backups
================================================================================================================
No Backups created
Command-line Parameters
================================================================================================================
./valheim_server.x86_64 -name $servername -password $passwd -port 2456 -world #worldname -public 1 -savedir '/home/vhserver/.config/unity3d/IronGate/Valheim' -saveinterval 1800 -backups 4 -backupshort 7200 -backuplong 43200 -crossplay -instanceid 1
Ports
================================================================================================================
Change ports by editing the parameters in:
/home/vhserver/lgsm/config-lgsm/vhserver
Useful port diagnostic command:
ss -tuplwn | grep valheim_server.
DESCRIPTION PORT PROTOCOL LISTEN
Game 2456 udp 0
Query 2457 udp 0
Status: STARTED
core_exit.sh exiting with code: 0
vhserver@instance-20260322-040156:~$ ./vhserver qr
Valheim Developer Query Raw
=================================
IP Addresses Variables
=================================
IP: 0.0.0.0
HTTP IP: 10.128.0.4
Public IP: 35.208.212.176
Telnet IP: 10.128.0.4
Display IP:
Query IP Addresses
=================================
127.0.0.1
10.128.0.4
35.208.212.176
Game Server Ports
=================================
Port Name Port Number Status TCP UDP
Game: 2456 0
Query: 2457 1 UNCONN
API:
App:
BattleEye:
Beacon:
ReliableMessaging:
Client:
File:
HTTP:
HTTP Query:
Web Interface:
Game: Master:
RAW UDP Socket:
RCON:
Steam:
Steamworks P2P:
Steam: Auth:
Telnet:
Stats:
SourceTV:
UDP Link:
Voice:
Voice (Unused):
SS Output
=================================
Useful port diagnostic command:
ss -tuplwn | grep valheim_server.
udp UNCONN 6400 0 0.0.0.0:2457 0.0.0.0:* users:(("valheim_server.",pid=40717,fd=46))
udp UNCONN 0 0 0.0.0.0:51794 0.0.0.0:* users:(("valheim_server.",pid=40717,fd=52))
udp UNCONN 0 0 *:35262 *:* users:(("valheim_server.",pid=40717,fd=45))
tcp LISTEN 0 128 127.0.0.1:34247 0.0.0.0:* users:(("valheim_server.",pid=40717,fd=33))
Query Port (2457) - Gamedig Output
=================================
PORT: 2456
QUERY PORT: 2457
Is My Game Server Online?
=================================
Game server status: https://ismygameserver.online//35.208.212.176:2457
Gamedig Raw Output
=================================
Failure! gamedig not installed
Query Port (2457) - gsquery Output
=================================
./query_gsquery.py -a "127.0.0.1" -p "2457" -e ""
usage: usage: python3 query_gsquery.py [options]
query_gsquery.py: error: argument -e/--engine: invalid choice: '' (choose from protocol-valve, protocol-quake2, protocol-quake3, protocol-gamespy1, protocol-unreal2, ut3, minecraft, minecraftbe, jc2m, mumbleping, soldat, teeworlds)
./query_gsquery.py -a "10.128.0.4" -p "2457" -e ""
usage: usage: python3 query_gsquery.py [options]
query_gsquery.py: error: argument -e/--engine: invalid choice: '' (choose from protocol-valve, protocol-quake2, protocol-quake3, protocol-gamespy1, protocol-unreal2, ut3, minecraft, minecraftbe, jc2m, mumbleping, soldat, teeworlds)
./query_gsquery.py -a "35.208.212.176" -p "2457" -e ""
usage: usage: python3 query_gsquery.py [options]
query_gsquery.py: error: argument -e/--engine: invalid choice: '' (choose from protocol-valve, protocol-quake2, protocol-quake3, protocol-gamespy1, protocol-unreal2, ut3, minecraft, minecraftbe, jc2m, mumbleping, soldat, teeworlds)
Query Port (2457) - TCP Output
=================================
bash -c 'exec 3<> /dev/tcp/'127.0.0.1'/'2457''
bash: connect: Connection refused
bash: line 1: /dev/tcp/127.0.0.1/2457: Connection refused
TCP query FAIL
bash -c 'exec 3<> /dev/tcp/'10.128.0.4'/'2457''
bash: connect: Connection refused
bash: line 1: /dev/tcp/10.128.0.4/2457: Connection refused
TCP query FAIL
bash -c 'exec 3<> /dev/tcp/'35.208.212.176'/'2457''
bash: connect: Connection refused
bash: line 1: /dev/tcp/35.208.212.176/2457: Connection refused
TCP query FAIL
Game Port (2456) - TCP Output
=================================
TCP Raw Output
=================================
bash -c 'exec 3<> /dev/tcp/'127.0.0.1'/'2456''
bash: connect: Connection refused
bash: line 1: /dev/tcp/127.0.0.1/2456: Connection refused
TCP query FAIL
bash -c 'exec 3<> /dev/tcp/'10.128.0.4'/'2456''
bash: connect: Connection refused
bash: line 1: /dev/tcp/10.128.0.4/2456: Connection refused
TCP query FAIL
bash -c 'exec 3<> /dev/tcp/'35.208.212.176'/'2456''
bash: connect: Connection refused
bash: line 1: /dev/tcp/35.208.212.176/2456: Connection refused
TCP query FAIL
Steam Master Server Response
=================================
curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=35.208.212.176
Response: false
core_exit.sh exiting with code: 0
Steps to reproduce
./vhserver startecho -n -e "\xff\xff\xff\xff\x54\x53\x6f\x75\x72\x63\x65\x20\x45\x6e\x67\x69\x6e\x65\x20\x51\x75\x65\x72\x79\x00" | nc -u 127.0.0.1 2457
- 主要语言
- Shell
- 星标
- 4.9k
- 派生
- 870
- 平均合并
- 18 小时 44 分钟
- 30 天内合并 PR
- 148
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GameServerManagers/LinuxGSM 的其他 Issue
-
command: start distro: Debian engine: null game: Teamspeak 3 reproducible: always severity: low type: bug
难度 2/5 1-3 小时 新手友好度 76/100
GameServerManagers/LinuxGSM#5193 ·
维护者通常 1 天内回复
-
command: start engine: unreal4 game: The Front reproducible: always severity: medium type: bug
难度 1/5 1 小时以内 新手友好度 86/100
GameServerManagers/LinuxGSM#5185 ·
维护者通常 1 天内回复
-
bug(ins): server fails to start, srcds_run has CRLF line endings and needs bash可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭distro: Ubuntu engine: source game: Insurgency status: fixed in develop
难度 2/5 1-3 小时 新手友好度 72/100
GameServerManagers/LinuxGSM#5153 ·
维护者通常 1 天内回复
-
[Bug]: cs2server ignores the GSLT entered during install可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭command: install command: start distro: Debian engine: source2 game: Counter-Strike 2 regression: yes reproducible: always severity: high type: bug
难度 2/5 1-3 小时 新手友好度 82/100
GameServerManagers/LinuxGSM#5106 ·
维护者通常 1 天内回复
-
[Bug]: A failed command exits with 0 when core_exit.sh is downloaded on exit可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭command: start distro: Debian engine: null game: Teamspeak 3 info: tmux reproducible: always severity: low status: fixed in develop type: bug
难度 3/5 1-2 天 新手友好度 35/100
GameServerManagers/LinuxGSM#5191 ·
维护者通常 1 天内回复
查看 GameServerManagers/LinuxGSM 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
conda-forge/poppler-feedstock#198 ·
-
package-update
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
Isha Narula未关闭
难度 1/5 1 小时以内 新手友好度 72/100
dataplat/DataSpeakers#178 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
btclib-org/claude-process#341 ·