stride3d/stride · error · InvalidOperationException

Unable to process the given log message.

Error message

Unable to process the given log message.

What it means

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.

Solutions

  1. Check that the game process and Stride.Debugger run matching Stride versions so log message types serialize identically.
  2. Inspect the log message source/module that reached Log_MessageLogged; add or restore the conversion branch that maps it to SerializableLogMessage.
  3. Re-attach the debugger to the running game so log listener registration state is consistent.
  4. If it persists, log the raw message on the game side and file/report the unmapped message type as a Stride debugger bug.

Example fix

// before (GameDebuggerTarget.cs)
if (serializableMessage == null)
    throw new InvalidOperationException(@"Unable to process the given log message.");

// after (defensive forwarding instead of throwing)
if (serializableMessage == null)
{
    serializableMessage = new SerializableLogMessage(new LogMessage(nameof(GameDebuggerTarget), LogMessageType.Warning, "Unserializable log message skipped"));
}
Defensive patterns

Strategy: try-catch

Try / catch

// On the game/debugger integration side
try { debuggerTarget.Log_MessageLogged(logMessage); }
catch (InvalidOperationException ex) when (ex.Message.Contains("Unable to process")) {
    logger.Warning("Debugger could not serialize log message; skipping");
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/60f2c58a68eb14f5. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.Debugger/Debugger/GameDebuggerTarget.cs:257

        }

        void Log_MessageLogged(object sender, MessageLoggedEventArgs e)
        {
            var message = e.Message;

            var serializableMessage = message as SerializableLogMessage;
            if (serializableMessage == null)
            {
                var logMessage = message as LogMessage;
                if (logMessage != null)
                {
                    serializableMessage = new SerializableLogMessage(logMessage);
                }
            }

            if (serializableMessage == null)
            {
                throw new InvalidOperationException(@"Unable to process the given log message.");
            }

            host.OnLogMessage(serializableMessage);
        }
    }
}

View on GitHub (pinned to 96fad776d2)