GameServerManagers / LinuxGSM

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

[Bug]: Factorio server updates when already up to date #4687

Closed Amlinde closed 3 weeks ago

Amlinde commented 1 month ago

User story

Due to interpreting the version incorrectly, the update command always thinks factorio is out of date. This has been causing the server to restart whenever it is run, which, in the case of the container version I'm using, is every hour by default.

Game

Factorio

Linux distro

Ubuntu 22.04

Command

command: update

Further information

Pre 2.0, the --version command output was formatted like this:

Version: 1.1.110 (build 62357, linux64, headless)
Binary version: 64
Map input version: 0.18.0-0
Map output version: 1.1.110-0

With the 2.0 update it is now formatted like this:

Version: 2.0.8 (build 79416, linux64, headless)
Version: 64
Map input version: 1.0.0-0
Map output version: 2.0.8-1

This causes LinuxGSM to interpret the version as

2.0.8
64

instead of 2.0.8

Relevant log output

No response

Steps to reproduce

No response

skwasjer commented 1 month ago

I think this also causes malformed JSON when sending (in my case) Discord hook, due to the LF control character:


[ .... ] Updating fctrserver: Sending Discord alertparse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 28, column 4
[ FAIL ] Updating fctrserver: Sending Discord alert: {"message": "The request body contains invalid JSON.", "code": 50109}

From /log/scripts:

Oct 24 14:56:57.359 fctrserver: START: PASS: Started [redacted]
Oct 24 14:56:57.380 fctrserver: UPDATE: INFO: Sending alert: fctrserver has received a game server update: 2.0.9
64
Oct 24 14:56:58.065 fctrserver: UPDATE: PASS: Using cached IP as public IP address
Oct 24 14:56:59.816 fctrserver: UPDATE: FATAL: Sending Discord alert: {"message": "The request body contains invalid JSON.", "code": 50109}
Oct 24 14:56:59.828 fctrserver: UPDATE: INFO: LinuxGSM version: v24.3.1
Oct 24 14:56:59.830 fctrserver: UPDATE: FATAL: core_exit.sh exiting with code: 1
skwasjer commented 3 weeks ago

I can confirm that with the latest hotfix from #4688 the Discord alert also works again.