Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
71 stars 72 forks source link

Error configuring services in an external startup class. Microsoft.Azure.Workflows.WebJobs.Extensions #3922

Closed danielenriquez closed 3 months ago

danielenriquez commented 6 months ago

Describe the Bug with repro steps

1-Open Logic App in Visual Studio Code designer

2- Azure Function core tools latest version 4.x

What type of Logic App Is this happening in?

Standard (VSCode)

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

No response

Screenshots or Videos

No response

Browser

Local host, Chome

Additional context

Error configuring services in an external startup class. Microsoft.Azure.Workflows.WebJobs.Extensions: Could not load type 'Microsoft.Azure.WebJobs.Host.Listeners.IListenerDecorator' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.37.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

[2024-01-02T09:19:56.417Z] A host error has occurred during startup operation '3d9931ed-314b-404a-b023-4c81d0086ea0'.

[2024-01-02T09:19:56.417Z] Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. Microsoft.Azure.Workflows.WebJobs.Extensions: Could not load type 'Microsoft.Azure.WebJobs.Host.Listeners.IListenerDecorator' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.37.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Value cannot be null. (Parameter 'provider')

kaivanengineer commented 6 months ago

I am also facing same issue. Is there any solution?

ccastrotrejo commented 6 months ago

Hi all, thanks for raising this issue. It does seem that this is related/duplicated to this https://github.com/Azure/logicapps/issues/943. I know that the issue says that you are using the latest Azure Functions Core tools version 4.x, however, could you please double check that is indeed the 4.0.5455 version or newer?

If issue is still happening, please let me know and I will take a further look. Thanks!

jonesbratconed commented 5 months ago

I have downloaded and installed v4.0.5455, but when running I see this in the output: Azure Functions Core Tools Core Tools Version: 4.0.5198 Commit hash: N/A (64-bit) Function Runtime Version: 4.21.1.20667

Is there a version we should revert to until this can be resolved?

ccastrotrejo commented 5 months ago

Hi @jonesbratconed it seems that you are getting two different versions installed. Unfortunately, there isn't an Azure Logic Apps (Standard) extension that you can revert to, both softwares are handled independently.

Starting with version 2.81.5, the Azure Logic Apps (Standard) extension for Visual Studio Code includes a dependency installer that automatically installs all the required dependencies in a new binary folder. You can check the complete documentation here and learn more about this new feature here.

That been said, it looks like the function core tools the extension is executing is the one installed in the dependencies folder. Could you please check if the func core tools that it's executing has the following path? C:\Users\<your-user-name>\.azurelogicapps\dependencies\FuncCoreTools\func

jonesbratconed commented 5 months ago

We can't install much on C:\ so we use the F:. In VS Code the value for Azure Logic Apps Standard: Func Core Tools Binary Path is F:\Users\\.azurelogicapps\dependencies\FuncCoreTools\func and the DLL has a date of 5/20/2023.

Here is my output: 7:46:22 PM: Running command: "F:\Users\JONESBR\.azurelogicapps\dependencies\FuncCoreTools\func host start --port 8000" with pid: "32752"... NodeJs Binaries: F:\Users\JONESBR\.azurelogicapps\dependencies\NodeJs

Azure Functions Core Tools Core Tools Version: 4.0.5198 Commit hash: N/A (64-bit) Function Runtime Version: 4.21.1.20667

FuncCoreTools Binaries: F:\Users\JONESBR\.azurelogicapps\dependencies\FuncCoreTools [2024-01-09T00:46:29.546Z] Found f:\Repos\LogicApp\logic-dev.csproj. Using for user secrets file configuration. [2024-01-09T00:46:32.172Z] Error configuring services in an external startup class. [2024-01-09T00:46:32.172Z] Error configuring services in an external startup class. Microsoft.Azure.Workflows.WebJobs.Extensions: Could not load type 'Microsoft.Azure.WebJobs.Host.Listeners.IListenerDecorator' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.37.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. [2024-01-09T00:46:32.223Z] A host error has occurred during startup operation 'c735c9c2-991f-48f5-ade7-2c8ac8514c59'. [2024-01-09T00:46:32.309Z] Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. Microsoft.Azure.Workflows.WebJobs.Extensions: Could not load type 'Microsoft.Azure.WebJobs.Host.Listeners.IListenerDecorator' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.37.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Value cannot be null. (Parameter 'provider') [2024-01-09T00:46:32.384Z] Host startup operation has been canceled [2024-01-09T00:46:32.469Z] Azure Storage connection string is empty or invalid. Unable to write diagnostic events. DotNetSDK Binaries: F:\Users\JONESBR\.azurelogicapps\dependencies\DotNetSDK Local binary .NET SDK version 6.0.417 7:47:52 PM: Azure Logic Apps Standard Runtime Dependencies validation and installation completed successfully.

local.settings.json includes "AzureWebJobsStorage": "UseDevelopmentStorage=true",

ccastrotrejo commented 5 months ago

@jonesbratconed ok, that does makes sense now. It does looks like the executed func core tools is the one from the binaries folder, and indeed is not the latest one. There should be a notification experience right after opening vscode which lets you update the func core tools. Another workaround is to delete the complete \dependencies folder to let the extension install the latest dependencies. Let me know if none of these work

image
RensBraksh commented 5 months ago

@ccastrotrejo I didn't get the pop up message, but removing the folder did the trick for me. Thanks!

jonesbratconed commented 5 months ago

I've seen and executed the pop-up, but after deleting the dependencies folder and re-launching VS Code, I have the following output showing it is installing version 4.0.5198

11:08:25 AM: Running command: "F:\Users\JONESBR.azurelogicapps\dependencies\FuncCoreTools\func host start --port 8000" with pid: "50692"... The system cannot find the path specified. NodeJs Binaries: F:\Users\JONESBR.azurelogicapps\dependencies\NodeJs Creating temporary folder... C:\Users\JONESBR\AppData\Local\Temp.azurelogicapps\NodeJs Downloading binaries from: https://nodejs.org/dist/v18.17.1/node-v18.17.1-win-x64.zip Successfullly downloaded NodeJs binaries. Extracting C:\Users\JONESBR\AppData\Local\Temp.azurelogicapps\NodeJs\NodeJs.zip Extraction NodeJs successfully completed. Removed C:\Users\JONESBR\AppData\Local\Temp.azurelogicapps\NodeJs FuncCoreTools Binaries: F:\Users\JONESBR.azurelogicapps\dependencies\FuncCoreTools Creating temporary folder... C:\Users\JONESBR\AppData\Local\Temp.azurelogicapps\FuncCoreTools Downloading binaries from: https://github.com/Azure/azure-functions-core-tools/releases/download/4.0.5198/Azure.Functions.Cli.win-x64.4.0.5198.zip 11:10:50 AM: Error in dependencies validation and installation: "{0}"... Successfullly downloaded FuncCoreTools binaries. Extracting C:\Users\JONESBR\AppData\Local\Temp.azurelogicapps\FuncCoreTools\FuncCoreTools.zip Extraction FuncCoreTools successfully completed. Removed C:\Users\JONESBR\AppData\Local\Temp.azurelogicapps\FuncCoreTools

image

jonesbratconed commented 5 months ago

I manually downloaded the zip for 5455 and extracted to the dependencies folder. This resolved the problem. Still uncertain why the dependency installer didn't install the correct version.

ccastrotrejo commented 5 months ago

Hi @jonesbratconed I am glad the workaround of manually downloading the zip worked. The 4.0.5198 is a fallback version that we relied on when there is an error while getting/setting the latest version of func core tools. Something went wrong in this line 11:10:50 AM: Error in dependencies validation and installation: "{0}"..., however it didn't log correctly, (we will fix this in the next release). I wonder if the error logged somewhere else in the output tab or terminal. Is there any chance you can check if the error is logging in either of those?

I will update the fallback version.

jonesbratconed commented 5 months ago

That was from the output. This was in the Terminal, but not sure datetime logged: Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.

PS F:\Repos\LogicApp> func --version node:events:491 throw er; // Unhandled 'error' event ^

Error: spawn C:\Users\JONESBR\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin/func ENOENT at ChildProcess._handle.onexit (node:internal/child_process:283:19) at onErrorNT (node:internal/child_process:476:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) Emitted 'error' event on ChildProcess instance at: at ChildProcess._handle.onexit (node:internal/child_process:289:12) at onErrorNT (node:internal/child_process:476:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -4058, code: 'ENOENT', syscall: 'spawn C:\Users\JONESBR\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin/func', path: 'C:\Users\JONESBR\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin/func', spawnargs: [ '--version' ] }

Node.js v18.16.1

ccastrotrejo commented 4 months ago

Hi @danielenriquez, @jonesbratconed Is this issue still happening?

jonesbratconed commented 3 months ago

I was able to do the latest upgrade today and can still open the designer and everything seems to be working as expected.

ccastrotrejo commented 3 months ago

@jonesbratconed Good to hear that. I will close the issue if anyone experiences this error again, I will reopen it and take a further look.