c# - runtime:node 的语言工作者重新启动重试次数已超过。关闭并主动回收 Functions Host 以恢复
问题描述
我目前正在尝试在 Azure 无服务器 webapps 上做 MS 教程,但我完全卡住了。每当我尝试启动示例时(无论是按 F5 进行调试还是func host start
直接在终端中输入),我都会收到以下错误消息:
runtime:node 的语言工作者重新启动重试次数已超过。关闭并主动回收 Functions Host 以恢复
我知道该错误消息上有几个看似相似的线程,但是它们都包含一些隐藏的错误消息,而对我来说它只是崩溃了。没有额外的错误。没有。只是为了确保我尝试了所有建议的修复(除了将 Visual Studio Code 降级到 <= 1.39;似乎有点激进)
无论如何,这是在 Azure 上的 REST WebApps 官方 Microsoft 教程上--verbose
运行的输出( 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 )func host start
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.
非常欢迎任何帮助!
解决方案
如果只是让教程运行,它会自动安装azure-functions-core-tools@3
,即当前版本。
但是,教程代码仅适用于版本 2.6.666 < v < 3.0
要修复教程运行:
npm i -g azure-functions-core-tools@2 --unsafe-perm true
这将安装版本 2 的最新版本。之后运行该程序将引发警告,因为 Azure Functions 已过时。您可以简单地忽略它,该示例现在可以使用。
推荐阅读
- c - GCC 关于在偏移量处访问字节的警告:GCC 抱怨什么?
- outlook-addin - 根据官方指南,Web Outlook 加载项侧载失败
- c# - 用于 ASP.NET Core Web 应用和辅助服务的通用数据库访问存储库 - 管理上下文
- python - 如何从 gcloud 中的版本恢复文件
- java - 模拟组件在 WebMvcTest 中显示为空
- java - Mockito 不模拟类 ThreadLocal
- java - 如何在 Android 上获得将文件保存到 SD 卡的权限
- ef-core-3.1 - 在 where 子句中的 FUNC 谓词中使用 Any() 、 Contains() 等辅助方法不会被转换为 Sql Server,因此会出错
- javascript - 用外键构造数据表
- javascript - 无法在 vue js 中将虚拟 js 数据提取到我的表中