{"record":{"id":"a40a6213982a30b9","repo":"microsoft/semantic-kernel","slug":"data-persisted-without-type-information","errorCode":null,"errorMessage":"Data persisted without type information.","messagePattern":"Data persisted without type information\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Runtime.Dapr/Serialization/TypeInfo.cs","lineNumber":38,"sourceCode":"        }\n\n        return value.GetType().AssemblyQualifiedName;\n    }\n\n    /// <summary>\n    /// Restore the object's type from the provided assembly qualified type-name, but\n    /// only if it is a <see cref=\"JsonElement\"/>. Otherwise, return the original value.\n    /// </summary>\n    public static object? ConvertValue(string? assemblyQualifiedTypeName, object? value)\n    {\n        if (value == null || value.GetType() != typeof(JsonElement))\n        {\n            return value;\n        }\n\n        if (assemblyQualifiedTypeName == null)\n        {\n            throw new KernelException(\"Data persisted without type information.\");\n        }\n\n        Type? valueType = Type.GetType(assemblyQualifiedTypeName);\n        if (valueType is null)\n        {\n            throw new KernelException($\"Could not load type '{assemblyQualifiedTypeName}'.\");\n        }\n\n        return ((JsonElement)value).Deserialize(valueType);\n    }\n}\n","sourceCodeStart":20,"sourceCodeEnd":50,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Runtime.Dapr/Serialization/TypeInfo.cs#L20-L50","documentation":"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.","triggerScenarios":"ConvertValue receives a JsonElement value but assemblyQualifiedTypeName is null, indicating the original type metadata was not stored alongside the data during persistence.","commonSituations":"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.","solutions":["Ensure the persistence path writes the assembly-qualified type name for every value (set TypeInfo / DataTypeName when serializing).","Upgrade all producers to a version that emits type metadata and re-persist affected data.","If the data is unrecoverable, clear the affected queue entries and re-initialize the process."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (value is JsonElement && string.IsNullOrEmpty(assemblyQualifiedTypeName))\n    throw new InvalidOperationException(\"Cannot restore a JsonElement without its assembly-qualified type name.\");","typeGuard":"public static bool HasTypeMetadata(string? assemblyQualifiedTypeName, object? value) =>\n    value is not JsonElement || !string.IsNullOrEmpty(assemblyQualifiedTypeName);","tryCatchPattern":"try\n{\n    var restored = TypeInfo.ConvertValue(typeName, value);\n}\ncatch (KernelException ex) when (ex.Message.Contains(\"Data persisted without type information\"))\n{\n    _logger.LogError(ex, \"Persistence path omitted type metadata; re-persist with type names.\");\n    throw;\n}","preventionTips":["Always write the assembly-qualified type name when persisting values that become JsonElements.","Upgrade all producers once type metadata is introduced in the schema.","Test persistence round-trips for typed values."],"tags":["dapr","process-runtime","serialization","type-metadata","json"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}