x07x08 / TF2-Dodgeball-Modified

A modified version of the original YADB (Yet Another Dodgeball) plugin
GNU General Public License v3.0
19 stars 6 forks source link

[Critical Bug] Plugin failed to parse config #16

Closed M60TM closed 5 months ago

M60TM commented 7 months ago

Plugin failed to parse "classes" and "spawner" in configs. This bug has existed since the updated YADB version. I don't know why this bug is happen(code seems to not wrong..). Sometimes plugin success to parse configs. But failure is occurred a lot even if I never touched plugin's code and configs.

L 01/29/2024 - 16:37:41: Info (map "tfdb_pingpong_b1") (file "/home/steam/tf-dedicated/tf/addons/sourcemod/logs/errors_20240129.log")
L 01/29/2024 - 16:37:41: [SM] Exception reported: No rocket class defined.
L 01/29/2024 - 16:37:41: [SM] Blaming: disabled/tfdb/TF2Dodgeball.smx
L 01/29/2024 - 16:37:41: [SM] Call stack trace:
L 01/29/2024 - 16:37:41: [SM]   [0] SetFailState
L 01/29/2024 - 16:37:41: [SM]   [1] Line 545, C:\suspawn\dodgeball\scripting\TF2Dodgeball.sp::EnableDodgeBall
L 01/29/2024 - 16:37:41: [SM]   [2] Line 490, C:\suspawn\dodgeball\scripting\TF2Dodgeball.sp::OnConfigsExecuted

I just recompiled this plugin on SM 1.12. And this bug also happened in SM 1.11..

Silorak commented 7 months ago

Hello, are you using subplugin "EventFix" by any chance?

Silorak commented 7 months ago

and are on updated version of the plugin?

Silorak commented 7 months ago

"Plugin failed to parse "classes" and "spawner" in configs", most likely appears due of "Speedometer" as it can't work without EventFix.

M60TM commented 7 months ago

Sadly, I ran tfdb with eventfix. and all of plugin are latest version.

Silorak commented 7 months ago

And config for sure was not edited? Like, everything was uploaded and when you started the server that bug appeared?

M60TM commented 7 months ago

Yes. I didn't touched anything. And is there any problem if I load it from disabled or optional folder?

Silorak commented 7 months ago

Plugins should be outside disabled, cuz that folder will disable the plugin.

Silorak commented 7 months ago

Then again, I have not experimented with plugin going to plugins/folders as I didn't find a good reason to do so and kept it how sourcemod has.

M60TM commented 7 months ago

I only load dodgeball plugin on tfdb_ map. And unload it on nextmap(Because I ran multiple modes in one server). I think it can be make this problem. I should test without speedometer.

Silorak commented 7 months ago

Ahh, I see a multi server. I'll ask x07 when he's up about how to approach that. The way I would would probably use map configs to enable/disable this cvar "tf_dodgeball_enabled" as that will make the plugin use the cfg/sourcemod/dodgeball_enabled or dodgeball_disabled.

M60TM commented 7 months ago

I tried to run tfdb without eventfix and speedmeter. Considering that there was no problem, it seems to be an extension of Issue #7.

x07x08 commented 7 months ago

Sorry for the late reply, I was quite busy and I could check the repository only yesterday.

I've just tested loading & unloading from the disabled folder (disabled/tfdb) as follows :

  1. Made two configs; one for enabling / loading dodgeball (loadtfdb.cfg) and another for disabling / unloading (unloadtfdb.cfg)
  2. Always unloaded on server startup using server.cfg (exec unloadtfdb)
  3. Load on tfdb_ maps (exec loadtfdb) (tested with just tfdb_spacebox,_v2, but it probably doesn't matter which map is used)

Sadly, I couldn't replicate the error at all after constantly changing maps. I also don't know if the order in which plugins are loaded matters. I loaded EventFix first, the main one second and everything else afterwards (including Speedometer). Could you provide the full logs (both normal and error, you can cut out everything that doesn't matter)? I want to know if the config even gets executed in the first place. It'd be even more helpful if you could output the details of the parsing process (using Log or Print functions). Sorry if I'm asking you to pretty much debug it yourself, but this is the only way since I can't get the error to trigger.

M60TM commented 7 months ago

Error

L 01/29/2024 - 16:37:33: Error log file session closed.
L 01/29/2024 - 16:37:41: SourceMod error session started
L 01/29/2024 - 16:37:41: Info (map "tfdb_pingpong_b1") (file "/home/steam/tf-dedicated/tf/addons/sourcemod/logs/errors_20240129.log")
L 01/29/2024 - 16:37:41: [SM] Exception reported: No rocket class defined.
L 01/29/2024 - 16:37:41: [SM] Blaming: disabled/tfdb/TF2Dodgeball.smx
L 01/29/2024 - 16:37:41: [SM] Call stack trace:
L 01/29/2024 - 16:37:41: [SM]   [0] SetFailState
L 01/29/2024 - 16:37:41: [SM]   [1] Line 545, C:\suspawn\dodgeball\scripting\TF2Dodgeball.sp::EnableDodgeBall
L 01/29/2024 - 16:37:41: [SM]   [2] Line 490, C:\suspawn\dodgeball\scripting\TF2Dodgeball.sp::OnConfigsExecuted
-----
L 01/29/2024 - 16:37:41: [mapconfigs.smx] Searching specific configs for tfdb_pingpong_b1
L 01/29/2024 - 16:37:41: [mapconfigs.smx] Executing map specific config: tfdb_.cfg
L 01/29/2024 - 16:37:41: [disabled/tfdb/TF2Dodgeball.smx] Executing configuration file addons/sourcemod/configs/dodgeball/general.cfg
L 01/29/2024 - 16:37:41: [disabled/tfdb/TF2Dodgeball.smx] Executing configuration file addons/sourcemod/configs/dodgeball/tfdb_pingpong_b1.cfg

Normal

L 01/29/2024 - 18:40:45: [SM] Changed map to "tfdb_minecraft"
L 01/29/2024 - 18:40:47: -------- Mapchange to tfdb_minecraft --------
L 01/29/2024 - 18:40:59: [mapconfigs.smx] Searching specific configs for tfdb_minecraft
L 01/29/2024 - 18:40:59: [mapconfigs.smx] Executing map specific config: tfdb_.cfg
L 01/29/2024 - 18:41:00: [disabled/tfdb/TF2Dodgeball.smx] Executing configuration file addons/sourcemod/configs/dodgeball/general.cfg
L 01/29/2024 - 18:41:00: [disabled/tfdb/TF2Dodgeball.smx] Executing configuration file addons/sourcemod/configs/dodgeball/tfdb_minecraft.cfg

They were happen same day. You may judge that the file does not exist. But after this error log, I moved SetFailState check to ParseConfigurations for test(to debug). And I got this.

L 01/29/2024 - 21:50:25: Info (map "tfdb_pingpong_b1") (file "/home/steam/tf-dedicated/tf/addons/sourcemod/logs/errors_20240129.log")
L 01/29/2024 - 21:50:25: [SM] Exception reported: No rocket class defined.
L 01/29/2024 - 21:50:25: [SM] Blaming: disabled/tfdb/TF2Dodgeball.smx
L 01/29/2024 - 21:50:25: [SM] Call stack trace:
L 01/29/2024 - 21:50:25: [SM]   [0] SetFailState
L 01/29/2024 - 21:50:25: [SM]   [1] Line 2044, C:\suspawn\dodgeball\scripting\TF2Dodgeball.sp::ParseConfigurations
L 01/29/2024 - 21:50:25: [SM]   [2] Line 541, C:\suspawn\dodgeball\scripting\TF2Dodgeball.sp::EnableDodgeBall
L 01/29/2024 - 21:50:25: [SM]   [3] Line 490, C:\suspawn\dodgeball\scripting\TF2Dodgeball.sp::OnConfigsExecuted
-----
L 01/29/2024 - 21:50:09: [SM] Changed map to "tfdb_pingpong_b1"
L 01/29/2024 - 21:50:11: -------- Mapchange to tfdb_pingpong_b1 --------
L 01/29/2024 - 21:50:25: [mapconfigs.smx] Searching specific configs for tfdb_pingpong_b1
L 01/29/2024 - 21:50:25: [mapconfigs.smx] Executing map specific config: tfdb_.cfg
L 01/29/2024 - 21:50:25: [disabled/tfdb/TF2Dodgeball.smx] Executing configuration file addons/sourcemod/configs/dodgeball/general.cfg

Given that the plugin made the same error in that state, it seems true that it enters the ParseConfigurations function.

x07x08 commented 7 months ago

Odd. Then it must silently fail in one of the do loops (first one or inside ParseClasses). Also the return values of the Keyvalues methods aren't checked, those might give a clue I guess?

M60TM commented 7 months ago

Ok..I'll check later. But I just got same error.

L 02/03/2024 - 13:01:06: Info (map "tfdb_js_soccer_v1a") (file "/home/steam/tf-dedicated/tf/addons/sourcemod/logs/errors_20240203.log")
L 02/03/2024 - 13:01:06: [SM] Exception reported: No rocket class defined.
L 02/03/2024 - 13:01:06: [SM] Blaming: disabled/tfdb/TF2Dodgeball.smx
L 02/03/2024 - 13:01:06: [SM] Call stack trace:
L 02/03/2024 - 13:01:06: [SM]   [0] SetFailState
L 02/03/2024 - 13:01:06: [SM]   [1] Line 545, C:\suspawn\dodgeball\scripting\TF2Dodgeball.sp::EnableDodgeBall
L 02/03/2024 - 13:01:06: [SM]   [2] Line 490, C:\suspawn\dodgeball\scripting\TF2Dodgeball.sp::OnConfigsExecuted
-----
L 02/03/2024 - 13:01:06: [disabled/tfdb/TF2Dodgeball.smx] Executing configuration file addons/sourcemod/configs/dodgeball/general.cfg
L 02/03/2024 - 13:01:06: [disabled/tfdb/TF2Dodgeball.smx] Executing configuration file addons/sourcemod/configs/dodgeball/tfdb_js_soccer_v1a.cfg

I ran tfdb without EventFix and Speedmeter. But it is still continued..

x07x08 commented 7 months ago

Any updates on this?