我有一个连续运行的Web作业,它使用各自的功能监听启动队列和停止队列. Web作业中有3个预定义进程,并且启动队列包含一条消息,该消息提到要启动的进程名称,而停止队列包含一条消息,提示要停止进程名称.
当webjob停止进程时,它会在过去4周内崩溃并重新启动上述异常.
Executing: 'Functions.StartProcess' because New queue message detected on 'start'. Updated the status of Process A to 1 Process A Started Process A processed 200 records Process A processed 200 records Process A processed 200 records Process A processed 200 records Process A processed 200 records Executing: 'Functions.StopProcess' because New queue message detected on 'stop'. Process A stopped Disposed Process A Updated the status of Process A to 3 Unhandled Exception: Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found. at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode,HttpStatusCode actualStatusCode,T retVal,StorageCommandBase`1 cmd,Exception ex) at Microsoft.WindowsAzure.Storage.Blob.CloudBlobSharedImpl.<DeleteBlobImpl>b__1b(RESTCommand`1 cmd,HttpWebResponse resp,Exception ex,OperationContext ctx) at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult) --- End of inner exception stack trace --- at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result) at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.EndDelete(IAsyncResult asyncResult) at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.<CreateCallbackVoid>b__3(IAsyncResult ar) --- End of stack trace from prevIoUs location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Host.Protocols.PersistentQueueWriter`1.<DeleteAsync>d__6.MoveNext() --- End of stack trace from prevIoUs location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Host.Loggers.CompositeFunctionInstanceLogger.<DeleteLogFunctionStartedAsync>d__e.MoveNext() --- End of stack trace from prevIoUs location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.<TryExecuteAsync>d__1.MoveNext() --- End of stack trace from prevIoUs location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueTriggerExecutor.<ExecuteAsync>d__0.MoveNext() --- End of stack trace from prevIoUs location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueListener.<ProcessMessageAsync>d__11.MoveNext() --- End of stack trace from prevIoUs location where exception was thrown --- at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.<>c__DisplayClass1.<Throw>b__0() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,Object state) at System.Threading.ThreadHelper.ThreadStart()
在调试时,调试器在抛出异常时没有指向任何特定的行,因此我不知道实际原因是什么.
PS:它曾经在此之前完美运行,并且每个函数的主体都包含在try catch块中. catch块不会重新抛出异常,只是记录stacktrace并继续.
编辑
我必须检查下面的容器是否在那里
在webjob的存储中,还更新了Microsoft.Web.WebJobs.Publish nuget包.我真的不确定这是否能确定问题.
解决方法
看起来你是对的,你确实需要手动创建blob容器,或者发布web作业,在这种情况下,环境看起来会为你创建容器.
当我最初尝试时,我首先做了发布,它就像一个魅力.第二个项目,我的方式不同,所以我首先运行控制台应用程序,它仍然失败了404.
所以,你需要创建:
> azure-webjobs-dashboard
> azure-webjobs-hosts
> azure-jobs-hosts-archive
> azure-jobs-hosts-output
希望它可以帮到某人.