【问题标题】:Azure continuous webjob fails in some casesAzure 连续网络作业在某些情况下失败
【发布时间】:2018-04-28 20:54:31
【问题描述】:

我有一个在 azure 上运行的连续网络作业,在 8 小时前进行大规模部署后,在某些情况下该状态从未完成,而在其他情况下则完成了该作业。 我已经启用了我能找到的所有日志记录,并且已经花费了好几个小时试图找出问题所在。

我似乎能够找到的唯一日志错误信息来自 job_log,其中指出:

[11/15/2017 14:46:23 > e553e5: ERR ] 未处理的异常:Microsoft.WindowsAzure.Storage.StorageException:远程服务器返回错误:(404) 未找到。 ---> System.Net.WebException:远程服务器返回错误:(404)未找到。 [11/15/2017 14:46:23 > e553e5: ERR ] 在 Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase1 cmd, Exception ex) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\Common\Shared\Protocol\HttpResponseParsers.Common.cs:line 50 [11/15/2017 14:46:23 > e553e5: ERR ] at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.<DeleteBlobImpl>b__33(RESTCommand1 cmd, c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlob.cs: 3349 中的 HttpWebResponse resp,异常 ex,OperationContext ctx) [11/15/2017 14:46:23 > e553e5: ERR ] 在 Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult) 在 c:\Program Files (x86)\Jenkins\workspace \release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:第 299 行 [11/15/2017 14:46:23 > e553e5: ERR ] --- 内部异常堆栈跟踪结束 --- [11/15/2017 14:46:23 > e553e5: ERR ] 在 Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult 结果) 在 c:\Program Files (x86)\Jenkins\workspace \release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:第 50 行 [11/15/2017 14:46:23 > e553e5: ERR ] 在 Microsoft.WindowsAzure.Storage.Blob.CloudBlob.EndDelete(IAsyncResult asyncResult) 在 c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ ClassLibraryCommon\Blob\CloudBlob.cs:第 1729 行 [11/15/2017 14:46:23 > e553e5: ERR ] 在 Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.c__DisplayClass4.b__3(IAsyncResult ar) 在 c:\Program Files (x86)\Jenkins\工作区\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:第 114 行 [2017 年 11 月 15 日 14:46:23 > e553e5: ERR ] --- 从之前抛出异常的位置结束堆栈跟踪--- [11/15/2017 14:46:23 > e553e5: ERR ] 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) [11/15/2017 14:46:23 > e553e5: ERR ] 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) [11/15/2017 14:46:23 > e553e5: ERR ] 在 Microsoft.Azure.WebJobs.Host.Protocols.PersistentQueueWriter1.<DeleteAsync>d__6.MoveNext() [11/15/2017 14:46:23 > e553e5: ERR ] --- End of stack trace from previous location where exception was thrown --- [11/15/2017 14:46:23 > e553e5: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) [11/15/2017 14:46:23 > e553e5: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [11/15/2017 14:46:23 > e553e5: ERR ] at Microsoft.Azure.WebJobs.Host.Loggers.CompositeFunctionInstanceLogger.<DeleteLogFunctionStartedAsync>d__e.MoveNext() [11/15/2017 14:46:23 > e553e5: ERR ] --- End of stack trace from previous location where exception was thrown --- [11/15/2017 14:46:23 > e553e5: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) [11/15/2017 14:46:23 > e553e5: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [11/15/2017 14:46:23 > e553e5: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.<TryExecuteAsync>d__1.MoveNext() [11/15/2017 14:46:23 > e553e5: ERR ] --- End of stack trace from previous location where exception was thrown --- [11/15/2017 14:46:23 > e553e5: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) [11/15/2017 14:46:23 > e553e5: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [11/15/2017 14:46:23 > e553e5: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.TriggeredFunctionExecutor1.d__0.MoveNext() [2017 年 11 月 15 日 14:46:23 > e553e5: ERR ] --- 从之前抛出异常的位置结束堆栈跟踪--- [11/15/2017 14:46:23 > e553e5: ERR ] 在 Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.c__DisplayClass1.b__0() [11/15/2017 14:46:23 > e553e5: ERR ] 在 System.Threading.ThreadHelper.ThreadStart_Context(对象状态) [11/15/2017 14:46:23 > e553e5: ERR ] 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback 回调,对象状态,布尔值 preserveSyncCtx) [11/15/2017 14:46:23 > e553e5: ERR ] 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback 回调,对象状态,布尔值 preserveSyncCtx) [11/15/2017 14:46:23 > e553e5: ERR ] 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback 回调,对象状态) [11/15/2017 14:46:23 > e553e5: ERR ] 在 System.Threading.ThreadHelper.ThreadStart()

谁能给我一些关于如何调试它的想法,因为我没有想法。

我的 webjobs 主页面如下所示:

 static void Main()
    {
         var host = new JobHost();

        var config = new JobHostConfiguration();
        config.Queues.MaxPollingInterval = new TimeSpan(0,0,0,30);
        config.Queues.MaxDequeueCount = 3;
        // The following code ensures that the WebJob will be running continuously
        host.RunAndBlock();
    }

并且 processqueuemessage 看起来像:

 public static void ProcessQueueMessage([QueueTrigger("importqueue")] string msg)
    {
        try
        {
            WorkerWebJobCore wwjc = new WorkerWebJobCore();
            wwjc.RunCore(msg, TableStorageAccessResources.ImportQueue,
                TableStorageAccessResources.TableStorageDataOneId,
                TableStorageAccessResources.TableStorageDataOnePassword);
        }
        catch (Exception e)
        {
            CommunicatorLog.Log.LogError("WebJobWorker","WebJobWorker","Error in processing queue message","ERRWJWF01");
        }
    }

所以我对所有事情都有所了解,因此我不明白它是如何失败的?

提前致谢。

【问题讨论】:

    标签: c# azure azure-webjobs continuous webjob


    【解决方案1】:

    我的猜测是有什么东西弄乱了您的队列或存储本身的文件。

    看起来它试图删除不再存在的文件。或者可能正在删除“更大”的内容。

    深入研究后,这也可能是您如何部署 WebJob 的问题。部署时有时可能会有所不同?看看这些:

    Azure Web Job-The remote server returned 404

    https://github.com/Azure/azure-webjobs-sdk/issues/922

    Azure WebJob QueueTrigger message is not deleted from queue

    https://github.com/Azure/azure-webjobs-sdk/issues/645

    【讨论】:

      【解决方案2】:

      显然,运行低于 2.0.0 的 Microsoft.Azure.Webjob 版本无法获得有用的答案。 当我终于开始尝试安装该版本时,它向我指出了有用的错误消息的问题。

      问题与有关 webjob 核心的工作原理的错误版本的 dll 有关

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-04-28
        • 1970-01-01
        • 2023-04-01
        • 1970-01-01
        • 2021-11-08
        • 2022-11-25
        相关资源
        最近更新 更多