'Exceeded language worker restart retry count for runtime:node. Shutting down and proactively recycling the Functions Host to recover

I am currently trying to do the MS tutorial on Azure serverless webapps, but I am completely stuck. Whenever I try to start the sample, (be it by pressing F5 to debug or by entering func host start directly in the terminal) I get the following error message:

Exceeded language worker restart retry count for runtime:node. Shutting down and proactively recycling the Functions Host to recover

I know there are several seemingly similar threads on that error message, however all of them contain some hidden error message, while for me it simply crashes. No additional error. Nothing. Just to make sure I tried all suggested fixes (except for downgrading Visual Studio Code all the way back to <= 1.39; seems a little radical)

Anyway, here is the --verbose output from running func host start on the official Microsoft tutorial for REST WebApps on Azure (https://docs.microsoft.com/en-us/learn/modules/automatic-update-of-a-webapp-using-azure-functions-and-signalr/3-exercise-analyze-limitations-of-polling-in-a-web-app)

Azure Functions Core Tools
Core Tools Version:       3.0.3331 Commit hash: 0b57b1647c5a385beb8f7d64fa0e534ad4c7555d 
Function Runtime Version: 3.0.15371.0

[2021-03-09T20:46:21.573Z] Building host: startup suppressed: 'False', configuration suppressed: 'False', startup operation id: '48c7f5e8-0450-47e7-8e75-a97c82cde1f7'
[2021-03-09T20:46:21.598Z] Reading host configuration file 'C:\Users\Administrator\source\repos\mslearn-advocates.azure-functions-and-signalr\start\host.json'
[2021-03-09T20:46:21.604Z] Host configuration file read:
[2021-03-09T20:46:21.609Z] {
[2021-03-09T20:46:21.611Z]   "version": "2.0",
[2021-03-09T20:46:21.613Z]   "extensionBundle": {
[2021-03-09T20:46:21.616Z]     "id": "Microsoft.Azure.Functions.ExtensionBundle",
[2021-03-09T20:46:21.617Z]     "version": "[1.*, 2.0.0)"
[2021-03-09T20:46:21.622Z]   }
[2021-03-09T20:46:21.627Z] }
[2021-03-09T20:46:21.641Z] Loading functions metadata
[2021-03-09T20:46:21.675Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:java
[2021-03-09T20:46:21.711Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:powershell
[2021-03-09T20:46:21.715Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:python
[2021-03-09T20:46:21.727Z] Reading functions metadata
[2021-03-09T20:46:21.741Z] 1 functions found
[2021-03-09T20:46:21.774Z] 1 functions loaded
[2021-03-09T20:46:21.781Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at C:\Users\Administrator\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle
[2021-03-09T20:46:21.786Z] Found a matching extension bundle at C:\Users\Administrator\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\1.5.1
[2021-03-09T20:46:21.788Z] Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/index.json
[2021-03-09T20:46:21.992Z] Skipping bundle download since it already exists at path C:\Users\Administrator\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\1.5.1
[2021-03-09T20:46:22.002Z] Loading extension bundle from C:\Users\Administrator\.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle\1.5.1\bin
[2021-03-09T20:46:22.011Z] Loading startup extension 'CosmosDB'
[2021-03-09T20:46:22.042Z] Loaded extension 'CosmosDB' (3.0.7.0)
[2021-03-09T20:46:22.067Z] Reading host configuration file 'C:\Users\Administrator\source\repos\mslearn-advocates.azure-functions-and-signalr\start\host.json'
[2021-03-09T20:46:22.072Z] Host configuration file read:
[2021-03-09T20:46:22.075Z] {
[2021-03-09T20:46:22.077Z]   "version": "2.0",
[2021-03-09T20:46:22.082Z]   "extensionBundle": {
[2021-03-09T20:46:22.084Z]     "id": "Microsoft.Azure.Functions.ExtensionBundle",
[2021-03-09T20:46:22.086Z]     "version": "[1.*, 2.0.0)"
[2021-03-09T20:46:22.088Z]   }
[2021-03-09T20:46:22.093Z] }
[2021-03-09T20:46:22.449Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:java
[2021-03-09T20:46:22.453Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:powershell
[2021-03-09T20:46:22.459Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:python
[2021-03-09T20:46:22.630Z] Initializing Warmup Extension.
[2021-03-09T20:46:22.721Z] Initializing Host. OperationId: '48c7f5e8-0450-47e7-8e75-a97c82cde1f7'.
[2021-03-09T20:46:22.733Z] Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=48c7f5e8-0450-47e7-8e75-a97c82cde1f7
[2021-03-09T20:46:22.764Z] LoggerFilterOptions
[2021-03-09T20:46:22.766Z] {
[2021-03-09T20:46:22.769Z]   "MinLevel": "None",
[2021-03-09T20:46:22.771Z]   "Rules": [
[2021-03-09T20:46:22.773Z]     {
[2021-03-09T20:46:22.776Z]       "ProviderName": null,
[2021-03-09T20:46:22.778Z]       "CategoryName": null,
[2021-03-09T20:46:22.784Z]       "LogLevel": null,
[2021-03-09T20:46:22.787Z]       "Filter": "<AddFilter>b__0"
[2021-03-09T20:46:22.789Z]     },
[2021-03-09T20:46:22.796Z]     {
[2021-03-09T20:46:22.799Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-03-09T20:46:22.801Z]       "CategoryName": null,
[2021-03-09T20:46:22.804Z]       "LogLevel": "None",
[2021-03-09T20:46:22.806Z]       "Filter": null
[2021-03-09T20:46:22.812Z]     },
[2021-03-09T20:46:22.816Z]     {
[2021-03-09T20:46:22.818Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-03-09T20:46:22.821Z]       "CategoryName": null,
[2021-03-09T20:46:22.824Z]       "LogLevel": null,
[2021-03-09T20:46:22.827Z]       "Filter": "<AddFilter>b__0"
[2021-03-09T20:46:22.831Z]     },
[2021-03-09T20:46:22.833Z]     {
[2021-03-09T20:46:22.835Z]       "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2021-03-09T20:46:22.839Z]       "CategoryName": null,
[2021-03-09T20:46:22.842Z]       "LogLevel": null,
[2021-03-09T20:46:22.845Z]       "Filter": "<AddFilter>b__0"
[2021-03-09T20:46:22.847Z]     }
[2021-03-09T20:46:22.850Z]   ]
[2021-03-09T20:46:22.852Z] }
[2021-03-09T20:46:22.855Z] LoggerFilterOptions
[2021-03-09T20:46:22.857Z] {
[2021-03-09T20:46:22.860Z]   "MinLevel": "None",
[2021-03-09T20:46:22.862Z]   "Rules": [
[2021-03-09T20:46:22.864Z]     {
[2021-03-09T20:46:22.866Z]       "ProviderName": null,
[2021-03-09T20:46:22.870Z]       "CategoryName": null,
[2021-03-09T20:46:22.875Z]       "LogLevel": null,
[2021-03-09T20:46:22.877Z]       "Filter": "<AddFilter>b__0"
[2021-03-09T20:46:22.880Z]     },
[2021-03-09T20:46:22.882Z]     {
[2021-03-09T20:46:22.885Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-03-09T20:46:22.886Z]       "CategoryName": null,
[2021-03-09T20:46:22.887Z]       "LogLevel": "None",
[2021-03-09T20:46:22.889Z]       "Filter": null
[2021-03-09T20:46:22.894Z]     },
[2021-03-09T20:46:22.896Z]     {
[2021-03-09T20:46:22.899Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-03-09T20:46:22.902Z]       "CategoryName": null,
[2021-03-09T20:46:22.904Z]       "LogLevel": null,
[2021-03-09T20:46:22.906Z]       "Filter": "<AddFilter>b__0"
[2021-03-09T20:46:22.908Z]     },
[2021-03-09T20:46:22.910Z]     {
[2021-03-09T20:46:22.912Z]       "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2021-03-09T20:46:22.916Z]       "CategoryName": null,
[2021-03-09T20:46:22.922Z]       "LogLevel": null,
[2021-03-09T20:46:22.925Z]       "Filter": "<AddFilter>b__0"
[2021-03-09T20:46:22.927Z]     }
[2021-03-09T20:46:22.930Z]   ]
[2021-03-09T20:46:22.935Z] }
[2021-03-09T20:46:22.938Z] FunctionResultAggregatorOptions
[2021-03-09T20:46:22.939Z] {
[2021-03-09T20:46:22.941Z]   "BatchSize": 1000,
[2021-03-09T20:46:22.943Z]   "FlushTimeout": "00:00:30",
[2021-03-09T20:46:22.944Z]   "IsEnabled": true
[2021-03-09T20:46:22.947Z] }
[2021-03-09T20:46:22.950Z] SingletonOptions
[2021-03-09T20:46:22.954Z] {
[2021-03-09T20:46:22.957Z]   "LockPeriod": "00:00:15",
[2021-03-09T20:46:22.960Z]   "ListenerLockPeriod": "00:00:15",
[2021-03-09T20:46:22.966Z]   "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[2021-03-09T20:46:22.969Z]   "LockAcquisitionPollingInterval": "00:00:05",
[2021-03-09T20:46:22.972Z]   "ListenerLockRecoveryPollingInterval": "00:01:00"
[2021-03-09T20:46:22.975Z] }
[2021-03-09T20:46:22.982Z] CosmosDBOptions
[2021-03-09T20:46:22.984Z] {
[2021-03-09T20:46:22.988Z]   "ConnectionMode": null,
[2021-03-09T20:46:22.990Z]   "Protocol": null,
[2021-03-09T20:46:22.996Z]   "LeaseOptions": {
[2021-03-09T20:46:23.000Z]     "CheckpointFrequency": {
[2021-03-09T20:46:23.002Z]       "ExplicitCheckpoint": false,
[2021-03-09T20:46:23.005Z]       "ProcessedDocumentCount": null,
[2021-03-09T20:46:23.007Z]       "TimeInterval": null
[2021-03-09T20:46:23.010Z]     },
[2021-03-09T20:46:23.012Z]     "FeedPollDelay": "00:00:05",
[2021-03-09T20:46:23.014Z]     "IsAutoCheckpointEnabled": true,
[2021-03-09T20:46:23.018Z]     "LeaseAcquireInterval": "00:00:13",
[2021-03-09T20:46:23.020Z]     "LeaseExpirationInterval": "00:01:00",
[2021-03-09T20:46:23.022Z]     "LeasePrefix": null,
[2021-03-09T20:46:23.023Z]     "LeaseRenewInterval": "00:00:17"
[2021-03-09T20:46:23.025Z]   }
[2021-03-09T20:46:23.030Z] }
[2021-03-09T20:46:23.033Z] HttpOptions
[2021-03-09T20:46:23.035Z] {
[2021-03-09T20:46:23.037Z]   "DynamicThrottlesEnabled": false,
[2021-03-09T20:46:23.040Z]   "MaxConcurrentRequests": -1,
[2021-03-09T20:46:23.042Z]   "MaxOutstandingRequests": -1,
[2021-03-09T20:46:23.045Z]   "RoutePrefix": "api"
[2021-03-09T20:46:23.046Z] }
[2021-03-09T20:46:23.056Z] Starting JobHost
[2021-03-09T20:46:23.063Z] Starting Host (HostId=winjsgvmhodiqa-1589667082, InstanceId=a845d765-026e-497f-9d9b-027ae1354715, Version=3.0.15371.0, ProcessId=23192, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2021-03-09T20:46:23.090Z] Loading functions metadata
[2021-03-09T20:46:23.095Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:java
[2021-03-09T20:46:23.099Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:powershell
[2021-03-09T20:46:23.100Z] FUNCTIONS_WORKER_RUNTIME set to node. Skipping WorkerConfig for language:python
[2021-03-09T20:46:23.107Z] Loading proxies metadata
[2021-03-09T20:46:23.115Z] Initializing Azure Function proxies
[2021-03-09T20:46:23.430Z] 0 proxies loaded
[2021-03-09T20:46:23.482Z] 1 functions loaded
[2021-03-09T20:46:23.537Z] Generating 1 job function(s)
[2021-03-09T20:46:23.578Z] Found the following functions:
[2021-03-09T20:46:23.580Z] Host.Functions.getStocks
[2021-03-09T20:46:23.585Z] 
[2021-03-09T20:46:23.596Z] Initializing function HTTP routes
[2021-03-09T20:46:23.599Z] Mapped function route 'api/getStocks' [get] to 'getStocks'
[2021-03-09T20:46:23.601Z] 
[2021-03-09T20:46:23.613Z] Host initialized (535ms)
[2021-03-09T20:46:23.618Z] Host started (551ms)
[2021-03-09T20:46:23.628Z] Job host started

Functions:

        getStocks: [GET] http://localhost:7071/api/getStocks

[2021-03-09T20:46:25.186Z] Exceeded language worker restart retry count for runtime:node. Shutting down and proactively recycling the Functions Host to recover
[2021-03-09T20:46:25.197Z] Stopping host...
[2021-03-09T20:46:25.210Z] Stopping JobHost
[2021-03-09T20:46:25.217Z] Job host stopped
[2021-03-09T20:46:25.226Z] Host shutdown completed.

Any help would be very welcome!



Solution 1:[1]

If you just let the tutorial run, it will automatically install azure-functions-core-tools@3, which is the current version.

However, the tutorial code only works with version 2.6.666 < v < 3.0

To fix the tutorial run:

npm i -g azure-functions-core-tools@2 --unsafe-perm true

This will install the newest version of version 2. Running the program afterwards will throw warnings because of Azure Functions being outdated. You can simply ignore it, the sample works now.

Solution 2:[2]

Below command has fixed my issue npm i -g azure-functions-core-tools@4

Solution 3:[3]

This is the message I got when trying to run azure functions locally.

This problem may be due to the lack of runners in the package

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andreas P.
Solution 2 Sachin Mishra
Solution 3 Vitaly Bunakov