PhlexPlexico / G5WS

Game Server Plugin for G5API
https://phlex.avidgamers.me
GNU General Public License v3.0
18 stars 8 forks source link

[get5.smx] json_decode: no object or array found at position 0 #16

Closed YungGhost1377 closed 3 years ago

YungGhost1377 commented 3 years ago

After the update, this happened :(

{
 "gamestate": 0,
 "available": 1,
 "plugin_version": "0.7.2-dev+516"
}
RecordSteamInterfaceCreation (PID 17149): STEAMHTTP_INTERFACE_VERSION003 / HTTP
Match config loading initialized.
L 01/29/2021 - 21:34:54: [get5.smx] json_decode: no object or array found at position 0
L 01/29/2021 - 21:34:54: [get5.smx] Failed to load match config: invalid match json
sm plugins list
[SM] Listing 19 plugins:
  01 "Admin Help" (1.10.0.6502) by AlliedModders LLC
  02 "Client Preferences" (1.10.0.6502) by AlliedModders LLC
  03 "Sound Commands" (1.10.0.6502) by AlliedModders LLC
  04 "Get5 API Integration - RIPEXT" (2.0.2) by splewis/phlexplexico
  05 "Admin File Reader" (1.10.0.6502) by AlliedModders LLC
  06 "Admin Menu" (1.10.0.6502) by AlliedModders LLC
  07 "Basic Commands" (1.10.0.6502) by AlliedModders LLC
  08 "Basic Ban Commands" (1.10.0.6502) by AlliedModders LLC
  09 "Basic Chat" (1.10.0.6502) by AlliedModders LLC
  10 "Basic Info Triggers" (1.10.0.6502) by AlliedModders LLC
  11 "Basic Votes" (1.10.0.6502) by AlliedModders LLC
  12 "Fun Votes" (1.10.0.6502) by AlliedModders LLC
  13 "Nextmap" (1.10.0.6502) by AlliedModders LLC
  14 "Get5" (0.7.2-dev+516) by splewis
  15 "Anti-Flood" (1.10.0.6502) by AlliedModders LLC
  16 "Reserved Slots" (1.10.0.6502) by AlliedModders LLC
  17 "Basic Comm Control" (1.10.0.6502) by AlliedModders LLC
  18 "Fun Commands" (1.10.0.6502) by AlliedModders LLC
  19 "Player Commands" (1.10.0.6502) by AlliedModders LLC
PhlexPlexico commented 3 years ago

Please run sm exts list. This is a get5 problem as you can see that it's what is calling the error. Make sure you have the required dependencies for get5 (sm-json, SteamWorks).

YungGhost1377 commented 3 years ago
sm exts list
[SM] Displaying 10 extensions:
[01] Automatic Updater (1.10.0.6502): Updates SourceMod gamedata files
[02] Webternet (1.10.0.6502): Extension for interacting with URLs
[03] CS Tools (1.10.0.6502): CS extended functionality
[04] BinTools (1.10.0.6502): Low-level C/C++ Calling API
[05] SDK Tools (1.10.0.6502): Source SDK Tools
[06] Client Preferences (1.10.0.6502): Saves client preference settings
[07] SQLite (1.10.0.6502): SQLite Driver
[08] REST in Pawn (1.2.2): Provides HTTP and JSON natives for plugins
[09] Top Menus (1.10.0.6502): Creates sorted nested menus
[10] SteamWorks Extension (1.2.3): Exposes SteamWorks functions to Developers
PhlexPlexico commented 3 years ago

Is your API setup correctly and is sending the match config at the right url? I tried running on my test server and have zero issues after the CS updates.

PhlexPlexico commented 3 years ago

Please set this in your console: get5_debug 32

Then take a look at addons/sourcemod/logs/get5_debug.log and provide the output as well. It's possible your server just isn't sending the data.

YungGhost1377 commented 3 years ago
L 01/29/2021 - 22:03:07: [get5] cleanedUrl (SteamWorks) = http://rsp.yungghost.ovh/api/matches/9/config
L 01/29/2021 - 22:03:07: [get5_api] get5_web_api_url now set to 
L 01/29/2021 - 22:03:07: [get5] Calling Get5_OnPreLoadMatchConfig(config=remote_config0.json)
L 01/29/2021 - 22:03:07: [get5] get5_event: {
    "matchid": "",
    "params": {
        "reason": "invalid match json"
    },
    "event": "match_config_load_fail"
}
L 01/29/2021 - 22:03:07: [get5] Calling Get5_OnEvent(event name = match_config_load_fail)
L 01/29/2021 - 22:03:07: [get5] Calling Get5_OnLoadMatchConfigFailed(reason=invalid match json)
YungGhost1377 commented 3 years ago

I tried other versions of get5 as well, and tried reinstalling the csgo server

PhlexPlexico commented 3 years ago

https://github.com/splewis/get5/suites/1890200602/artifacts/36967144 this is the latest version and it appears to be working just fine for me. I can't reproduce this and I feel it's more of a configuration issue. I can see from your config that it's valid JSON, so I'm not sure what's going on. It's possible the server cannot see that URL, but I have no clue what could be causing it. I would say maybe it could be that. Could you include the aforementioned file as well? addons/sourcemod/logs/get5_debug.log

Try on your game server as well this and see what it does: get5_loadmatch_url "http://rsp.yungghost.ovh/api/matches/9/config"

PhlexPlexico commented 3 years ago

Better yet, try loading your match config from a JSON file. I nabbed the config from your URL. Save this in the CSGO folder, rename the extension to .json and then call get5_loadmatch test_match.json test_match.txt

YungGhost1377 commented 3 years ago

I changed the config by specifying the port and everything worked

{
  "server": {
    "port": 3301,
    "hostname": "http://rsp.yungghost.ovh",
    "dbKey": "
    "steamAPIKey": "
    "sharedSecret": 
    "clientHome": "http://rsp.yungghost.ovh",
    "useRedis": true,
    "apiURL": "http://rsp.yungghost.ovh:3301", ! last -  http://rsp.yungghost.ovh/api
    "uploadDemos": true
  },
PhlexPlexico commented 3 years ago

So it's a config setting in your reverse proxy. It may be your server configuration not properly redirecting to it. Glad that works as a fix though, but it should not be a permanent thing, as that is the point of having a reverse proxy :)

YungGhost1377 commented 3 years ago

This is some kind of nonsense, before that it started matches. Sorry for disturbing

PhlexPlexico commented 3 years ago

No problem at all! I'm going to close this for now, if there;'s anymore issues feel free to let me know :)