{"record":{"id":"62ef944e39520f9a","repo":"microsoft/semantic-kernel","slug":"the-step-has-not-been-initialized-62ef94","errorCode":null,"errorMessage":"The step has not been initialized.","messagePattern":"The step has not been initialized\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProxyActor.cs","lineNumber":36,"sourceCode":"\n    internal DaprProxyInfo? _daprProxyInfo;\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"ProxyActor\"/> class.\n    /// </summary>\n    /// <param name=\"host\">The Dapr host actor</param>\n    /// <param name=\"kernel\">An instance of <see cref=\"Kernel\"/></param>\n    public ProxyActor(ActorHost host, Kernel kernel)\n        : base(host, kernel)\n    {\n        this._logger = this._kernel.LoggerFactory?.CreateLogger(typeof(KernelProxyStep)) ?? new NullLogger<ProxyActor>();\n    }\n\n    internal override void AssignStepFunctionParameterValues(ProcessMessage message)\n    {\n        if (this._functions is null || this._inputs is null || this._initialInputs is null)\n        {\n            throw new KernelException(\"The step has not been initialized.\").Log(this._logger);\n        }\n\n        if (message.Values.Count != 1)\n        {\n            throw new KernelException(\"The proxy step can only handle 1 parameter object\").Log(this._logger);\n        }\n\n        // Add the message values to the inputs for the function\n        var kvp = message.Values.Single();\n        if (this._inputs.TryGetValue(message.FunctionName, out Dictionary<string, object?>? functionName) && functionName != null && functionName.TryGetValue(kvp.Key, out object? parameterName) && parameterName != null)\n        {\n            this._logger?.LogWarning(\"Step {StepName} already has input for {FunctionName}.{Key}, it is being overwritten with a message from Step named '{SourceId}'.\", this.Name, message.FunctionName, kvp.Key, message.SourceId);\n        }\n\n        if (!this._inputs.TryGetValue(message.FunctionName, out Dictionary<string, object?>? functionParameters))\n        {\n            this._inputs[message.FunctionName] = [];\n            functionParameters = this._inputs[message.FunctionName];","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Runtime.Dapr/Actors/ProxyActor.cs#L18-L54","documentation":"ProxyActor.AssignStepFunctionParameterValues overrides the base method and checks that _functions, _inputs, and _initialInputs are all non-null before proceeding. These fields are populated during ActivateStepAsync (lazy-initialized via _activateTask). If the proxy step has not completed activation, the check fails with a KernelException.","triggerScenarios":"A ProcessMessage reaches AssignStepFunctionParameterValues before ActivateStepAsync has completed. HandleMessageAsync awaits _activateTask.Value before calling this method, so the throw indicates activation failed silently (Lazy<ValueTask> stored a faulted task), or AssignStepFunctionParameterValues was called from a code path that bypassed the lazy-activation await.","commonSituations":"Activation threw an exception (e.g. step type load failure, DI resolution failure for the KernelProcessStep instance) that was captured in the Lazy<ValueTask> and not surfaced until this check. Also occurs if a subclass or test harness calls AssignStepFunctionParameterValues directly without first triggering activation.","solutions":["Ensure the Kernel instance injected into the ProxyActor has the necessary service registrations for activating KernelProxyStep (ActivatorUtilities.CreateInstance must succeed).","Verify that InitializeStepAsync was called and that _stepInfo is set so ActivateStepAsync can proceed without throwing.","If calling AssignStepFunctionParameterValues directly in a test, first await _activateTask.Value (or call a public method that triggers it) to ensure initialization."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure InitializeStepAsync and activation succeed before sending messages:\nawait proxyActor.InitializeProxyAsync(proxyInfo, parentProcessId);\n// Trigger activation by calling a method that awaits _activateTask, then check for exceptions:\ntry { await proxyStep.PrepareIncomingMessagesAsync(); }\ncatch (Exception ex) { logger.LogError(ex, \"Proxy step activation failed.\"); }","typeGuard":null,"tryCatchPattern":"try\n{\n    await proxyStep.ProcessIncomingMessagesAsync();\n}\ncatch (KernelException ex) when (ex.Message.Contains(\"step has not been initialized\"))\n{\n    logger.LogError(\"Proxy step activation failed. Check Kernel DI registrations and InitializeProxyAsync call.\");\n}","preventionTips":["Ensure InitializeProxyAsync is called and awaited before sending messages.","Verify the Kernel's service provider can resolve all dependencies for KernelProxyStep activation.","Inspect actor logs for the original activation exception that caused the Lazy<ValueTask> to fault."],"tags":["dapr","process-runtime","proxy-step","initialization","semantic-kernel"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}