Azure Web 作业抛出 Azure 存储 404 未找到
Azure Web Jobs Throws Azure Storage 404 Not Found
我在 Azure 中部署了 webjobs,它之前可以正常工作,但在我们最新的部署之后,我们遇到了 webjobs 抛出的问题 "Azure Storage Exception"。
[03/25/2016 01:38:26 > 5f45b8: SYS INFO] Status changed to Initializing
[03/25/2016 01:38:40 > 5f45b8: SYS INFO] Run script 'ListNet.JobController.exe' with script host - 'WindowsScriptHost'
[03/25/2016 01:38:40 > 5f45b8: SYS INFO] Status changed to Running
[03/25/2016 01:38:41 > 5f45b8: INFO] Found the following functions:
[03/25/2016 01:38:41 > 5f45b8: INFO] ListNet.JobController.Functions.ManualTrigger
[03/25/2016 01:38:41 > 5f45b8: INFO] Executing: 'Functions.ManualTrigger' because This was function was programmatically called via the host APIs.
[03/25/2016 01:41:12 > 5f45b8: ERR ]
[03/25/2016 01:41:12 > 5f45b8: ERR ] 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.
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Blob.CloudBlobSharedImpl.<DeleteBlobImpl>b__1b(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of inner exception stack trace ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.EndDelete(IAsyncResult asyncResult)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.<CreateCallbackVoid>b__3(IAsyncResult ar)
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Protocols.PersistentQueueWriter`1.<DeleteAsync>d__6.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Loggers.CompositeFunctionInstanceLogger.<DeleteLogFunctionStartedAsync>d__e.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.<TryExecuteAsync>d__1.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.HeartbeatFunctionExecutor.<TryExecuteAsync>d__0.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.AbortListenerFunctionExecutor.<TryExecuteAsync>d__0.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.ShutdownFunctionExecutor.<TryExecuteAsync>d__0.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.JobHost.<CallAsyncCore>d__7.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.JobHost.Call(MethodInfo method)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at ListNet.JobController.Program.Main()
[03/25/2016 01:41:12 > 5f45b8: SYS INFO] Status changed to Failed
[03/25/2016 01:41:12 > 5f45b8: SYS ERR ] Job failed due to exit code -532462766
我调查了这个类似的问题,但我的 Azure 存储中已经有这些容器:
http://i.stack.imgur.com/HkCab.png
备注
- 我用手动触发
- 我创建了一个默认的网络作业并且运行它成功了
经过几个月的验证,我发现这个问题的原因是重复的nuget包依赖。事实证明,我有多个不同版本(例如:1.1、1.2)的 nuget 包(Newtonsoft.Json)。
关于 nuget 为什么这样做,我不知道。
我在 Azure 中部署了 webjobs,它之前可以正常工作,但在我们最新的部署之后,我们遇到了 webjobs 抛出的问题 "Azure Storage Exception"。
[03/25/2016 01:38:26 > 5f45b8: SYS INFO] Status changed to Initializing
[03/25/2016 01:38:40 > 5f45b8: SYS INFO] Run script 'ListNet.JobController.exe' with script host - 'WindowsScriptHost'
[03/25/2016 01:38:40 > 5f45b8: SYS INFO] Status changed to Running
[03/25/2016 01:38:41 > 5f45b8: INFO] Found the following functions:
[03/25/2016 01:38:41 > 5f45b8: INFO] ListNet.JobController.Functions.ManualTrigger
[03/25/2016 01:38:41 > 5f45b8: INFO] Executing: 'Functions.ManualTrigger' because This was function was programmatically called via the host APIs.
[03/25/2016 01:41:12 > 5f45b8: ERR ]
[03/25/2016 01:41:12 > 5f45b8: ERR ] 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.
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Blob.CloudBlobSharedImpl.<DeleteBlobImpl>b__1b(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of inner exception stack trace ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.EndDelete(IAsyncResult asyncResult)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.<CreateCallbackVoid>b__3(IAsyncResult ar)
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Protocols.PersistentQueueWriter`1.<DeleteAsync>d__6.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Loggers.CompositeFunctionInstanceLogger.<DeleteLogFunctionStartedAsync>d__e.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.<TryExecuteAsync>d__1.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.HeartbeatFunctionExecutor.<TryExecuteAsync>d__0.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.AbortListenerFunctionExecutor.<TryExecuteAsync>d__0.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.ShutdownFunctionExecutor.<TryExecuteAsync>d__0.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.JobHost.<CallAsyncCore>d__7.MoveNext()
[03/25/2016 01:41:12 > 5f45b8: ERR ] --- End of stack trace from previous location where exception was thrown ---
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at Microsoft.Azure.WebJobs.JobHost.Call(MethodInfo method)
[03/25/2016 01:41:12 > 5f45b8: ERR ] at ListNet.JobController.Program.Main()
[03/25/2016 01:41:12 > 5f45b8: SYS INFO] Status changed to Failed
[03/25/2016 01:41:12 > 5f45b8: SYS ERR ] Job failed due to exit code -532462766
我调查了这个类似的问题,但我的 Azure 存储中已经有这些容器:
http://i.stack.imgur.com/HkCab.png
备注
- 我用手动触发
- 我创建了一个默认的网络作业并且运行它成功了
经过几个月的验证,我发现这个问题的原因是重复的nuget包依赖。事实证明,我有多个不同版本(例如:1.1、1.2)的 nuget 包(Newtonsoft.Json)。
关于 nuget 为什么这样做,我不知道。