GameServerManagers / LinuxGSM

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

[BUG] mods-update installs the wrong Metamod for CS:GO #3909

Open borzaka opened 2 years ago

borzaka commented 2 years ago

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

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:

  1. Server is an existing install with CS:GO, metamod and sourcemod
  2. Run ./csgoserver mods-update
  3. it downloads the wrong ZIP for metamod: metamod-1.21.1-am.zip
  4. server craches, because this metamod is not for CS:GO

Expected behaviour

Install the correct Metamod:Source version for CS:GO

Extra info

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
h3o66 commented 2 years ago

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:

  1. 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
  2. write a migration script for the mods module.

fyi: @tkrn as i think you broke this with the mentioned PR