[GH-ISSUE #4624] [Bug]: Bug in gamedig library, causing health check to fail #2877

Closed
opened 2026-02-27 03:05:58 +03:00 by kerem · 6 comments
Owner

Originally created by @FingerlessGlov3s on GitHub (Aug 10, 2024).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4624

User story

Creating new docker container with latest image

Game

7 Dyas to Die

Linux distro

Debian 12

Command

command: monitor

Further information

When the monitor is running, it errors checking the ports because of a module within the farmingsimulator gamedig package code.
As it errors, it keeps restarting the sdtd server.

Relevant log output

root@d52ea70abad0:/app# ./entrypoint-healthcheck.sh
[  OK  ] Monitoring sdtdserver: Checking session: OK
[ .... ] Monitoring sdtdserver: Querying port: gamedig: 127.0.0.1:26900 : 0/1: QUERYINGfile:///app/lgsm/node_modules/gamedig/protocols/farmingsimulator.js:2
import cheerio from 'cheerio'
       ^^^^^^^
SyntaxError: The requested module 'cheerio' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Node.js v20.16.0
[ .... ] Monitoring sdtdserver: Querying port: gamedig: 172.16.0.129:26900 : 0/1: QUERYINGfile:///app/lgsm/node_modules/gamedig/protocols/farmingsimulator.js:2
import cheerio from 'cheerio'
       ^^^^^^^
SyntaxError: The requested module 'cheerio' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Node.js v20.16.0
[ .... ] Monitoring sdtdserver: Querying port: gamedig: 78.157.222.153:26900 : 0/1: QUERYINGfile:///app/lgsm/node_modules/gamedig/protocols/farmingsimulator.js:2
import cheerio from 'cheerio'
       ^^^^^^^
SyntaxError: The requested module 'cheerio' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Steps to reproduce

Setup sdtd container using the sdtd docker compose example file. Server won't stay started and reboots.

To fix, you can manually change the import line

import cheerio from 'cheerio'

to

import * as cheerio from 'cheerio'

As per readme on the cheerio package.
https://www.npmjs.com/package/cheerio

Originally created by @FingerlessGlov3s on GitHub (Aug 10, 2024). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4624 ### User story Creating new docker container with latest image ### Game 7 Dyas to Die ### Linux distro Debian 12 ### Command command: monitor ### Further information When the monitor is running, it errors checking the ports because of a module within the farmingsimulator gamedig package code. As it errors, it keeps restarting the sdtd server. ### Relevant log output ```shell root@d52ea70abad0:/app# ./entrypoint-healthcheck.sh [ OK ] Monitoring sdtdserver: Checking session: OK [ .... ] Monitoring sdtdserver: Querying port: gamedig: 127.0.0.1:26900 : 0/1: QUERYINGfile:///app/lgsm/node_modules/gamedig/protocols/farmingsimulator.js:2 import cheerio from 'cheerio' ^^^^^^^ SyntaxError: The requested module 'cheerio' does not provide an export named 'default' at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21) at async ModuleJob.run (node:internal/modules/esm/module_job:217:5) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) Node.js v20.16.0 [ .... ] Monitoring sdtdserver: Querying port: gamedig: 172.16.0.129:26900 : 0/1: QUERYINGfile:///app/lgsm/node_modules/gamedig/protocols/farmingsimulator.js:2 import cheerio from 'cheerio' ^^^^^^^ SyntaxError: The requested module 'cheerio' does not provide an export named 'default' at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21) at async ModuleJob.run (node:internal/modules/esm/module_job:217:5) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) Node.js v20.16.0 [ .... ] Monitoring sdtdserver: Querying port: gamedig: 78.157.222.153:26900 : 0/1: QUERYINGfile:///app/lgsm/node_modules/gamedig/protocols/farmingsimulator.js:2 import cheerio from 'cheerio' ^^^^^^^ SyntaxError: The requested module 'cheerio' does not provide an export named 'default' at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21) at async ModuleJob.run (node:internal/modules/esm/module_job:217:5) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) ``` ### Steps to reproduce Setup sdtd container using the sdtd docker compose example file. Server won't stay started and reboots. To fix, you can manually change the import line ``` import cheerio from 'cheerio' ``` to ``` import * as cheerio from 'cheerio' ``` As per readme on the cheerio package. https://www.npmjs.com/package/cheerio
Author
Owner

@FingerlessGlov3s commented on GitHub (Aug 10, 2024):

Hopefully this will get fixed upstream soon https://github.com/gamedig/node-gamedig/pull/602

<!-- gh-comment-id:2282270521 --> @FingerlessGlov3s commented on GitHub (Aug 10, 2024): Hopefully this will get fixed upstream soon https://github.com/gamedig/node-gamedig/pull/602
Author
Owner

@irobot73 commented on GitHub (Aug 11, 2024):

Good catch. Modifying that './lgsm/node_modules/gamedig/protocols/farmingsimulator.js', while the server was down, finally allowed the server to stay up when started. I'll allow the LGSM UPDATE via CRONTAB to execute again once this gets some coding love.

<!-- gh-comment-id:2282398038 --> @irobot73 commented on GitHub (Aug 11, 2024): Good catch. Modifying that './lgsm/node_modules/gamedig/protocols/farmingsimulator.js', while the server was down, finally allowed the server to stay up when started. I'll allow the LGSM UPDATE via CRONTAB to execute again once this gets some coding love.
Author
Owner

@CosminPerRam commented on GitHub (Aug 11, 2024):

Hey, I'm the GameDig maintainer, 5.1.1 and 4.3.2 are released with the fixes.

<!-- gh-comment-id:2282739749 --> @CosminPerRam commented on GitHub (Aug 11, 2024): Hey, I'm the GameDig maintainer, `5.1.1` and `4.3.2` are released with the fixes.
Author
Owner

@dgibbs64 commented on GitHub (Aug 11, 2024):

I will update the version of LInuxGSM and release a hotfix

<!-- gh-comment-id:2282830490 --> @dgibbs64 commented on GitHub (Aug 11, 2024): I will update the version of LInuxGSM and release a hotfix
Author
Owner

@h3o66 commented on GitHub (Sep 29, 2024):

this should have been fixed with 24.2.2
please reopen if that is not the case.

<!-- gh-comment-id:2381383997 --> @h3o66 commented on GitHub (Sep 29, 2024): this should have been fixed with 24.2.2 please reopen if that is not the case.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 6, 2025):

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:3369537952 --> @github-actions[bot] commented on GitHub (Oct 6, 2025): 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#2877
No description provided.