Dedicated Server crashes when receiving API chat with missing parameters
Investigating
When a POST request is sent to the /v1/vrageclient/session/chat API route that doesn't contain all of the necessary parameters (of which there is no documentation), the server crashes entirely rather than handling the empty message.
Exception occurred: System.InvalidOperationException: Error serializing ChatMsg.Text, member contains null, but it's not allowed, consider adding attribute [Serialize(MyObjectFlags.Nullable)] ---> VRage.Serialization.MySerializeException: Exception of type 'VRage.Serialization.MySerializeException' was thrown.Full crash stack attached.
While this is a rather obscure crash that is not likely with standard tools, it is not impossible to occur.
Files:
SpaceEngineersD...
Hello,
Thank you very much for your detailed report and for providing the crash log.
We sincerely apologize for the delayed response to this thread.
As the shared log appears to be incomplete, we’d appreciate it if you could help us gather a bit more information so we can investigate further.
Are you using any MODs or custom Scripts on your server?
If the Script was created by you, could you kindly share the exact script you're using with us?
If the issue occurred on a vanilla setup, could you please provide detailed steps to reproduce it?
Additionally, could you provide the full game log file from the session in which the crash occurred?
This information will help us determine whether the behavior is caused by an external script or MOD, or if it is purely a vanilla issue.
Thank you again for taking the time to report this.
Kind Regards,
Keen Software House: QA Department
Hello,
Thank you very much for your detailed report and for providing the crash log.
We sincerely apologize for the delayed response to this thread.
As the shared log appears to be incomplete, we’d appreciate it if you could help us gather a bit more information so we can investigate further.
Are you using any MODs or custom Scripts on your server?
If the Script was created by you, could you kindly share the exact script you're using with us?
If the issue occurred on a vanilla setup, could you please provide detailed steps to reproduce it?
Additionally, could you provide the full game log file from the session in which the crash occurred?
This information will help us determine whether the behavior is caused by an external script or MOD, or if it is purely a vanilla issue.
Thank you again for taking the time to report this.
Kind Regards,
Keen Software House: QA Department
No mods or scripts were in use that would affect the outcome.
In order to show this, I spun up a test server, completely vanilla with all settings default.
I sent a single API request, per the documentation on the VRAGE Remote API present at https://www.spaceengineersgame.com/dedicated-servers/
It was a POST request to /v1/session/chat, and contained a single parameter 'Message="Test"'
This parameter is clearly not the correct name (because it causes the crash).
The VRAGE API responds to the call with {"meta":{"apiVersion":"1.0","queryTime":37.1522}}
So it confirms receipt of the call, but the server immediately crashes after responding.
Note: between the actual error message in the logs (ChatMsg.Text is null when not able to be null) and the fact that calls to other API endpoints, such as v1/session/players and v1/server, are successful, proves that the call itself is being performed correctly.
It is definitively the fact that a required parameter is missing that causes the crash.
Full log attached
While you might be tempted to say "this isn't a bug because you're not providing the necessary parameters" - First of all, lacking parameters on an API call should be gracefully handled, it should not cause the entire server to crash. Second, there is no documentation on what the required parameters are.
When calling the 'api' endpoint (to get a list of API functions) the section for sending a message to the global chat is...
The description offers no indicator of the names of the required parameter(s). There is no documentation what parameters are required for this API endpoint, so I have no way of knowing what to use.No mods or scripts were in use that would affect the outcome.
In order to show this, I spun up a test server, completely vanilla with all settings default.
I sent a single API request, per the documentation on the VRAGE Remote API present at https://www.spaceengineersgame.com/dedicated-servers/
It was a POST request to /v1/session/chat, and contained a single parameter 'Message="Test"'
This parameter is clearly not the correct name (because it causes the crash).
The VRAGE API responds to the call with {"meta":{"apiVersion":"1.0","queryTime":37.1522}}
So it confirms receipt of the call, but the server immediately crashes after responding.
Note: between the actual error message in the logs (ChatMsg.Text is null when not able to be null) and the fact that calls to other API endpoints, such as v1/session/players and v1/server, are successful, proves that the call itself is being performed correctly.
It is definitively the fact that a required parameter is missing that causes the crash.
Full log attached
While you might be tempted to say "this isn't a bug because you're not providing the necessary parameters" - First of all, lacking parameters on an API call should be gracefully handled, it should not cause the entire server to crash. Second, there is no documentation on what the required parameters are.
When calling the 'api' endpoint (to get a list of API functions) the section for sending a message to the global chat is...
The description offers no indicator of the names of the required parameter(s). There is no documentation what parameters are required for this API endpoint, so I have no way of knowing what to use.Replies have been locked on this page!