{"record":{"id":"60f2c58a68eb14f5","repo":"stride3d/stride","slug":"unable-to-process-the-given-log-message","errorCode":null,"errorMessage":"Unable to process the given log message.","messagePattern":"Unable to process the given log message\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Debugger/Debugger/GameDebuggerTarget.cs","lineNumber":257,"sourceCode":"        }\n\n        void Log_MessageLogged(object sender, MessageLoggedEventArgs e)\n        {\n            var message = e.Message;\n\n            var serializableMessage = message as SerializableLogMessage;\n            if (serializableMessage == null)\n            {\n                var logMessage = message as LogMessage;\n                if (logMessage != null)\n                {\n                    serializableMessage = new SerializableLogMessage(logMessage);\n                }\n            }\n\n            if (serializableMessage == null)\n            {\n                throw new InvalidOperationException(@\"Unable to process the given log message.\");\n            }\n\n            host.OnLogMessage(serializableMessage);\n        }\n    }\n}\n","sourceCodeStart":239,"sourceCodeEnd":264,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Debugger/Debugger/GameDebuggerTarget.cs#L239-L264","documentation":"GameDebuggerTarget.Log_MessageLogged converts an incoming log message into a SerializableLogMessage so it can be sent over the debugger WCF channel. If the conversion pipeline leaves serializableMessage null (e.g. the source log message could not be matched/converted), the method refuses to forward a null payload and throws this InvalidOperationException. It signals that the debugger target received a log message it does not know how to serialize.","triggerScenarios":"Log_MessageLogged is called with a logMessage whose type or module cannot be mapped to a SerializableLogMessage, so all conversion branches are skipped and serializableMessage remains null at the check at GameDebuggerTarget.cs:257.","commonSituations":"Debugging a live Stride game where the game process logs via an ILogListener path the debugger does not recognize (custom log module, log message emitted before/after attach, or a Stride version mismatch between editor and game producing unmapped message kinds).","solutions":["Check that the game process and Stride.Debugger run matching Stride versions so log message types serialize identically.","Inspect the log message source/module that reached Log_MessageLogged; add or restore the conversion branch that maps it to SerializableLogMessage.","Re-attach the debugger to the running game so log listener registration state is consistent.","If it persists, log the raw message on the game side and file/report the unmapped message type as a Stride debugger bug."],"exampleFix":"// before (GameDebuggerTarget.cs)\nif (serializableMessage == null)\n    throw new InvalidOperationException(@\"Unable to process the given log message.\");\n\n// after (defensive forwarding instead of throwing)\nif (serializableMessage == null)\n{\n    serializableMessage = new SerializableLogMessage(new LogMessage(nameof(GameDebuggerTarget), LogMessageType.Warning, \"Unserializable log message skipped\"));\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// On the game/debugger integration side\ntry { debuggerTarget.Log_MessageLogged(logMessage); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"Unable to process\")) {\n    logger.Warning(\"Debugger could not serialize log message; skipping\");\n}","preventionTips":["Keep game and Stride.Debugger assemblies on the same Stride version","Avoid custom log modules when the game debugger is attached","Re-attach the debugger if log messages appear unmapped"],"tags":["debugger","logging","serialization","invalid-state"],"backgroundTag":"unexpected-response-shape","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}