GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.28k stars 817 forks source link

Monitor command incorrectly detects server as offline #2977

Closed niekcandaele closed 4 years ago

niekcandaele commented 4 years ago

User Story

As a user, I want the monitor command to not restart my server when it is already online

Basic info

Further Information

Set up a cronjob to run monitor, it always restarts the server even though it's online and I can connect to it. In the logs I see this:

Jul 20 21:35:05.414 sdtdserver: MONITOR: INFO: Querying port: gsquery: x.x.x.x:2690026900269052701527020 : 1 : QUERYING

Those ports are pretty much all the ports used by the server, all put together. This makes the query fail

To Reproduce

Steps to reproduce the behavior:

  1. Start server
  2. Wait for it to be online
  3. Monitor command
  4. Monitor command restarts server

Expected behavior

Monitor command does not restart the server when it is online

issue-label-bot[bot] commented 4 years ago

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

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

dgibbs64 commented 4 years ago

You don't need to change the query port and putting all the ports together is not how it works

niekcandaele commented 4 years ago

Yes, I am quite aware that putting ports together like that doesn't work, but that is the behavior of LGSM for me.

Correct me if I am wrong, but LGSM will parse the config file of the server (serverconfig.xml in the case of 7D2D) to get ports right? The config file is filled correctly (can connect to the server via the game, can connect to telnet, can connect to web API) but LGSM detects the ports wrong.

catalysm@7D2D-Dev:~$ netstat -atunp | grep 7DaysToDie
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8081          0.0.0.0:*               LISTEN      7401/./7DaysToDieSe 
tcp        0      0 0.0.0.0:8082            0.0.0.0:*               LISTEN      7401/./7DaysToDieSe 
tcp        0      0 0.0.0.0:8083            0.0.0.0:*               LISTEN      7401/./7DaysToDieSe 
tcp        0      0 0.0.0.0:26900           0.0.0.0:*               LISTEN      7401/./7DaysToDieSe 
tcp        0      0 x.x.x.x:37470     x.x.x.x:443        ESTABLISHED 7401/./7DaysToDieSe 
tcp       32      0 x.x.x.x:35814     x.x.x.x:443      CLOSE_WAIT  7401/./7DaysToDieSe 
tcp        0      0 x.x.x.x:38009     x.x.x.x:27038   ESTABLISHED 7401/./7DaysToDieSe 
udp        0      0 0.0.0.0:26900           0.0.0.0:*                           7401/./7DaysToDieSe 
udp        0      0 0.0.0.0:26902           0.0.0.0:*                           7401/./7DaysToDieSe 
udp6       0      0 :::26902                :::*                                7401/./7DaysToDieSe 

Worth noting I am running the latest_experimental branch of 7 Days to Die.

See the output of the details command where LGSM also detects the ports incorrectly.

catalysm@7D2D-Dev:~$ ./sdtdserver details

Distro Details
=================================
Distro:    Debian GNU/Linux 10 (buster)
Arch:      x86_64
Kernel:    4.19.0-6-amd64
Hostname:  7D2D-Dev
Uptime:    56d, 22h, 28m
tmux:      tmux 2.8
glibc:     2.28

Server Resource
=================================
CPU         
Model:      Intel Xeon Processor (Skylake, IBRS)
Cores:      2
Frequency:  2100.000MHz
Avg Load:   0,23, 0,23, 0,26

Memory     
Mem:       total  used   free   cached  available
Physical:  7,7GB  2,4GB  5,0GB  4,5GB   5,0GB
Swap:      0B     0B     0B

Storage
Filesystem:  /dev/sda1
Total:       76G
Used:        30G
Available:   43G

Network
Interface:  eth0
IP:         x.x.x.x

Game Server Resource Usage
=================================
CPU Used:  21%
Mem Used:  24.1%  1878MB

Storage
Total:        26G
Serverfiles:  14G
Backups:      148K

7 Days To Die Server Details
=================================
Server name:      CSMM Dev
App ID:           294420
Branch:           latest_experimental
Server IP:        x.x.x.x:2690026900269052701527020
Server password:  xxx
Maxplayers:       8
Game mode:        GameModeSurvival
Game world:       Navezgane
Master server:    false
Status:           ONLINE

sdtdserver Script Details
=================================
Script name:            sdtdserver
LinuxGSM version:       v20.4.0
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:                   catalysm
Location:               /home/catalysm
Config file:            /home/catalysm/serverfiles/serverconfig.xml

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

Command-line Parameters
=================================
./7DaysToDieServer.x86_64 -logfile /home/catalysm/log/server/output_log__2020-07-22__12-45-11.txt -quit -batchmode -nographics -dedicated -configfile=/home/catalysm/serverfiles/serverconfig.xml

Ports
=================================
Change ports by editing the parameters in:
/home/catalysm/serverfiles/serverconfig.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

CSMM Dev WebAdmin
=================================
WebAdmin enabled:   false
WebAdmin url:       http://x.x.x.x:8080
WebAdmin password:  CHANGEME

CSMM Dev Telnet
=================================
Telnet enabled:   true
Telnet address:   x.x.x.x 8081
Telnet password:  NOT SET

Status: ONLINE
Grimston commented 4 years ago

I was unable to replicate the issue, please check the configuration files.

7 Days To Die Server Details
=================================
Server name:      TESTING
App ID:           294420
Branch:           latest_experimental
Server IP:        ***.***.***.***:26900
Server password:  NOT SET
Maxplayers:       32
Game mode:        GameModeSurvival
Game world:       Navezgane
Master server:    false
Status:           OFFLINE

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:                   sdtdserver
Location:               /home/sdtdserver
Config file:            /home/sdtdserver/serverfiles/sdtdserver.xml

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

Command-line Parameters
=================================
./7DaysToDieServer.x86_64 -logfile /home/sdtdserver/log/server/output_log__2020-07-22__21-22-47.txt -quit -batchmode -nographics -dedicated -configfile=/home/sdtdserver/serverfiles/sdtdserver.xml

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

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

DESCRIPTION  DIRECTION  PORT   PROTOCOL
> Game/RCON  INBOUND    26900  udp
> Query      INBOUND    26900  udp
> WebAdmin   INBOUND    8080   tcp
> Telnet     INBOUND    8081   tcp
niekcandaele commented 4 years ago

Any ones in particular? I left most of it on default afaik

Here are the relevant config files I think, let me know if you need to see any other files

catalysm@7D2D-Dev:~$ cat serverfiles/serverconfig.xml
<?xml version="1.0"?>
<ServerSettings>
    <!-- GENERAL SERVER SETTINGS -->

    <!-- Server representation -->
    <property name="ServerName"                     value="CSMM Dev"/>      <!-- Whatever you want the name of the server to be. -->
    <property name="ServerDescription"              value="A 7 Days to Die server"/>    <!-- Whatever you want the server description to be, will be shown in the server browser. -->
    <property name="ServerWebsiteURL"               value=""/>                  <!-- Website URL for the server, will be shown in the serverbrowser as a clickable link -->
    <property name="ServerPassword"                 value="xxx"/>                   <!-- Password to gain entry to the server -->
    <property name="ServerLoginConfirmationText"    value="" />                 <!-- If set the user will see the message during joining the server and has to confirm it before continuing. For more complex changes to this window you can change the "serverjoinrulesdialog" window in XUi -->

    <!-- Networking -->
    <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. -->
    <property name="ServerVisibility"               value="2"/>                 <!-- Visibility of this server: 2 = public, 1 = only shown to friends, 0 = not listed. As you are never friend of a dedicated server setting this to "1" will only work when the first player connects manually by IP. -->
    <property name="ServerDisabledNetworkProtocols" value="SteamNetworking"/>   <!-- Networking protocols that should not be used. Separated by comma. Possible values: LiteNetLib, SteamNetworking. Dedicated servers should disable SteamNetworking if there is no NAT router in between your users and the server or when port-forwarding is set up correctly -->
    <property name="ServerMaxWorldTransferSpeedKiBs" value="512"/>              <!-- Maximum (!) speed in kiB/s the world is transferred at to a client on first connect if it does not have the world yet. Maximum is about 1300 kiB/s, even if you set a higher value. -->

    <!-- Slots -->
    <property name="ServerMaxPlayerCount"           value="8"/>                 <!-- Maximum Concurrent Players -->
    <property name="ServerReservedSlots"            value="0"/>                 <!-- Out of the MaxPlayerCount this many slots can only be used by players with a specific permission level -->
    <property name="ServerReservedSlotsPermission"  value="100"/>               <!-- Required permission level to use reserved slots above -->
    <property name="ServerAdminSlots"               value="0"/>                 <!-- This many admins can still join even if the server has reached MaxPlayerCount -->
    <property name="ServerAdminSlotsPermission"     value="0"/>                 <!-- Required permission level to use the admin slots above -->

    <!-- Admin interfaces -->
    <property name="ControlPanelEnabled"            value="false"/>             <!-- Enable/Disable the web control panel -->
    <property name="ControlPanelPort"               value="8080"/>              <!-- Port of the control panel webpage -->
    <property name="ControlPanelPassword"           value="CHANGEME"/>          <!-- Password to gain entry to the control panel -->

    <property name="TelnetEnabled"                  value="true"/>              <!-- Enable/Disable the telnet -->
    <property name="TelnetPort"                     value="8081"/>              <!-- Port of the telnet server -->
    <property name="TelnetPassword"                 value=""/>                  <!-- Password to gain entry to telnet interface. If no password is set the server will only listen on the local loopback interface -->
    <property name="TelnetFailedLoginLimit"         value="10"/>                <!-- After this many wrong passwords from a single remote client the client will be blocked from connecting to the Telnet interface -->
    <property name="TelnetFailedLoginsBlocktime"    value="10"/>                <!-- How long will the block persist (in seconds) -->

    <property name="TerminalWindowEnabled"          value="true"/>              <!-- Show a terminal window for log output / command input (Windows only) -->

    <!-- Folder and file locations -->
    <property name="AdminFileName"                  value="serveradmin.xml"/>   <!-- Server admin file name. Path relative to the SaveGameFolder -->
    <!-- <property name="UserDataFolder"                value="absolute path" /> -->    <!-- Use this to override where the server stores all generated data, including RWG generated worlds. Do not forget to uncomment the entry! -->
    <!-- <property name="SaveGameFolder"                value="absolute path" /> -->    <!-- Use this to only override the save game path. Do not forget to uncomment the entry! -->

    <!-- Other technical settings -->
    <property name="EACEnabled"                     value="true"/>              <!-- Enables/Disables EasyAntiCheat -->
    <property name="HideCommandExecutionLog"        value="0"/>                 <!-- Hide logging of command execution. 0 = show everything, 1 = hide only from Telnet/ControlPanel, 2 = also hide from remote game clients, 3 = hide everything -->
    <property name="MaxUncoveredMapChunksPerPlayer" value="131072"/>            <!-- Override how many chunks can be uncovered on the ingame map by each player. Resulting max map file size limit per player is (x * 512 Bytes), uncovered area is (x * 256 m²). Default 131072 means max 32 km² can be uncovered at any time -->
    <property name="PersistentPlayerProfiles"       value="false" />            <!-- If disabled a player can join with any selected profile. If true they will join with the last profile they joined with -->

    <!-- GAMEPLAY -->

    <!-- World -->
    <property name="GameWorld"                      value="Navezgane"/>         <!-- "RWG" (see WorldGenSeed and WorldGenSize options below) or any already existing world name in the Worlds folder (currently shipping with e.g. "Navezgane", "PREGEN01", ...) -->
    <property name="WorldGenSeed"                   value="asdf"/>              <!-- If RWG this is the seed for the generation of the new world. If a world with the resulting name already exists it will simply load it -->
    <property name="WorldGenSize"                   value="4096"/>              <!-- If RWG this controls the width and height of the created world. It is also used in combination with WorldGenSeed to create the internal RWG seed thus also creating a unique map name even if using the same WorldGenSeed. Has to be between 2048 and 16384, though large map sizes will take long to generate / download / load -->
    <property name="GameName"                       value="My Game"/>           <!-- Whatever you want the game name to be. This affects the save game name as well as the seed used when placing decoration (trees etc) in the world. It does not control the generic layout of the world if creating an RWG world -->
    <property name="GameMode"                       value="GameModeSurvival"/>  <!-- GameModeSurvival -->

    <!-- Difficulty -->
    <property name="GameDifficulty"                 value="2"/>                 <!-- 0 - 5, 0=easiest, 5=hardest -->
    <property name="BlockDamagePlayer"              value="100" />              <!-- How much damage do players to blocks (percentage in whole numbers) -->
    <property name="BlockDamageAI"                  value="100" />              <!-- How much damage do AIs to blocks (percentage in whole numbers) -->
    <property name="BlockDamageAIBM"                value="100" />              <!-- How much damage do AIs during blood moons to blocks (percentage in whole numbers) -->
    <property name="XPMultiplier"                   value="100" />              <!-- XP gain multiplier (percentage in whole numbers) -->
    <property name="PlayerSafeZoneLevel"            value="5" />                <!-- If a player is less or equal this level he will create a safe zone (no enemies) when spawned -->
    <property name="PlayerSafeZoneHours"            value="5" />                <!-- Hours in world time this safe zone exists -->

    <!--  -->
    <property name="BuildCreate"                    value="false" />            <!-- cheat mode on/off -->
    <property name="DayNightLength"                 value="60" />               <!-- real time minutes per in game day: 60 minutes -->
    <property name="DayLightLength"                 value="18" />               <!-- in game hours the sun shines per day: 18 hours day light per in game day -->
    <property name="DropOnDeath"                    value="1" />                <!-- 0 = nothing, 1 = everything, 2 = toolbelt only, 3 = backpack only, 4 = delete all -->
    <property name="DropOnQuit"                     value="0" />                <!-- 0 = nothing, 1 = everything, 2 = toolbelt only, 3 = backpack only -->
    <property name="BedrollDeadZoneSize"            value="15" />               <!-- Size (box "radius", so a box with 2 times the given value for each side's length) of bedroll deadzone, no zombies will spawn inside this area, and any cleared sleeper volumes that touch a bedroll deadzone will not spawn after they've been cleared. -->
    <property name="BedrollExpiryTime"              value="45" />               <!-- Number of days a bedroll stays active after owner was last online -->

    <!-- Performance related -->
    <property name="MaxSpawnedZombies"              value="64" />               <!-- This setting covers the entire map. There can only be this many zombies on the entire map at one time. Changing this setting has a huge impact on performance. -->
    <property name="MaxSpawnedAnimals"              value="50" />               <!-- If your server has a large number of players you can increase this limit to add more wildlife. Animals don't consume as much CPU as zombies. NOTE: That this doesn't cause more animals to spawn arbitrarily: The biome spawning system only spawns a certain number of animals in a given area, but if you have lots of players that are all spread out then you may be hitting the limit and can increase it. -->
    <property name="ServerMaxAllowedViewDistance"   value="12" />               <!-- Max viewdistance a client may request (6 - 12). High impact on memory usage and performance. -->

    <!-- Zombie settings -->
    <property name="EnemySpawnMode"                 value="true" />             <!-- Enable/Disable enemy spawning -->
    <property name="EnemyDifficulty"                value="0" />                <!-- 0 = Normal, 1 = Feral -->
    <property name="ZombieMove"                     value="0" />                <!-- 0-4 (walk, jog, run, sprint, nightmare) -->
    <property name="ZombieMoveNight"                value="3" />                <!-- 0-4 (walk, jog, run, sprint, nightmare) -->
    <property name="ZombieFeralMove"                value="3" />                <!-- 0-4 (walk, jog, run, sprint, nightmare) -->
    <property name="ZombieBMMove"                   value="3" />                <!-- 0-4 (walk, jog, run, sprint, nightmare) -->
    <property name="BloodMoonFrequency"             value="7" />                <!-- What frequency (in days) should a blood moon take place. Set to "0" for no blood moons -->
    <property name="BloodMoonRange"                 value="0" />                <!-- How many days can the actual blood moon day randomly deviate from the above setting. Setting this to 0 makes blood moons happen exactly each Nth day as specified in BloodMoonFrequency -->
    <property name="BloodMoonWarning"               value="8" />                <!-- The Hour number that the red day number begins on a blood moon day. Setting this to -1 makes the red never show.  -->
    <property name="BloodMoonEnemyCount"            value="8" />                <!-- This is the number of zombies that can be alive (spawned at the same time) at any time PER PLAYER during a blood moon horde, however, MaxSpawnedZombies overrides this number in multiplayer games. Also note that your game stage sets the max number of zombies PER PARTY. Low game stage values can result in lower number of zombies than the BloodMoonEnemyCount setting. Changing this setting has a huge impact on performance. -->

    <!-- Loot -->
    <property name="LootAbundance"                  value="100" />              <!-- percentage in whole numbers -->
    <property name="LootRespawnDays"                value="30" />               <!-- days in whole numbers -->
    <property name="AirDropFrequency"               value="72"/>                <!-- How often airdrop occur in game-hours, 0 == never -->
    <property name="AirDropMarker"                  value="false"/>             <!-- Sets if a marker is added to map/compass for air drops. -->

    <!-- Multiplayer -->
    <property name="PartySharedKillRange"           value="100"/>               <!-- The distance you must be within to receive party shared kill xp and quest party kill objective credit. -->
    <property name="PlayerKillingMode"              value="3" />                <!-- Player Killing Settings (0 = No Killing, 1 = Kill Allies Only, 2 = Kill Strangers Only, 3 = Kill Everyone) -->

    <!-- Land claim options -->
    <property name="LandClaimCount"                 value="1"/>                 <!-- Maximum allowed land claims per player. -->
    <property name="LandClaimSize"                  value="41"/>                <!-- Size in blocks that is protected by a keystone -->
    <property name="LandClaimDeadZone"              value="30"/>                <!-- Keystones must be this many blocks apart (unless you are friends with the other player) -->
    <property name="LandClaimExpiryTime"            value="7"/>                 <!-- The number of days a player can be offline before their claims expire and are no longer protected -->
    <property name="LandClaimDecayMode"             value="0"/>                 <!-- Controls how offline players land claims decay. 0=Slow (Linear) , 1=Fast (Exponential), 2=None (Full protection until claim is expired). -->
    <property name="LandClaimOnlineDurabilityModifier"  value="4"/>             <!-- How much protected claim area block hardness is increased when a player is online. 0 means infinite (no damage will ever be taken). Default is 4x -->
    <property name="LandClaimOfflineDurabilityModifier" value="4"/>             <!-- How much protected claim area block hardness is increased when a player is offline. 0 means infinite (no damage will ever be taken). Default is 4x -->
    <property name="LandClaimOfflineDelay"          value="0"/>                 <!-- The number of minutes after a player logs out that the land claim area hardness transitions from online to offline. Default is 0 -->

    <!-- There are several game settings that you cannot change when starting a new game.
    You can use console commands to change at least some of them ingame.
    setgamepref BedrollDeadZoneSize 30 -->
</ServerSettings>
catalysm@7D2D-Dev:~$ cat lgsm/config-lgsm/sdtdserver/common.cfg 
##################################
######## Common Settings #########
##################################
# PLACE GLOBAL SETTINGS HERE
## These settings will apply to all instances
ip="x.x.x.x"
stats="y"
catalysm@7D2D-Dev:~$ cat lgsm/config-lgsm/sdtdserver/sdtdserver.cfg 
##################################
######## Instance Settings ########
##################################
# PLACE INSTANCE SETTINGS HERE
## These settings will apply to a specific instance
servercfgfullpath="${servercfgdir}/${servercfgdefault}"
branch="latest_experimental"
niekcandaele commented 4 years ago

I tried removing all my LGSM/server files and reinstalling, no dice. I tried changing the ports but LGSM kept concatenating them like mentioned before.

I have moved on from LGSM and use Docker now, this issue can be closed for my part. Considering nobody else reported it it must be something wrong on my end

github-actions[bot] commented 3 years ago

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.