{"record":{"id":"02a16f8156855ef9","repo":"microsoft/semantic-kernel","slug":"process-not-found","errorCode":null,"errorMessage":"Process not found","messagePattern":"Process not found","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.IntegrationTestRunner.Dapr/DaprTestProcessContext.cs","lineNumber":59,"sourceCode":"    /// <returns></returns>\n    internal async Task StartWithEventAsync(KernelProcessEvent initialEvent)\n    {\n        var daprProcess = DaprProcessInfo.FromKernelProcess(this._process);\n        var request = new ProcessStartRequest { Process = daprProcess, InitialEvent = initialEvent.ToJson() };\n\n        var response = await this._httpClient.PostAsJsonAsync($\"http://localhost:5200/processes/{this._processId}\", request, options: this._serializerOptions).ConfigureAwait(false);\n        if (!response.IsSuccessStatusCode)\n        {\n            throw new InvalidOperationException(\"Failed to start process\");\n        }\n    }\n\n    public override async Task<KernelProcess> GetStateAsync()\n    {\n        var response = await this._httpClient.GetFromJsonAsync<DaprProcessInfo>($\"http://localhost:5200/processes/{this._processId}\", options: this._serializerOptions);\n        return response switch\n        {\n            null => throw new InvalidOperationException(\"Process not found\"),\n            _ => response.ToKernelProcess()\n        };\n    }\n\n    public override Task SendEventAsync(KernelProcessEvent processEvent)\n    {\n        throw new NotImplementedException();\n    }\n\n    public override Task StopAsync()\n    {\n        throw new NotImplementedException();\n    }\n\n    public override async Task<IExternalKernelProcessMessageChannel?> GetExternalMessageChannelAsync()\n    {\n        var response = await this._httpClient.GetFromJsonAsync<MockCloudEventClient>($\"http://localhost:5200/processes/{this._processId}/mockCloudClient\", options: this._serializerOptions);\n        return response switch","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.IntegrationTestRunner.Dapr/DaprTestProcessContext.cs#L41-L77","documentation":"Thrown by `DaprTestProcessContext.GetStateAsync` when `GetFromJsonAsync<DaprProcessInfo>` returns null for the process state endpoint on port 5200. A null deserialization result means the host responded with empty or non-JSON content for the given process id. It is an InvalidOperationException.","triggerScenarios":"Request state for a `_processId` that was never started or has been evicted; the host returns an empty 200 body; deserialization into `DaprProcessInfo` yields null due to a schema/JSON mismatch.","commonSituations":"Querying state before the process is fully started; the Dapr host lost/restarted the process; version mismatch between client and host `DaprProcessInfo` shapes; wrong process id.","solutions":["Confirm `_processId` was returned by a successful start call and is still active on the host.","Check the host logs/health and retry after the process is confirmed running.","Verify client and host agree on the `DaprProcessInfo` schema/version."],"exampleFix":"// before\nvar response = await this._httpClient.GetFromJsonAsync<DaprProcessInfo>(url);\nreturn response;\n// after\nvar response = await this._httpClient.GetAsync(url);\nresponse.EnsureSuccessStatusCode();\nvar info = await response.Content.ReadFromJsonAsync<DaprProcessInfo>();\nreturn info ?? throw new InvalidOperationException($\"Process {_processId} returned empty state\");","handlingStrategy":"retry","validationCode":"using var probe = await httpClient.GetAsync($\"http://localhost:5200/processes/{processId}\");\nif (!probe.IsSuccessStatusCode)\n    throw new InvalidOperationException($\"Process {processId} not reachable: {probe.StatusCode}\");\n// then call GetStateAsync()","typeGuard":"bool ProcessIdLooksValid(string id) => !string.IsNullOrWhiteSpace(id);","tryCatchPattern":"try { var state = await context.GetStateAsync(); }\ncatch (InvalidOperationException ex) when (ex.Message == \"Process not found\")\n{ _logger.LogError(ex, \"Process {Id} not found on Dapr host.\", processId); throw; }","preventionTips":["Only query state for ids returned by a successful start.","Confirm host/client schema versions match.","Retry once after a short delay if the host may still be initializing."],"tags":["dapr","process-framework","integration-tests","network","http"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}