Azure Web作业-远程服务器返回404 [英] Azure Web Job-The remote server returned 404

查看:112
本文介绍了Azure Web作业-远程服务器返回404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个持续运行的Web作业,它监听start队列和停止queue及其各自的功能. Web作业中有3个预定义的进程,start队列包含一条消息,其中提到要启动的进程名称,而stop队列包含一条消息,其中提到要停止的进程名称.

I have a continuos running web job which listens to a start queue and a stop queue with their respective functions. There are 3 predefined process in the web job and the start queue contains a message which mentions the process name to be started while the stop queue contains a message which mentions the process name to be stopped.

自从过去4个星期以来,只要Webjob停止进程,它就会崩溃并重新启动,并且出现上述异常.

When ever the webjob stops a process it crashes and restarts with the above exception since last 4 weeks.

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, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

webjob甚至不包含任何代码来删除blob文件.

The webjob does not even contain any code to delete a blob file.

在调试时,调试器在引发异常时不会指向任何特定的行,因此我不知道实际原因是什么.

While debugging, the debugger does not point to any specific line while throwing the exception and hence I have no clue as to what is the actual cause.

PS :在此之前,它可以完美运行,并且每个函数的主体都包含在try catch块中. catch块不会抛出异常,而只是记录堆栈跟踪并继续.

PS : It used to run perfectly prior to that and every function's body is enclosed in try catch block. The catch block does not rethrow the exception but just logs the stacktrace and continues.

编辑

我必须检查以下容器是否存在

I had to check if the below containers were there

在Webjob的存储中,并且还更新了Microsoft.Web.WebJobs.Publish nuget软件包. 我真的不确定是否可以肯定地解决问题.

in the webjob's storage and also updated the Microsoft.Web.WebJobs.Publish nuget package. I am really not sure if this fixes the problem for sure though.

推荐答案

看来您是对的,实际上您确实需要手动创建或发布网络作业,在这种情况下,环境似乎会为您创建容器.

It looks like you were right, you do in fact need to manually create the blob containers, or publish the web job, in which case it looks like the environment will create the containers for you.

当我最初尝试它时,我首先进行了发布,它的工作原理很吸引人.第二个项目,我做的方式有所不同,因此我首先运行了控制台应用程序,但它始终以404失败.

When I tried it out initially, I did the publish first, and it worked like a charm. Second project, I am doing it differently, so I ran the console app first, and it kept failing with 404.

因此,您需要创建:

  • azure-webjobs-dashboard
  • azure-webjobs-hosts
  • azure-jobs-hosts-archive
  • azure-jobs-hosts-output

希望它对某人有帮助.

这篇关于Azure Web作业-远程服务器返回404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆