Azure 隔离功能应用程序 (.net 8) 无法启动

问题描述 投票:0回答:1

我的.Net 8 Azure独立功能应用程序根本没有给我任何有用的信息。

这是日志流的输出。我怎样才能知道发生了什么?

2024-04-06T20:52:35.137Z INFO  - Pulling image: mcr.microsoft.com/appsvc/msitokenservice:stage4
2024-04-06T20:52:35.318Z INFO  - stage4 Pulling from appsvc/msitokenservice
2024-04-06T20:52:35.330Z INFO  -  Digest: sha256:15c4360552ca5d886db18e4eaa6a95993305c67dae381aa8505592cd7c45bd46
2024-04-06T20:52:35.331Z INFO  -  Status: Image is up to date for mcr.microsoft.com/appsvc/msitokenservice:stage4
2024-04-06T20:52:35.350Z INFO  - Pull Image successful, Time taken: 0 Seconds
2024-04-06T20:52:35.473Z INFO  - Starting container for site
2024-04-06T20:52:35.474Z INFO  - docker run -d --expose=8081 --name company-dev-uks-app_0_f49af447_msiProxy -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=company-dev-uks-app.azurewebsites.net -e WEBSITE_INSTANCE_ID=6302fe6b4d27f9dafb30e05389768b6c8d72117042a7b0c519f5e06d6c893fcb -e HTTP_LOGGING_ENABLED=1 mcr.microsoft.com/appsvc/msitokenservice:stage4 
b4d27f9dafb30e05389768b6c8d72117042a7b0c519f5e06d6c893fcb -e HTTP_LOGGING_ENABLED=1 mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0-appservice-stage4 
2024-04-06T20:52:51.754Z INFO  - Initiating warmup request to container company-dev-uks-app_0_f49af447_msiProxy for site company-dev-uks-app
2024-04-06T20:52:51.804Z INFO  - Container company-dev-uks-app_0_f49af447_msiProxy for site company-dev-uks-app initialized successfully and is ready to serve requests.
2024-04-06T20:52:51.804Z INFO  - Initiating warmup request to container company-dev-uks-app_0_f49af447 for site company-dev-uks-app
2024-04-06T20:53:00.732 [Information] Using the default storage provider: AzureStorage.
2024-04-06T20:53:03.836 [Information] Reading APPLICATIONINSIGHTS_CONNECTION_STRING.... InstanceId: . Function: . HubName: CompanyAppSystem. AppName: company-dev-uks-app. SlotName: Production. ExtensionVersion: 2.13.2. SequenceNumber: 0.
2024-04-06T20:53:03.856 [Information] Initializing Warmup Extension.
2024-04-06T20:53:06.040 [Information] Durable extension configuration loaded: {"httpSettings":{"defaultAsyncRequestSleepTimeMilliseconds":30000},"hubName":"CompanyAppSystem","storageProvider":{"connectionName":"AzureWebJobsStorage","connectionStringName":"AzureWebJobsStorage","controlQueueBatchSize":32,"partitionCount":4,"controlQueueBufferThreshold":256,"controlQueueVisibilityTimeout":"00:05:00","workItemQueueVisibilityTimeout":"00:05:00","trackingStoreConnectionName":null,"trackingStoreConnectionStringName":null,"trackingStoreNamePrefix":null,"fetchLargeMessagesAutomatically":true,"maxQueuePollingInterval":"00:00:30","useLegacyPartitionManagement":false,"useTablePartitionManagement":false},"tracing":{"traceInputsAndOutputs":false,"allowVerboseLinuxTelemetry":false,"traceReplayEvents":false,"distributedTracingEnabled":true,"distributedTracingProtocol":"HttpCorrelationProtocol","version":"V2"},"notifications":{"eventGrid":null},"maxConcurrentActivityFunctions":10,"maxConcurrentOrchestratorFunctions":10,"maxConcurrentEntityFunctions":10,"localRpcEndpointEnabled":null,"maxEntityOperationBatchSize":5000,"extendedSessionsEnabled":false,"extendedSessionIdleTimeoutInSeconds":30,"maxOrchestrationActions":100000,"overridableExistingInstanceStates":"NonRunningStates","entityMessageReorderWindowInMinutes":30,"useGracefulShutdown":false,"rollbackEntityOperationsOnExceptions":true,"throwStatusExceptionsOnRaiseEvent":null,"useAppLease":true,"storeInputsInOrchestrationHistory":false,"appLeaseOptions":{"renewInterval":"00:00:25","acquireInterval":"00:05:00","leaseInterval":"00:01:00"}}. HubName: CompanyAppSystem. AppName: company-dev-uks-app. SlotName: Production. ExtensionVersion: 2.13.2.
2024-04-06T20:53:06.732 [Information] Opened local gRPC endpoint: http://localhost:4001. InstanceId: . Function: . HubName: CompanyAppSystem. AppName: company-dev-uks-app. SlotName: Production. ExtensionVersion: 2.13.2. SequenceNumber: 0.
2024-04-06T20:53:06.884 [Information] Initializing Host. OperationId: '779a2840-27bf-43ff-9794-71468f4894c4'.
2024-04-06T20:53:06.904 [Information] Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=779a2840-27bf-43ff-9794-71468f4894c4
2024-04-06T20:53:07.338 [Information] ApplicationInsightsLoggerOptions
{
  "SamplingSettings": {
    "EvaluationInterval": "00:00:15",
    "InitialSamplingPercentage": 100.0,
    "MaxSamplingPercentage": 100.0,
    "MaxTelemetryItemsPerSecond": 20.0,
    "MinSamplingPercentage": 0.1,
    "MovingAverageRatio": 0.25,
    "SamplingPercentageDecreaseTimeout": "00:02:00",
    "SamplingPercentageIncreaseTimeout": "00:15:00"
  },
  "SamplingExcludedTypes": null,
  "SamplingIncludedTypes": null,
  "SnapshotConfiguration": null,
  "EnablePerformanceCountersCollection": true,
  "HttpAutoCollectionOptions": {
    "EnableHttpTriggerExtendedInfoCollection": true,
    "EnableW3CDistributedTracing": true,
    "EnableResponseHeaderInjection": true
  },
  "LiveMetricsInitializationDelay": "00:00:15",
  "EnableLiveMetrics": true,
  "EnableLiveMetricsFilters": false,
  "EnableQueryStringTracing": false,
  "EnableDependencyTracking": true,
  "DependencyTrackingOptions": null,
  "TokenCredentialOptions": null,
  "DiagnosticsEventListenerLogLevel": null,
  "EnableAutocollectedMetricsExtractor": false,
  "EnableMetricsCustomDimensionOptimization": false
}
2024-04-06T20:53:07.338 [Information] LoggerFilterOptions
{
  "MinLevel": "None",
  "Rules": [
    {
      "ProviderName": null,
      "CategoryName": null,
      "LogLevel": null,
      "Filter": "<AddFilter>b__0"
    },
    {
      "ProviderName": null,
      "CategoryName": "Host.Results",
      "LogLevel": "Information",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "Host.Aggregator",
      "LogLevel": "Information",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "Function",
      "LogLevel": "Information",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": null,
      "LogLevel": "Information",
      "Filter": null
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
      "CategoryName": null,
      "LogLevel": "None",
      "Filter": null
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
      "CategoryName": null,
      "LogLevel": null,
      "Filter": "<AddFilter>b__0"
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Logging.ApplicationInsights.ApplicationInsightsLoggerProvider",
      "CategoryName": null,
      "LogLevel": "Trace",
      "Filter": null
    }
  ]
}
2024-04-06T20:53:07.338 [Information] LoggerFilterOptions
{
  "MinLevel": "None",
  "Rules": [
    {
      "ProviderName": null,
      "CategoryName": null,
      "LogLevel": null,
      "Filter": "<AddFilter>b__0"
    },
    {
      "ProviderName": null,
      "CategoryName": "Host.Results",
      "LogLevel": "Information",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "Host.Aggregator",
      "LogLevel": "Information",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "Function",
      "LogLevel": "Information",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": null,
      "LogLevel": "Information",
      "Filter": null
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
      "CategoryName": null,
      "LogLevel": "None",
      "Filter": null
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
      "CategoryName": null,
      "LogLevel": null,
      "Filter": "<AddFilter>b__0"
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Logging.ApplicationInsights.ApplicationInsightsLoggerProvider",
      "CategoryName": null,
      "LogLevel": "Trace",
      "Filter": null
    }
  ]
}
2024-04-06T20:53:07.338 [Information] LanguageWorkerOptions
{
  "WorkerConfigs": [
    {
      "Description": {
        "Language": "dotnet-isolated",
        "DefaultRuntimeName": null,
        "DefaultRuntimeVersion": null,
        "SupportedArchitectures": null,
        "SupportedOperatingSystems": null,
        "SupportedRuntimeVersions": null,
        "SanitizeRuntimeVersionRegex": null,
        "WorkerIndexing": "true",
        "Extensions": [
          ".dll"
        ],
        "UseStdErrorStreamForErrorsOnly": false,
        "DefaultExecutablePath": "dotnet",
        "DefaultWorkerPath": "/home/site/wwwroot/AppSystem.Functions.dll",
        "WorkerDirectory": "/home/site/wwwroot",
        "Arguments": [],
        "WorkerArguments": null
      },
      "Arguments": {
        "ExecutablePath": "dotnet",
        "ExecutableArguments": [],
        "WorkerPath": "/home/site/wwwroot/AppSystem.Functions.dll",
        "WorkerArguments": []
      },
      "CountOptions": {
        "SetProcessCountToNumberOfCpuCores": false,
        "ProcessCount": 1,
        "MaxProcessCount": 10,
        "ProcessStartupInterval": "00:00:10",
        "ProcessStartupTimeout": "00:01:00",
        "InitializationTimeout": "00:00:10",
        "EnvironmentReloadTimeout": "00:00:30",
        "ProcessRestartInterval": "00:00:10",
        "ProcessShutdownTimeout": "00:00:10"
      }
    }
  ]
}
2024-04-06T20:53:07.338 [Information] ConcurrencyOptions
{
  "DynamicConcurrencyEnabled": false,
  "MaximumFunctionConcurrency": 500,
  "CPUThreshold": 0.8,
  "SnapshotPersistenceEnabled": true
}
2024-04-06T20:53:07.338 [Information] FunctionResultAggregatorOptions
{
  "BatchSize": 1000,
  "FlushTimeout": "00:00:30",
  "IsEnabled": true
}
2024-04-06T20:53:07.338 [Information] SingletonOptions
{
  "LockPeriod": "00:00:15",
  "ListenerLockPeriod": "00:01:00",
  "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
  "LockAcquisitionPollingInterval": "00:00:05",
  "ListenerLockRecoveryPollingInterval": "00:01:00"
}
2024-04-06T20:53:07.338 [Information] ScaleOptions
{
  "ScaleMetricsMaxAge": "00:02:00",
  "ScaleMetricsSampleInterval": "00:00:10",
  "MetricsPurgeEnabled": true,
  "IsTargetScalingEnabled": true,
  "IsRuntimeScalingEnabled": false
}
2024-04-06T20:53:07.346 [Information] Starting JobHost
2024-04-06T20:53:07.346 [Information] Starting Host (HostId=company-dev-uks-app, InstanceId=d09dbc3e-f663-48ac-9551-8b6d6716a2e9, Version=4.31.1.1, ProcessId=26, AppDomainId=1, InDebugMode=True, InDiagnosticMode=False, FunctionsExtensionVersion=~4)
2024-04-06T20:53:07.348 [Information] Loading functions metadata
2024-04-06T20:53:08.553Z INFO  - Waiting for response to warmup request for container company-dev-uks-app_0_f49af447. Elapsed time = 16.8500414 sec
2024-04-06T20:53:12.447 [Information] Host lock lease acquired by instance ID '6302fe6b4d27f9dafb30e05389768b6c'.
2024-04-06T20:53:24.045Z INFO  - Waiting for response to warmup request for container company-dev-uks-app_0_f49af447. Elapsed time = 32.3414021 sec
2024-04-06T20:53:40.356Z INFO  - Waiting for response to warmup request for container company-dev-uks-app_0_f49af447. Elapsed time = 48.6531838 sec
2024-04-06T20:53:56.687Z INFO  - Waiting for response to warmup request for container company-dev-uks-app_0_f49af447. Elapsed time = 64.9839714 sec
2024-04-06T20:52:51.372103059Z Starting OpenBSD Secure Shell server: sshd.
2024-04-06T20:54:07.794967095Z Hosting environment: Production
2024-04-06T20:54:07.802627148Z Content root path: /azure-functions-host
2024-04-06T20:54:07.802646748Z Now listening on: http://[::]:80
2024-04-06T20:54:07.803030156Z Application started. Press Ctrl+C to shut down.

2024-04-06T20:54:09.057Z ERROR - Container company-dev-uks-app_0_f49af447 for site company-dev-uks-app has exited, failing site start
2024-04-06T20:54:09.063Z ERROR - Container company-dev-uks-app_0_f49af447 didn't respond to HTTP pings on port: 80, failing site start. See container logs for debugging.
2024-04-06T20:54:09.105Z INFO  - Stopping site company-dev-uks-app because it failed during startup.
2024-04-06T20:54:07.414 [Error] Exceeded language worker restart retry count for runtime:dotnet-isolated. Shutting down and proactively recycling the Functions Host to recover
2024-04-06T20:54:07.482 [Information] Reading functions metadata (Custom)
2024-04-06T20:54:07.522 [Information] 1 functions found (Custom)
2024-04-06T20:54:07.581 [Information] 0 functions loaded
2024-04-06T20:54:07.642 [Information] Generating 0 job function(s)
2024-04-06T20:54:07.725 [Warning] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
2024-04-06T20:54:07.742 [Information] HttpOptions
{
  "DynamicThrottlesEnabled": false,
  "EnableChunkedRequestBinding": false,
  "MaxConcurrentRequests": -1,
  "MaxOutstandingRequests": -1,
  "RoutePrefix": "api"
}
2024-04-06T20:54:07.746 [Information] Initializing function HTTP routes
No HTTP routes mapped
2024-04-06T20:54:07.752 [Information] Host initialized (60400ms)
2024-04-06T20:54:07.764 [Information] Host started (60418ms)
2024-04-06T20:54:07.764 [Information] Job host started
2024-04-06T20:54:07.895 [Information] Stopping JobHost
2024-04-06T20:54:07.895 [Information] Job host stopped
2024-04-06T20:55:17  No new trace in the past 1 min(s).
azure-functions
1个回答
0
投票

我后来意识到这在本地也停止工作了。该应用程序将立即运行并停止,不会出现错误。

使用

git bisect
我确定了破坏它的提交。不知何故,我删除了
host.Run()
命令。

吸取的教训。

  1. 不要认为小的改变就可以,在本地运行。
  2. 使用
    git bisect
  3. 并非所有启动失败都是由于意外异常造成的。
  4. 我觉得自己很蠢:)
© www.soinside.com 2019 - 2024. All rights reserved.