{"record":{"id":"974ecf622cc1b33b","repo":"microsoft/semantic-kernel","slug":"unable-to-read-state-from-proxy-with-name-this-s","errorCode":null,"errorMessage":"Unable to read state from proxy with name '{this.State.Name}', Id '{this.State.Id}' and type {this.State.GetType()}.","messagePattern":"Unable to read state from proxy with name '(.+?)', Id '(.+?)' and type (.+?)\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Runtime.Dapr/DaprProxyInfo.cs","lineNumber":30,"sourceCode":"[KnownType(typeof(KernelProcessStepState<>))]\npublic sealed record DaprProxyInfo : DaprStepInfo\n{\n    /// <summary>\n    /// Proxy related data to be able to emit the events externally\n    /// </summary>\n    public required KernelProcessProxyStateMetadata? ProxyMetadata { get; init; }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"KernelProcessMap\"/> class from this instance of <see cref=\"DaprMapInfo\"/>.\n    /// </summary>\n    /// <returns>An instance of <see cref=\"KernelProcessMap\"/></returns>\n    /// <exception cref=\"KernelException\"></exception>\n    public KernelProcessProxy ToKernelProcessProxy()\n    {\n        KernelProcessStepInfo processStepInfo = this.ToKernelProcessStepInfo();\n        if (this.State is not KernelProcessStepState state)\n        {\n            throw new KernelException($\"Unable to read state from proxy with name '{this.State.Name}', Id '{this.State.Id}' and type {this.State.GetType()}.\");\n        }\n\n        return new KernelProcessProxy(state, this.Edges)\n        {\n            ProxyMetadata = this.ProxyMetadata,\n        };\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DaprProxyInfo\"/> class from an instance of <see cref=\"KernelProcessProxy\"/>.\n    /// </summary>\n    /// <param name=\"kernelProxyInfo\">The <see cref=\"KernelProcessProxy\"/> used to build the <see cref=\"DaprProxyInfo\"/></param>\n    /// <returns></returns>\n    public static DaprProxyInfo FromKernelProxyInfo(KernelProcessProxy kernelProxyInfo)\n    {\n        Verify.NotNull(kernelProxyInfo, nameof(kernelProxyInfo));\n\n        DaprStepInfo proxyStepInfo = DaprStepInfo.FromKernelStepInfo(kernelProxyInfo);","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Runtime.Dapr/DaprProxyInfo.cs#L12-L48","documentation":"Thrown when reconstructing a KernelProcessProxy from a DaprProxyInfo whose State is not a KernelProcessStepState. Proxy state must deserialize to the base step state type; otherwise the runtime cannot rebuild the proxy object.","triggerScenarios":"DaprProxyInfo.ToKernelProcessProxy() checks `this.State is KernelProcessStepState` and fails when the deserialized state is an incompatible type. Includes the actual State.GetType() in the message to aid diagnosis.","commonSituations":"Deserialization polymorphism misconfiguration, version drift where KernelProcessStepState was subclassed or renamed, or a proxy entry whose persisted JSON lacks the correct type discriminator.","solutions":["Check the GetType() value reported in the message to identify what concrete state type was actually deserialized.","Align serialization settings and the Semantic Kernel version across persist and load.","Verify the persisted JSON carries the expected state discriminator and re-persist if schema changed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (daprProxyInfo.State is not KernelProcessStepState)\n{\n    throw new InvalidOperationException($\"Expected KernelProcessStepState but got {daprProxyInfo.State?.GetType()}.\");\n}","typeGuard":"public static bool IsValidProxyState(DaprProxyInfo info) =>\n    info.State is KernelProcessStepState;","tryCatchPattern":"try\n{\n    var proxy = daprProxyInfo.ToKernelProcessProxy();\n}\ncatch (KernelException ex) when (ex.Message.Contains(\"Unable to read state from proxy\"))\n{\n    _logger.LogError(ex, \"Proxy state schema mismatch; actual type: see message.\");\n    throw;\n}","preventionTips":["Inspect the GetType() reported in the message to diagnose the actual state type.","Align serialization settings across versions.","Test proxy state round-trips."],"tags":["dapr","process-runtime","serialization","proxy-state","schema-mismatch"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}