microsoft/semantic-kernel · error · KernelException

Data persisted without type information.

Error message

Data persisted without type information.

What it means

Thrown by TypeInfo.ConvertValue when a JsonElement value is accompanied by a null assembly-qualified type name. The runtime needs the type name to deserialize the JsonElement back to its original type; absence means the data was persisted without type information and cannot be safely restored.

Source

Thrown at dotnet/src/Experimental/Process.Runtime.Dapr/Serialization/TypeInfo.cs:38

        }

        return value.GetType().AssemblyQualifiedName;
    }

    /// <summary>
    /// Restore the object's type from the provided assembly qualified type-name, but
    /// only if it is a <see cref="JsonElement"/>. Otherwise, return the original value.
    /// </summary>
    public static object? ConvertValue(string? assemblyQualifiedTypeName, object? value)
    {
        if (value == null || value.GetType() != typeof(JsonElement))
        {
            return value;
        }

        if (assemblyQualifiedTypeName == null)
        {
            throw new KernelException("Data persisted without type information.");
        }

        Type? valueType = Type.GetType(assemblyQualifiedTypeName);
        if (valueType is null)
        {
            throw new KernelException($"Could not load type '{assemblyQualifiedTypeName}'.");
        }

        return ((JsonElement)value).Deserialize(valueType);
    }
}

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Ensure the persistence path writes the assembly-qualified type name for every value (set TypeInfo / DataTypeName when serializing).
  2. Upgrade all producers to a version that emits type metadata and re-persist affected data.
  3. If the data is unrecoverable, clear the affected queue entries and re-initialize the process.
Defensive patterns

Strategy: validation

Validate before calling

if (value is JsonElement && string.IsNullOrEmpty(assemblyQualifiedTypeName))
    throw new InvalidOperationException("Cannot restore a JsonElement without its assembly-qualified type name.");

Type guard

public static bool HasTypeMetadata(string? assemblyQualifiedTypeName, object? value) =>
    value is not JsonElement || !string.IsNullOrEmpty(assemblyQualifiedTypeName);

Try / catch

try
{
    var restored = TypeInfo.ConvertValue(typeName, value);
}
catch (KernelException ex) when (ex.Message.Contains("Data persisted without type information"))
{
    _logger.LogError(ex, "Persistence path omitted type metadata; re-persist with type names.");
    throw;
}

Prevention

When it happens

Trigger: ConvertValue receives a JsonElement value but assemblyQualifiedTypeName is null, indicating the original type metadata was not stored alongside the data during persistence.

Common situations: A persistence path that skipped writing the type name, version drift where the type-name field was added/removed, or a custom serializer that does not emit type metadata. Surfaces during event/message replay.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/a40a6213982a30b9. Report an issue: GitHub.