GAMMACASE/ServerRedirect

Plugin cannot start

Closed this issue · 17 comments

Hey, after compilling last build i got this error:

L 04/30/2020 - 13:55:21: [SM] Blaming: server_redirect.smx
L 04/30/2020 - 13:55:21: [SM] Call stack trace:
L 04/30/2020 - 13:55:21: [SM]   [0] ThrowError
L 04/30/2020 - 13:55:21: [SM]   [1] Line 62, C:\BasicPawn\LAST COMPILLER\include\glib/convarutils.inc::FillConVarFile
L 04/30/2020 - 13:55:21: [SM]   [2] Line 48, C:\BasicPawn\LAST COMPILLER\include\glib/convarutils.inc::AutoExecConfigCustom
L 04/30/2020 - 13:55:21: [SM]   [3] Line 179, C:\BasicPawn\LAST COMPILLER\server_redirect.sp::OnPluginStart
L 04/30/2020 - 13:55:21: [SM] Unable to load plugin "server_redirect.smx": Error detected in plugin startup (see error logs)

You didn't copy full error. Can't tell you anything from this log.

L 04/30/2020 - 13:54:18: [SM] Exception reported: Failed to auto generate config "cfg/sourcemod/plugin.server_redirect.cfg", make sure the directory has write permission
L 04/30/2020 - 13:54:18: [SM] Blaming: server_redirect.smx
L 04/30/2020 - 13:54:18: [SM] Call stack trace:
L 04/30/2020 - 13:54:18: [SM]   [0] ThrowError
L 04/30/2020 - 13:54:18: [SM]   [1] Line 62, C:\BasicPawn\LAST COMPILLER\include\glib/convarutils.inc::FillConVarFile
L 04/30/2020 - 13:54:18: [SM]   [2] Line 48, C:\BasicPawn\LAST COMPILLER\include\glib/convarutils.inc::AutoExecConfigCustom
L 04/30/2020 - 13:54:18: [SM]   [3] Line 179, C:\BasicPawn\LAST COMPILLER\server_redirect.sp::OnPluginStart
L 04/30/2020 - 13:54:18: [SM] Unable to load plugin "server_redirect.smx": Error detected in plugin startup (see error logs)
L 04/30/2020 - 13:54:19: [SM] Exception reported: Array index out-of-bounds (index -1, limit 66)
L 04/30/2020 - 13:54:19: [SM] Blaming: weapons.smx
L 04/30/2020 - 13:54:19: [SM] Call stack trace:
L 04/30/2020 - 13:54:19: [SM]   [1] Line 69, tmp/addons/sourcemod/scripting/weapons/hooks.sp::ChatListener

This is all i got, after update to last commit.

Read what the actual error says: Failed to auto generate config "cfg/sourcemod/plugin.server_redirect.cfg", make sure the directory has write permission, can you check your cfg/sourcemod folder?

Permissions are okay, checked it.
Also that configuration file already exist.

Then probably permissions are different for that cfg file, try deleting it and let plugin recreate it, don't forget to restore all cvar values you set there if there's any.

Again same problem:

Server is running under linux.

L 04/30/2020 - 15:44:10: [SM] Exception reported: Failed to auto generate config "cfg/sourcemod/plugin.server_redirect.cfg", make sure the directory has write permission
L 04/30/2020 - 15:44:10: [SM] Blaming: server_redirect.smx
L 04/30/2020 - 15:44:10: [SM] Call stack trace:
L 04/30/2020 - 15:44:10: [SM]   [0] ThrowError
L 04/30/2020 - 15:44:10: [SM]   [1] Line 62, C:\BasicPawn\LAST COMPILLER\include\glib/convarutils.inc::FillConVarFile
L 04/30/2020 - 15:44:10: [SM]   [2] Line 48, C:\BasicPawn\LAST COMPILLER\include\glib/convarutils.inc::AutoExecConfigCustom
L 04/30/2020 - 15:44:10: [SM]   [3] Line 179, C:\BasicPawn\LAST COMPILLER\server_redirect.sp::OnPluginStart
L 04/30/2020 - 15:44:10: [SM] Unable to load plugin "server_redirect.smx": Error detected in plugin startup (see error logs)
L 04/30/2020 - 15:44:11: [SM] Exception reported: Array index out-of-bounds (index -1, limit 66)
L 04/30/2020 - 15:44:11: [SM] Blaming: weapons.smx
L 04/30/2020 - 15:44:11: [SM] Call stack trace:
L 04/30/2020 - 15:44:11: [SM]   [1] Line 69, tmp/addons/sourcemod/scripting/weapons/hooks.sp::ChatListener
L 04/30/2020 - 15:44:17: Error log file session closed.

EDIT:

Windows server works perfect but linux give me this error.

You definitely have something wrong with permissions, works fine for me both on linux or windows. You can also try to remove sourcemod folder under cfg and let plugin to create it and see if it helps.

All other plugins successfully create new .cfg file except this one, just now tested.
Maybe i should upgrade to last version of sm?

Don't think that'll help. There's one more thing you can try, open includes/glib/convarutils.inc and change line 41 to Format(path, sizeof(path), "cfg\\%s\\plugin.%s.cfg", folder, plname[FindCharInString(plname, '/', true) + 1]); and test if this helps.

L 04/30/2020 - 16:21:10: [SM] Exception reported: Failed to auto generate config "cfg\sourcemod\plugin.server_redirect.cfg", make sure the directory has write permission
L 04/30/2020 - 16:21:10: [SM] Blaming: server_redirect.smx
L 04/30/2020 - 16:21:10: [SM] Call stack trace:
L 04/30/2020 - 16:21:10: [SM]   [0] ThrowError
L 04/30/2020 - 16:21:10: [SM]   [1] Line 62, C:\BasicPawn\LAST COMPILLER\include\glib/convarutils.inc::FillConVarFile
L 04/30/2020 - 16:21:10: [SM]   [2] Line 48, C:\BasicPawn\LAST COMPILLER\include\glib/convarutils.inc::AutoExecConfigCustom
L 04/30/2020 - 16:21:10: [SM]   [3] Line 179, C:\BasicPawn\LAST COMPILLER\server_redirect.sp::OnPluginStart
L 04/30/2020 - 16:21:10: [SM] Unable to load plugin "server_redirect.smx": Error detected in plugin startup (see error logs)

Actually nothing changed..
Previous version worked perfect on win and linux based systems.

Alright then again I'm returning to the problem with permissions, as I don't see other options for this to behave like this, it basically tries to create file under that path and write to it, nothing really complex.

You can also try to change line 59 to File file = OpenFile(path, "w"); in the same file you modified earlier.

It works now!
I think that this should be changed in dev branch.

Thank you for help, you are awesome!

Alright, thanks to you for pointing to that error, gonna fix it in master branch then too!

Can you please also confirm that changing back to / slashes has no effect. Line 41 in the same file.

I'll inform you as soon as test it!

Any update on this issue?