GAMMACASE / ServerRedirect

SourceMod plugin that allows players to see and connect to other servers
https://forums.alliedmods.net/showthread.php?t=322306
GNU General Public License v3.0
66 stars 26 forks source link

Plugin cannot start #16

Closed rajkodev closed 4 years ago

rajkodev commented 4 years ago

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)
GAMMACASE commented 4 years ago

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

rajkodev commented 4 years ago
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.

GAMMACASE commented 4 years ago

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?

rajkodev commented 4 years ago

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

GAMMACASE commented 4 years ago

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.

rajkodev commented 4 years ago

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.

GAMMACASE commented 4 years ago

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.

rajkodev commented 4 years ago

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

GAMMACASE commented 4 years ago

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.

rajkodev commented 4 years ago
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.

GAMMACASE commented 4 years ago

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.

GAMMACASE commented 4 years ago

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

rajkodev commented 4 years ago

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

Thank you for help, you are awesome!

GAMMACASE commented 4 years ago

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

GAMMACASE commented 4 years ago

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

rajkodev commented 4 years ago

I'll inform you as soon as test it!

GAMMACASE commented 4 years ago

Any update on this issue?