microsoft/semantic-kernel · error · KernelException
Unable to deserialize ProcessEvent queue.
Error message
Unable to deserialize ProcessEvent queue.
What it means
Thrown when JSON deserialization of a ProcessEvent entry yields null. Each entry in the event collection is expected to deserialize into an EventContainer<ProcessEvent>; a null result indicates malformed or incompatible JSON.
Source
Thrown at dotnet/src/Experimental/Process.Runtime.Dapr/Serialization/ProcessEventSerializer.cs:40
EventContainer<ProcessEvent> containedEvent = new(TypeInfo.GetAssemblyQualifiedType(processEvent.Data), processEvent);
return JsonSerializer.Serialize(containedEvent);
}
/// <summary>
/// Deserialize a list of JSON events into a list of <see cref="ProcessEvent"/> objects.
/// </summary>
/// <exception cref="KernelException">If any event fails deserialization</exception>
public static IList<ProcessEvent> ToProcessEvents(this IEnumerable<string> jsonEvents)
{
return Deserialize().ToArray();
IEnumerable<ProcessEvent> Deserialize()
{
foreach (string json in jsonEvents)
{
EventContainer<ProcessEvent> eventContainer =
JsonSerializer.Deserialize<EventContainer<ProcessEvent>>(json) ??
throw new KernelException($"Unable to deserialize {nameof(ProcessEvent)} queue.");
yield return eventContainer.Payload with { Data = TypeInfo.ConvertValue(eventContainer.DataTypeName, eventContainer.Payload.Data) };
}
}
}
}
View on GitHub (pinned to c028a0c7dc)
Solutions
- Inspect each JSON entry in the collection to find the one producing null and verify it matches the EventContainer<ProcessEvent> shape.
- Align producer and consumer serialization versions.
- Quarantine or remove malformed entries; consider adding tolerant deserialization that skips bad entries instead of aborting.
- Validate JSON shape (presence of 'Payload' and 'DataTypeName' fields) before deserializing.
Defensive patterns
Strategy: validation
Validate before calling
var valid = jsonEvents.Where(j => !string.IsNullOrWhiteSpace(j) && j.Trim() != "null").ToList(); var events = valid.ToProcessEvents();
Type guard
public static bool IsValidEventJson(string json) =>
!string.IsNullOrWhiteSpace(json) && json.TrimStart().StartsWith("{"); Try / catch
try
{
var events = jsonEvents.ToProcessEvents();
}
catch (KernelException ex) when (ex.Message.Contains("Unable to deserialize ProcessEvent queue"))
{
_logger.LogError(ex, "One or more event entries are malformed; inspect the batch.");
throw;
} Prevention
- Filter null/literal-null entries before batch deserialization.
- Align producer/consumer serialization versions.
- Add per-entry try/catch to isolate bad entries.
When it happens
Trigger: ProcessEventSerializer.ToProcessEvents iterates a collection of JSON strings and deserializes each; any entry that deserializes to null triggers the exception, aborting the whole batch.
Common situations: Corrupted or version-mismatched event payloads persisted in Dapr, partial writes, or entries produced by a producer using a different serialization contract.
Related errors
- Unable to deserialize KernelProcessEvent queue.
- Unable to deserialize ProcessMessage queue.
- Data persisted without type information.
- Unable to read state from map with name '{this.State.Name}'
- Unable to read state from process with name '{this.State.Nam
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/0d4de39d3d1b07cf.
Report an issue: GitHub.