{"record":{"id":"1e998f9591de708c","repo":"microsoft/semantic-kernel","slug":"unable-to-read-state-from-process-with-name-this","errorCode":null,"errorMessage":"Unable to read state from process with name '{this.State.Name}' and Id '{this.State.Id}'.","messagePattern":"Unable to read state from process with name '(.+?)' and Id '(.+?)'\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Runtime.Dapr/DaprProcessInfo.cs","lineNumber":33,"sourceCode":"[KnownType(typeof(KernelProcessStepState<>))]\npublic sealed record DaprProcessInfo : DaprStepInfo\n{\n    /// <summary>\n    /// The collection of Steps in the Process.\n    /// </summary>\n    public required IList<DaprStepInfo> Steps { get; init; }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"KernelProcess\"/> class from this instance of <see cref=\"DaprProcessInfo\"/>.\n    /// </summary>\n    /// <returns>An instance of <see cref=\"KernelProcess\"/></returns>\n    /// <exception cref=\"KernelException\"></exception>\n    public KernelProcess ToKernelProcess()\n    {\n        var processStepInfo = this.ToKernelProcessStepInfo();\n        if (this.State is not KernelProcessState state)\n        {\n            throw new KernelException($\"Unable to read state from process with name '{this.State.Name}' and Id '{this.State.Id}'.\");\n        }\n\n        List<KernelProcessStepInfo> steps = [];\n        foreach (var step in this.Steps)\n        {\n            if (step is DaprProcessInfo processStep)\n            {\n                steps.Add(processStep.ToKernelProcess());\n            }\n            else if (step is DaprMapInfo mapStep)\n            {\n                steps.Add(mapStep.ToKernelProcessMap());\n            }\n            else if (step is DaprProxyInfo proxyStep)\n            {\n                steps.Add(proxyStep.ToKernelProcessProxy());\n            }\n            else","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Runtime.Dapr/DaprProcessInfo.cs#L15-L51","documentation":"Thrown when reconstructing a KernelProcess from a DaprProcessInfo whose State is not a KernelProcessState. The top-level process object must carry a KernelProcessState; a different concrete state type signals schema or serialization drift.","triggerScenarios":"DaprProcessInfo.ToKernelProcess() checks `this.State is KernelProcessState` and fails when the deserialized State is some other KernelProcessStepState subtype.","commonSituations":"Runtime version mismatch between the process that persisted state to Dapr and the runtime reading it, or a corrupted/partially-written actor state entry. Also possible after refactors that changed the state class hierarchy.","solutions":["Align the Semantic Kernel version used to read the process with the version that wrote it.","Verify JSON polymorphism / $type discriminators are configured so State deserializes as KernelProcessState for processes.","Inspect the persisted actor state for the process to confirm the State payload shape.","Clear and re-initialize the affected process instance if state was corrupted."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (daprProcessInfo.State is not KernelProcessState)\n{\n    throw new InvalidOperationException($\"Expected KernelProcessState but got {daprProcessInfo.State.GetType()}.\");\n}","typeGuard":"public static bool IsValidProcessState(DaprProcessInfo info) =>\n    info.State is KernelProcessState;","tryCatchPattern":"try\n{\n    var process = daprProcessInfo.ToKernelProcess();\n}\ncatch (KernelException ex) when (ex.Message.Contains(\"Unable to read state from process\"))\n{\n    _logger.LogError(ex, \"Process state schema mismatch; check version compatibility.\");\n    throw;\n}","preventionTips":["Keep persisting and loading runtime versions aligned.","Validate the State JSON payload shape before conversion.","Add round-trip serialization tests for process state."],"tags":["dapr","process-runtime","serialization","process-state","schema-mismatch"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}