Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing server #236

Closed
scorp1onul opened this issue Jan 2, 2024 · 7 comments
Closed

Crashing server #236

scorp1onul opened this issue Jan 2, 2024 · 7 comments

Comments

@scorp1onul
Copy link

Hello, i receive next errors from css, maybe you can help me to fix this please

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at CounterStrikeSharp.API.Core.Application.OnCSSPluginCommand(CCSPlayerController caller, CommandInfo info) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Application.cs:line 134
   at CounterStrikeSharp.API.Modules.Utils.CommandUtils.<>c__DisplayClass0_0.<AddStandaloneCommand>b__0(Int32 i, IntPtr ptr) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Utils/StandaloneCommand.cs:line 99
   at InvokeStub_Action`2.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82
2024-01-02 15:56:51.429 +02:00 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at CounterStrikeSharp.API.Core.Application.OnCSSPluginCommand(CCSPlayerController caller, CommandInfo info) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Application.cs:line 134
   at CounterStrikeSharp.API.Modules.Utils.CommandUtils.<>c__DisplayClass0_0.<AddStandaloneCommand>b__0(Int32 i, IntPtr ptr) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Utils/StandaloneCommand.cs:line 17
   at InvokeStub_Action`2.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82
2024-01-02 15:59:44.657 +02:00 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at CounterStrikeSharp.API.Core.Application.OnCSSPluginCommand(CCSPlayerController caller, CommandInfo info) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Application.cs:line 134
   at CounterStrikeSharp.API.Modules.Utils.CommandUtils.<>c__DisplayClass0_0.<AddStandaloneCommand>b__0(Int32 i, IntPtr ptr) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Utils/StandaloneCommand.cs:line 17
   at InvokeStub_Action`2.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82
@B3none
Copy link
Collaborator

B3none commented Jan 3, 2024

@scorp1onul can you provide some steps to reproduce this error?

@scorp1onul
Copy link
Author

scorp1onul commented Jan 3, 2024

@scorp1onul can you provide some steps to reproduce this error?

I can't reproduce because i don't know what's happening in that moment, for sure admins commands no, i think it's something about menu commands because in this morning i received this

2024-01-03 00:44:20.120 +02:00 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at CounterStrikeSharp.API.Modules.Menu.ChatMenuInstance.OnKeyPress(CCSPlayerController player, Int32 key) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Menu/ChatMenu.cs:line 97
   at CounterStrikeSharp.API.Modules.Menu.ChatMenus.OnKeyPress(CCSPlayerController player, Int32 key) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Menu/ChatMenu.cs:line 160
   at CounterStrikeSharp.API.Core.Application.<>c.<Start>b__15_0(CCSPlayerController player, CommandInfo info) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Application.cs:line 90
   at CounterStrikeSharp.API.Modules.Utils.CommandUtils.<>c__DisplayClass0_0.<AddStandaloneCommand>b__0(Int32 i, IntPtr ptr) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Utils/StandaloneCommand.cs:line 17
   at InvokeStub_Action`2.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82

Maybe you can tell me a small clue where can be reproduce this error, a system or function or something

@mihaigsm2003
Copy link

mihaigsm2003 commented Jan 4, 2024

hi, i have this same error i think is from plugin using chatMenu::

2024-01-04 16:56:44.493 +02:00 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at CounterStrikeSharp.API.Modules.Menu.ChatMenuInstance.OnKeyPress(CCSPlayerController player, Int32 key) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Menu/ChatMenu.cs:line 97
   at CounterStrikeSharp.API.Modules.Menu.ChatMenus.OnKeyPress(CCSPlayerController player, Int32 key) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Menu/ChatMenu.cs:line 160
   at CounterStrikeSharp.API.Core.Application.<>c.<Start>b__15_0(CCSPlayerController player, CommandInfo info) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Application.cs:line 90
   at CounterStrikeSharp.API.Modules.Utils.CommandUtils.<>c__DisplayClass0_0.<AddStandaloneCommand>b__0(Int32 i, IntPtr ptr) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Utils/StandaloneCommand.cs:line 17
   at InvokeStub_Action`2.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82

@scorp1onul
Copy link
Author

Any updates or fixes?

@roflmuffin
Copy link
Owner

Are you a plugin author or a server host? It would be best to know what ChatMenu code structure is used to cause the error as that would be the best way to solve the issue, as the stack trace doesn't outline it.

@scorp1onul
Copy link
Author

I m an owner. So the problem is from a system that use chat menu?

@roflmuffin
Copy link
Owner

Fixed by #294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@roflmuffin @B3none @mihaigsm2003 @scorp1onul and others