gpt4 book ai didi

function - 我在 BlobStorage 触发器上遇到启动错误

转载 作者:行者123 更新时间:2023-12-03 15:10:30 24 4
gpt4 key购买 nike

当我创建 Blob 存储触发函数 (v2) 时,出现以下错误。

The function runtime is unable to start. Microsoft.WindowsAzure.Storage: Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found. System.Private.CoreLib: Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found.

如果我在 VSTS 中创建函数或通过 Azure 门户创建函数,就会发生这种情况。

KUDO 日志显示以下错误:

2019-06-24T13:00:38.588 [Error] A host error has occurred
Microsoft.WindowsAzure.Storage.StorageException : Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found. ---> System.ArgumentException : Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found.
at System.Enum.TryParseEnum(Type enumType,String value,Boolean ignoreCase,EnumResult& parseResult)
at System.Enum.Parse(Type enumType,String value,Boolean ignoreCase)
at Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties.<>c.<ReadCorsPropertiesFromXml>b__67_0(XElement rule)
at System.Linq.Enumerable.SelectEnumerableIterator.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable source)
at Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties.ReadCorsPropertiesFromXml(XElement element)
at Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties.FromServiceXml(XDocument servicePropertiesDocument)
at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ReadServiceProperties(Stream inputStream)
at Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient.<>c.<GetServicePropertiesImpl>b__60_2(RESTCommand cmd,HttpResponseMessage resp,OperationContext ctx)
at async Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteAsyncInternal[T](RESTCommand cmd,IRetryPolicy policy,OperationContext operationContext,CancellationToken token)
End of inner exception
at async Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteAsyncInternal[T](RESTCommand cmd,IRetryPolicy policy,OperationContext operationContext,CancellationToken token)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.BlobLogListener.EnableLoggingAsync(CloudBlobClient blobClient,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\BlobLogListener.cs : 188
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.BlobLogListener.CreateAsync(CloudBlobClient blobClient,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\BlobLogListener.cs : 42
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.PollLogsStrategy.RegisterAsync(CloudBlobContainer container,ITriggerExecutor triggerExecutor,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\PollLogsStrategy.cs : 73
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.ScanBlobScanLogHybridPollingStrategy.RegisterAsync(CloudBlobContainer container,ITriggerExecutor triggerExecutor,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\ScanBlobScanLogHybridPollingStrategy.cs : 61
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.BlobListenerFactory.RegisterWithSharedBlobListenerAsync(String hostId,SharedBlobListener sharedBlobListener,CloudBlobClient blobClient,CloudQueue hostBlobTriggerQueue,IMessageEnqueuedWatcher messageEnqueuedWatcher,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\BlobListenerFactory.cs : 155
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Blobs.Listeners.BlobListenerFactory.CreateAsync(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Blobs\Listeners\BlobListenerFactory.cs : 93
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.ListenerFactory.CreateAsync(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs : 426
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Listeners.HostListenerFactory.CreateAsync(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\HostListenerFactory.cs : 62
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Listeners.ListenerFactoryListener.StartAsyncCore(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\ListenerFactoryListener.cs : 45
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Listeners.ShutdownListener.StartAsync(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\ShutdownListener.cs : 29
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.JobHost.StartAsyncCore(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\JobHost.cs : 101
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Script.ScriptHost.StartAsyncCore(CancellationToken cancellationToken) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Host\ScriptHost.cs : 241
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Script.WebHost.WebJobsScriptHostService.StartHostAsync(CancellationToken cancellationToken,Int32 attemptCount,JobHostStartupMode startupMode) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\WebJobsScriptHostService.cs : 163
2019-06-24T13:00:38.696 [Information] Stopping JobHost```

最佳答案

正如异常堆栈所解释的,它无法将“DELETE、GET、HEAD、MERGE、POST、OPTIONS、PUT、PATCH”解析为单个 http 方法值。发生这种情况的原因是由于 azure 存储公共(public)库的一些发现过程。它将获取 xml 服务器配置以获取 cors 规则的值。虽然用户界面允许您选择多种方法,但该库无法解析该值并将引发异常。

一种可能的解决方法是每个规则仅选择一种方法。

我创建了一个git hub issue为此。

编辑1正如评论中所述,只有动词“GET、HEAD、POST、PUT、DELETE、TRACE、OPTIONS、CONNECT、MERGE”是已知的,“PATCH”不是已知动词。

编辑2该问题在存储 SDK 版本 11 中不会得到解决,这很烦人,因为 Azure 函数库版本 4 也使用该版本。要解决此问题,我们需要等到版本 5 可用,因为它将拾取存储 SDK 版本 12。

关于function - 我在 BlobStorage 触发器上遇到启动错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56737186/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com