[BUG] mods-update installs the wrong Metamod for CS:GO
User Story
As a server owner and maintainer, I want to update my mods, fixing crashes caused by new game updates time to time.
Basic info
- Distro: [Debian 10]
- Game: [CS:GO]
- Command: [mods-update]
- LinuxGSM version: [v22.1.0]
Further Information
Recently, a new CS:GO update broke SourceMod and Metamod. So I waited out to the fix available. The fix is arrived, but when I tried to update, the server still crashed. It turned out, that LGSM installed the wrong Metamod. It installed the Metamod (Half-life 1 Classic Engine) instead of Metamod:Source.
To Reproduce
Steps to reproduce the behaviour:
- Server is an existing install with CS:GO, metamod and sourcemod
- Run ./csgoserver mods-update
- it downloads the wrong ZIP for metamod: metamod-1.21.1-am.zip
- server craches, because this metamod is not for CS:GO
Expected behaviour
Install the correct Metamod:Source version for CS:GO
Extra info
- server was an existing install
- LGSM was constantly updated
- it worked before, couple of months ago
- solution I came up: remove metamod, install metamodsource
mods-update log:
the metamod-1.21.1-am.zip file is not for csgoserver
$ ./csgoserver mods-update
[ INFO ] Updating mods csgoserver: Update addons/mods: 3 addons/mods will be updated
* Metamod (retain common custom files)
* SourceMod (retain common custom files)
* SteamWorks (overwrite)
==> Updating Metamod
creating mod download directory /home/csgoexecutes/lgsm/mods/tmp...OK
######################################################################################################################################################################################################################################################### 100.0%
extracting metamod-1.21.1-am.zip...OK
the following files/directories will be preserved:
* serverfiles/addons/metamod/plugins.ini
building metamod-files.txt...OK
copying Metamod to /home/csgoexecutes/serverfiles/csgo...OK
tidy up metamod-files.txt...OK
clearing mod download directory /home/csgoexecutes/lgsm/mods/tmp...OK
==> Updating SourceMod
creating mod download directory /home/csgoexecutes/lgsm/mods/tmp...OK
#=#=- # # #=O=# ######################################################################################################################################################################################################################################################### 100.0%
extracting sourcemod-1.10.0-git6545-linux.tar.gz...OK
the following files/directories will be preserved:
* serverfiles/cfg
* serverfiles/addons/sourcemod/configs
building sourcemod-files.txt...OK
copying SourceMod to /home/csgoexecutes/serverfiles/csgo...OK
tidy up sourcemod-files.txt...OK
clearing mod download directory /home/csgoexecutes/lgsm/mods/tmp...OK
==> Updating SteamWorks
creating mod download directory /home/csgoexecutes/lgsm/mods/tmp...OK
######################################################################################################################################################################################################################################################### 100.0%
extracting SteamWorks-git132-linux.tar.gz...OK
building steamworks-files.txt...OK
copying SteamWorks to /home/csgoexecutes/serverfiles/csgo...OK
tidy up steamworks-files.txt...OK
clearing mod download directory /home/csgoexecutes/lgsm/mods/tmp...OK
[ OK ] Updating mods csgoserver: Mods update complete
mods-remove and mods-install logs:
note the Error! metamod is not a valid addon/mod. message
$ ./csgoserver mods-remove
(23) Failed writing body
Counter-Strike: Global Offensive Removing mods
=================================
Remove addons/mods
=================================
metamod - Metamod - Plugins Framework
sourcemod - SourceMod - Admin Features (requires Metamod: Source)
steamworks - SteamWorks - Exposing SteamWorks functions to SourcePawn
Enter an addon/mod to remove (or exit to abort): metamod
Error! metamod is not a valid addon/mod.
Warning! You are about to remove metamod.
* Any custom files/configuration will be removed.
Continue? [Y/n] Y
removing Metamod
* 5 files to be removed
* location: /home/csgoexecutes/serverfiles/csgo
removing Metamod 1 / 5 : addons/metamod...
removing Metamod 2 / 5 : addons/metamod/dlls...
removing Metamod 3 / 5 : addons/metamod/dlls/metamod.dylib...
removing Metamod 4 / 5 : addons/metamod/dlls/metamod.so...
removing Metamod 5 / 5 : addons/metamod/dlls/metamod.dll...
OK
removing metamod-files.txt...OK
removing metamod from installed-mods.txt...OK
Metamod removed
mods-install logs:
$ ./csgoserver mods-install
Counter-Strike: Global Offensive Installing mods
=================================
Installed addons/mods
=================================
* sourcemod
* steamworks
Available addons/mods
=================================
Metamod: Source - Plugins Framework - https://www.sourcemm.net
* metamodsource
...
Enter an addon/mod to install (or exit to abort): metamodsource
Installing Metamod: Source
=================================
creating mod download directory /home/csgoexecutes/lgsm/mods/tmp...OK
#=#=- # # #=O=# ########################################################################################################################################################################################################################################################## 100.0%
extracting mmsource-1.11.0-git1148-linux.tar.gz...OK
building metamodsource-files.txt...OK
copying Metamod: Source to /home/csgoexecutes/serverfiles/csgo...OK
tidy up metamodsource-files.txt...OK
clearing mod download directory /home/csgoexecutes/lgsm/mods/tmp...OK
Metamod: Source installed
I think this was broken due #3104 . This did not migrate the old to the new name. I have seen this as well on a old server on my side some time ago.
Options:
- manually fix this with the following:
sed -i 's/^metamod$/metamodsource/' lgsm/mods/installed-mods.txt
mv lgsm/mods/metamod-files.txt lgsm/mods/metamodsource-files.txt
- write a migration script for the mods module.
fyi: @tkrn as i think you broke this with the mentioned PR