Azure WebJob失败,出现SQL超时异常:由于退出代码-532462766,作业失败 [英] Azure WebJob fails with SQL Timeout exception: Job failed due to exit code -532462766

查看:74
本文介绍了Azure WebJob失败,出现SQL超时异常:由于退出代码-532462766,作业失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了带有诊断日志记录的触发类型的WebJob.它基本上是从Azure SQL提取数据.有时会因sql超时异常而失败:

System.Data.Entity.Core.EntityCommandExecutionException:执行命令定义时发生错误.有关详细信息,请参见内部异常. ---> System.Data.SqlClient.SqlException:执行超时已过期.超时时间已过 操作完成之前或服务器没有响应. ---> System.ComponentModel.Win32Exception:等待操作超时.

System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out.

.

.

我是 使用'Basic:1小型应用服务计划.  为此WebJob始终启用. #24292e; font-size:14px>天蓝色 SQL连接超时已从默认的30秒增加到5分钟.

I am using 'Basic: 1 Small' App service plan. Always On is enabled for this WebJob. Azure SQL connection timeout had been increased to 5mins (from the default 30secs).

有关该错误以及如何解决该错误的任何提示?




推荐答案

请澄清一下,如果它是按计划运行的,则使用的是Azure Scheduler还是CRON方法?确保正确设置配置.

Just to clarify, if it's triggered running on a schedule, are you using the Azure Scheduler, or the CRON approach? Ensure that the configuration is set appropriately.

确保将web.config正确引用到数据库,并更新连接字符串并在发布时(在目标位置删除其他文件"),该应用正在接收 最新变化.是的, 用于触发的WebJobs增加方法span> idle 超时 .将其设置为您的 所需的超时时间(以秒为单位).

Ensure that the web.config is correctly referenced to the DB and connection strings are updated and that when published (‘remove additional files at destination’), the app is receiving the latest changes. Yes, for triggered WebJobs the way to increase idle timeout is using the app setting: WEBJOBS_IDLE_TIMEOUT. Set it to your desired timeout in seconds.

For  已触发的WebJobs-Console.Out/Console.Error也被路由到特定于WebJobs的运行日志文件 可使用Azure门户进行访问,并存储在data/jobs/triggered/jobName/runId中.要使它们也被路由到应用程序日志",请设置 WEBJOBS_LOG_TRIGGERED_JOBS_TO_APP_LOGS true

For triggered WebJobs - Console.Out/Console.Error are routed to the WebJobs specific run log file also accessible using the Azure portal and stored at data/jobs/triggered/jobName/runId. To have them also get routed to "application logs", set the WEBJOBS_LOG_TRIGGERED_JOBS_TO_APP_LOGS to true. Review the logs to isolate the issue further.

在Azure上,一般的闲置请求超时会导致客户端在230秒后断开连接.但是,命令 之后,它仍将继续在服务器端运行.  
请让我们知道如何进行进一步的调查.我们很乐意为您提供进一步的帮助. 

On Azure, there is a general idle request timeout that will cause clients to get disconnected after 230 seconds. However, the command will still continue running server-side after that.  
Kindly let us know how that goes for further investigation. We are happy to help you further. 


这篇关于Azure WebJob失败,出现SQL超时异常:由于退出代码-532462766,作业失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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