LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

[BUG] (23) Failed writing AND body jq: error (at <stdin>:1): Cannot iterate over null (null) during mods-update

Open olokos opened this issue 2 years ago • 4 comments

User Story

As a server admin, I want to use mod-update to update server mods, which I believe was done successfully, but the errors don't make me feel good when doing the mod update.

Basic info

  • Distro: [Ubuntu 20.04]
  • Game: [CS:GO]
  • Command: [mods-update]
  • LinuxGSM version: [v22.1.0]

Further Information

I believe this might happen when the sourcemod.net server is overloaded with traffic/users, as it's not happening everytime, but on some occasions, but it's just a rough guess.

This might be possibly related to https://github.com/GameServerManagers/LinuxGSM/issues/3762 but it's just a wild guess, it might be completely unrelated, just similar.

Logs with the issue below:

csgoserver@server:~/csgoserver$ ./csgoserver mu
[ INFO ] Updating mods csgoserver: Update addons/mods: 2 addons/mods will be updated
        * Metamod: Source (retain common custom files)
        * SourceMod (retain common custom files)

==> Updating Metamod: Source
creating mod download directory /home/csgoserver/csgoserver/lgsm/mods/tmp...OK
                                                   ##O=- #     #                                                                                                                                           curl: (22) The requested URL returned error: 522                                                                                              #             #            #          #

Failure! An issue occurred downloading Metamod: Sourcecsgoserver@server:~/csgoserver$ ./csgoserver mu
(23) Failed writing body
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
[ INFO ] Updating mods csgoserver: Update addons/mods: 2 addons/mods will be updated
        * Metamod: Source (retain common custom files)
        * SourceMod (retain common custom files)

==> Updating Metamod: Source

What's interesting is that despite those errors, the update itself was performed successfully and with no errors after those mentioned above.

To Reproduce

Steps to reproduce the behaviour:

  1. Go to your server directory
  2. Execute ./csgoserver mu
  3. Hope the bug happens or there are some network issues (or cause the network issues locally for testing)
  4. See error

Just a heads up, that both sourcemod and metamod just got updates that fixed server-breaking bug that valve introduced with an update, because of this almost every server owner is now trying to download the updates, clogging up sourcemod.net server.

Expected behaviour

Mods update without no error

olokos avatar Jun 24 '22 15:06 olokos

afaik this happens if you have to many request to the github api ( like having multiple servers on the same servers that update over again or automated )

You can check this if this happens with the curl from the server: https://docs.github.com/en/rest/rate-limit

In this case without the api token, as lgsm does not use one: curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/rate_limit

I think not that there is a limit on the sourcemod side.

h3o66 avatar Jun 26 '22 21:06 h3o66

That does make sense, yes.

Combined with me updating multiple servers all at once and github/sourcemod being overloaded with requests from others aswell might have caused it.

Maybe the error could more self-explanatory, for example mentioning what failed downloading?

Because as it is now, the update is done, but the error doesn't say anything useful, leaving the admin with 0 clue what went wrong.

olokos avatar Aug 07 '22 11:08 olokos

Imho there need to be solved a few issues:

  1. We should not query the github api all the time when launching any mod command
  2. allow to set a api token for github
  3. check the github api if the server ran into the request limit

Related to #2615

h3o66 avatar Aug 22 '22 20:08 h3o66

+1 on this, still happens, even on a single server that's not running anything else right after install:

rustserver@rust:~$ ./rustserver mi
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)

Rust Installing mods
=================================
Available addons/mods
=================================
Carbon for Rust - Allows for the use of both plugins and harmony mods - carbonmod.gg
 * rustcarbon
Oxide for Rust - Allows for the use of plugins - https://umod.org/games/rust
 * rustoxide

Enter an addon/mod to install (or exit to abort): exit

Choosing to install one of the mods at this point actually fails.

Installing Carbon for Rust
=================================
clearing mod download directory /home/rustserver/lgsm/mods/tmp...OK
creating mod download directory /home/rustserver/lgsm/mods/tmp...OK
                                          curl: (3) URL using bad/illegal format or missing URL
FAIL

sebastienvercammen avatar Apr 07 '24 16:04 sebastienvercammen