[GH-ISSUE #3006] jq: error (at <stdin>:0): Cannot iterate over null (null) #2142

Closed
opened 2026-02-27 03:01:07 +03:00 by kerem · 11 comments
Owner

Originally created by @Tiscan on GitHub (Aug 23, 2020).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/3006

User Story

When running ./sdtdserver I get the error messages:

jq: error (at :0): Cannot iterate over null (null)
jq: error (at :0): Cannot iterate over null (null)

Before the command executes.

Also the ./sdtserver monitor command fails as the port gets listed as 2690026900269052701527020 even though the port is configured and running as 26900.

I searched the jq error here and found one reference from a but it just said that it was set to be fixed many versions back. Also found a reference to the port issue but there was no resolution on that one.

Basic info

  • Distro: Ubuntu 20.04.1 LTS
  • Game: 7 Days to Die (A19)
  • Command: [Any] & [Monitor]
  • LinuxGSM version: v20.4.1

Further Information

Completely fresh OS & LGSM install as of a couple of days ago.

To Reproduce

Run any ./sdtdserver , monitor command errors via ./sdtdserver monitor

Expected behaviour

Successful execution of command without errors, monitor option detecting correct port.

I am attaching the results of a details command below as you can see both the jq error and the port incorrect. Happy to provide other logs / etc if someone can point me to what they need.

sdtd@jinnix:~$ ./sdtdserver details
jq: error (at <stdin>:0): Cannot iterate over null (null)
jq: error (at <stdin>:0): Cannot iterate over null (null)

Distro Details
=================================
Distro:    Ubuntu 20.04.1 LTS
Arch:      x86_64
Kernel:    5.4.0-42-generic
Hostname:  jinnix
Uptime:    1d, 2h, 12m
tmux:      tmux 3.0a
glibc:     2.31

Server Resource
=================================
CPU
Model:      Intel(R) Xeon(R) CPU           L5640  @ 2.27GHz
Cores:      24
Frequency:  1596.243MHz
Avg Load:   0.14, 0.19, 0.13

Memory
Mem:       total  used   free   cached  available
Physical:  71GB   3.1GB  68GB   11GB    68GB
Swap:      8.0GB  0B     8.0GB

Storage
Filesystem:  /dev/sdb
Total:       11T
Used:        23G
Available:   7.3T

Network
Interface:    eno1
Link Speed:   1000Mb/s
IP:           [REMOVED]
Internet IP:  [REMOVED]

Game Server Resource Usage
=================================
CPU Used:  48.5%
Mem Used:  3.5%   2588MB

Storage
Total:        9.7G
Serverfiles:  9.4G

7 Days To Die Server Details
=================================
Server name:      [REMOVED]
App ID:           294420
Server IP:        [REMOVED]:2690026900269052701527020
Internet IP:      [REMOVED]:2690026900269052701527020
Server password:  [REMOVED]
Maxplayers:       20
Game mode:        GameModeSurvival
Game world:       East Soasa County
Master server:    false
Status:           ONLINE

sdtdserver Script Details
=================================
Script name:            sdtdserver
LinuxGSM version:       v20.4.1
glibc required:         2.15
Discord alert:          off
Slack alert:            off
Email alert:            off
Pushbullet alert:       off
IFTTT alert:            off
Mailgun (email) alert:  off
Pushover alert:         off
Telegram alert:         off
Update on start:        off
User:                   sdtd
Location:               /data/sdtd
Config file:            /data/sdtd/serverfiles/sdtdserver.xml

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

Command-line Parameters
=================================
./7DaysToDieServer.x86_64 -logfile /data/sdtd/log/server/output_log__2020-08-21__00-21-25.txt -quit -batchmode -nographics -dedicated -configfile=/data/sdtd/serverfiles/sdtdserver.xml

Ports
=================================
Change ports by editing the parameters in:
/data/sdtd/serverfiles/sdtdserver.xml

Useful port diagnostic command:
netstat -atunp | grep 7DaysToDie

DESCRIPTION  DIRECTION  PORT                       PROTOCOL
> Game/RCON  INBOUND    2690026900269052701527020  udp
> Query      INBOUND    2690026900269052701527020  udp
> WebAdmin   INBOUND    8080                       tcp
> Telnet     INBOUND    8081                       tcp

[REMOVED] WebAdmin
=================================
WebAdmin enabled:   false
WebAdmin url:       [REMOVED]
WebAdmin password:  [REMOVED]

[REMOVED] Telnet
=================================
Telnet enabled:   true
Telnet address:   [REMOVED]
Telnet password:  [REMOVED]

Status: ONLINE
Originally created by @Tiscan on GitHub (Aug 23, 2020). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/3006 ## User Story When running ./sdtdserver <command> I get the error messages: jq: error (at <stdin>:0): Cannot iterate over null (null) jq: error (at <stdin>:0): Cannot iterate over null (null) Before the command executes. Also the ./sdtserver monitor command fails as the port gets listed as 2690026900269052701527020 even though the port is configured and running as 26900. I searched the jq error here and found one reference from a but it just said that it was set to be fixed many versions back. Also found a reference to the port issue but there was no resolution on that one. ## Basic info * **Distro:** Ubuntu 20.04.1 LTS * **Game:** 7 Days to Die (A19) * **Command:** [Any] & [Monitor] * **LinuxGSM version:** v20.4.1 ## Further Information Completely fresh OS & LGSM install as of a couple of days ago. ## To Reproduce Run any ./sdtdserver <command>, monitor command errors via ./sdtdserver monitor ## Expected behaviour Successful execution of command without errors, monitor option detecting correct port. I am attaching the results of a details command below as you can see both the jq error and the port incorrect. Happy to provide other logs / etc if someone can point me to what they need. ``` sdtd@jinnix:~$ ./sdtdserver details jq: error (at <stdin>:0): Cannot iterate over null (null) jq: error (at <stdin>:0): Cannot iterate over null (null) Distro Details ================================= Distro: Ubuntu 20.04.1 LTS Arch: x86_64 Kernel: 5.4.0-42-generic Hostname: jinnix Uptime: 1d, 2h, 12m tmux: tmux 3.0a glibc: 2.31 Server Resource ================================= CPU Model: Intel(R) Xeon(R) CPU L5640 @ 2.27GHz Cores: 24 Frequency: 1596.243MHz Avg Load: 0.14, 0.19, 0.13 Memory Mem: total used free cached available Physical: 71GB 3.1GB 68GB 11GB 68GB Swap: 8.0GB 0B 8.0GB Storage Filesystem: /dev/sdb Total: 11T Used: 23G Available: 7.3T Network Interface: eno1 Link Speed: 1000Mb/s IP: [REMOVED] Internet IP: [REMOVED] Game Server Resource Usage ================================= CPU Used: 48.5% Mem Used: 3.5% 2588MB Storage Total: 9.7G Serverfiles: 9.4G 7 Days To Die Server Details ================================= Server name: [REMOVED] App ID: 294420 Server IP: [REMOVED]:2690026900269052701527020 Internet IP: [REMOVED]:2690026900269052701527020 Server password: [REMOVED] Maxplayers: 20 Game mode: GameModeSurvival Game world: East Soasa County Master server: false Status: ONLINE sdtdserver Script Details ================================= Script name: sdtdserver LinuxGSM version: v20.4.1 glibc required: 2.15 Discord alert: off Slack alert: off Email alert: off Pushbullet alert: off IFTTT alert: off Mailgun (email) alert: off Pushover alert: off Telegram alert: off Update on start: off User: sdtd Location: /data/sdtd Config file: /data/sdtd/serverfiles/sdtdserver.xml Backups ================================= No Backups created Command-line Parameters ================================= ./7DaysToDieServer.x86_64 -logfile /data/sdtd/log/server/output_log__2020-08-21__00-21-25.txt -quit -batchmode -nographics -dedicated -configfile=/data/sdtd/serverfiles/sdtdserver.xml Ports ================================= Change ports by editing the parameters in: /data/sdtd/serverfiles/sdtdserver.xml Useful port diagnostic command: netstat -atunp | grep 7DaysToDie DESCRIPTION DIRECTION PORT PROTOCOL > Game/RCON INBOUND 2690026900269052701527020 udp > Query INBOUND 2690026900269052701527020 udp > WebAdmin INBOUND 8080 tcp > Telnet INBOUND 8081 tcp [REMOVED] WebAdmin ================================= WebAdmin enabled: false WebAdmin url: [REMOVED] WebAdmin password: [REMOVED] [REMOVED] Telnet ================================= Telnet enabled: true Telnet address: [REMOVED] Telnet password: [REMOVED] Status: ONLINE ```
kerem 2026-02-27 03:01:07 +03:00
Author
Owner

@issue-label-bot[bot] commented on GitHub (Aug 23, 2020):

Issue-Label Bot is automatically applying the label type: bug to this issue, with a confidence of 0.95. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

<!-- gh-comment-id:678822247 --> @issue-label-bot[bot] commented on GitHub (Aug 23, 2020): Issue-Label Bot is automatically applying the label `type: bug` to this issue, with a confidence of 0.95. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback! Links: [app homepage](https://github.com/marketplace/issue-label-bot), [dashboard](https://mlbot.net/data/GameServerManagers/LinuxGSM) and [code](https://github.com/hamelsmu/MLapp) for this bot.
Author
Owner

@sapphirecz commented on GitHub (Aug 25, 2020):

I have the same issue with sdtdserver release A19 on Fedora. sdtdserver with the same version of LGSM but release A18.4 (installation was moved from CentOS few weeks ago) is on Fedora without this issue. I probably could test it on CentOS if necessary.

Here is postdetails pastebin https://termbin.com/iaug3

<!-- gh-comment-id:680113900 --> @sapphirecz commented on GitHub (Aug 25, 2020): I have the same issue with sdtdserver release A19 on Fedora. sdtdserver with the same version of LGSM but release A18.4 (installation was moved from CentOS few weeks ago) is on Fedora without this issue. I probably could test it on CentOS if necessary. Here is postdetails pastebin https://termbin.com/iaug3
Author
Owner

@pschiffe commented on GitHub (Aug 25, 2020):

Hello, I think I found the issue. There are numbers in the comment on the same line as the port number, see here:

$ grep ServerPort /home/sdtdhost2/serverfiles/sdtdserver.xml
<property name="ServerPort"					value="26900"/>			<!-- Port you want the server to listen on. Keep it in the ranges 26900 to 26905 or 27015 to 27020 if you want PCs on the same LAN to find it as a LAN server. -->

$ grep ServerPort /home/sdtdhost2/serverfiles/sdtdserver.xml | tr -cd '[:digit:]'
2690026900269052701527020

github.com/GameServerManagers/LinuxGSM@7e3df5d434/lgsm/functions/info_config.sh (L125)

<!-- gh-comment-id:680191645 --> @pschiffe commented on GitHub (Aug 25, 2020): Hello, I think I found the issue. There are numbers in the comment on the same line as the port number, see here: ``` $ grep ServerPort /home/sdtdhost2/serverfiles/sdtdserver.xml <property name="ServerPort" value="26900"/> <!-- Port you want the server to listen on. Keep it in the ranges 26900 to 26905 or 27015 to 27020 if you want PCs on the same LAN to find it as a LAN server. --> $ grep ServerPort /home/sdtdhost2/serverfiles/sdtdserver.xml | tr -cd '[:digit:]' 2690026900269052701527020 ``` https://github.com/GameServerManagers/LinuxGSM/blob/7e3df5d43479d3cc9f053688386d8ff8a92c8f80/lgsm/functions/info_config.sh#L125
Author
Owner

@pschiffe commented on GitHub (Aug 25, 2020):

Sorry, wrong line, sdtd is here github.com/GameServerManagers/LinuxGSM@7e3df5d434/lgsm/functions/info_config.sh (L1213)

<!-- gh-comment-id:680192754 --> @pschiffe commented on GitHub (Aug 25, 2020): Sorry, wrong line, sdtd is here https://github.com/GameServerManagers/LinuxGSM/blob/7e3df5d43479d3cc9f053688386d8ff8a92c8f80/lgsm/functions/info_config.sh#L1213
Author
Owner

@Tiscan commented on GitHub (Aug 25, 2020):

Can confirm this is the issue.

I moved the comment to a line on it's own in sdtdserver.xml and neither error occurs anymore.

<!-- gh-comment-id:680246634 --> @Tiscan commented on GitHub (Aug 25, 2020): Can confirm this is the issue. I moved the comment to a line on it's own in sdtdserver.xml and neither error occurs anymore.
Author
Owner

@pschiffe commented on GitHub (Aug 26, 2020):

The solution to this problem could be parsing xml files properly. There is an xmlstarlet package available in centos, fedora, debian and ubuntu (these I checked, it's probably elsewhere too), which can be used to extract xml values. For example in this case it looks like this:

$ grep ServerPort /home/sdtdhost2/serverfiles/sdtdserver.xml
	<property name="ServerPort"					value="26900"/>
$ xmlstarlet sel -t -v '//property[@name="ServerPort"]/@value' /home/sdtdhost2/serverfiles/sdtdserver.xml
26900

The selector there says: give me @value attribute of property with attribute @name == "ServerPort".

<!-- gh-comment-id:680838440 --> @pschiffe commented on GitHub (Aug 26, 2020): The solution to this problem could be parsing xml files properly. There is an [xmlstarlet](http://xmlstar.sourceforge.net/) package available in centos, fedora, debian and ubuntu (these I checked, it's probably elsewhere too), which can be used to extract xml values. For example in this case it looks like this: ``` $ grep ServerPort /home/sdtdhost2/serverfiles/sdtdserver.xml <property name="ServerPort" value="26900"/> $ xmlstarlet sel -t -v '//property[@name="ServerPort"]/@value' /home/sdtdhost2/serverfiles/sdtdserver.xml 26900 ``` The selector there says: give me `@value` attribute of `property` with attribute `@name == "ServerPort"`.
Author
Owner

@Tiscan commented on GitHub (Aug 26, 2020):

Also confirmed that xmlstarlet works on my install. However this would add a new dependency to LGSM.

Seems like a good path though as there will bound to be additional instances where digits are outside of the actual XML attribute.

sdtd@jinnix:~$ xmlstarlet sel -t -v '//property[@name="ServerPort"]/@value' sdtdserver.xml
26900
<!-- gh-comment-id:680931491 --> @Tiscan commented on GitHub (Aug 26, 2020): Also confirmed that xmlstarlet works on my install. However this would add a new dependency to LGSM. Seems like a good path though as there will bound to be additional instances where digits are outside of the actual XML attribute. ``` sdtd@jinnix:~$ xmlstarlet sel -t -v '//property[@name="ServerPort"]/@value' sdtdserver.xml 26900 ```
Author
Owner

@h3o66 commented on GitHub (Aug 26, 2020):

Alternative:
put a egrep for the value in the original command:

port=$(grep "ServerPort" "${servercfgfullpath}" | egrep -o 'value="([0-9+])"' | tr -cd '[:digit:]')

The problem with a new dependency is here that only a few gameserver will need this.

<!-- gh-comment-id:680947425 --> @h3o66 commented on GitHub (Aug 26, 2020): Alternative: put a egrep for the value in the original command: ``` port=$(grep "ServerPort" "${servercfgfullpath}" | egrep -o 'value="([0-9+])"' | tr -cd '[:digit:]') ``` The problem with a new dependency is here that only a few gameserver will need this.
Author
Owner

@dgibbs64 commented on GitHub (Aug 26, 2020):

@h3o66 this would be the best solution to avoid another dependency. If you are happy too could you do a PR and I will merge

<!-- gh-comment-id:680957036 --> @dgibbs64 commented on GitHub (Aug 26, 2020): @h3o66 this would be the best solution to avoid another dependency. If you are happy too could you do a PR and I will merge
Author
Owner

@h3o66 commented on GitHub (Aug 26, 2020):

@h3o66 this would be the best solution to avoid another dependency. If you are happy too could you do a PR and I will merge

done - see the connected pr

<!-- gh-comment-id:680966542 --> @h3o66 commented on GitHub (Aug 26, 2020): > @h3o66 this would be the best solution to avoid another dependency. If you are happy too could you do a PR and I will merge done - see the connected pr
Author
Owner

@github-actions[bot] commented on GitHub (Sep 21, 2021):

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:923446232 --> @github-actions[bot] commented on GitHub (Sep 21, 2021): This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
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#2142
No description provided.