hangfire mysql_Hangfire 后台日志 The underlying provider failed on Open 错误

在将使用EF6和SQL Server2017的项目部署到远程服务器后,遇到Hangfire后台任务错误:The underlying provider failed on Open。通过检查Hangfire日志发现是数据库连接问题,具体表现为无法打开到SQL Server的连接。错误可能是由于网络问题或服务器不允许远程连接。尽管问题最终自行恢复,但建议检查SQL Server的远程连接设置和网络连接稳定性。
摘要由CSDN通过智能技术生成

EF6+SQL Server2017,发布到远程服务器后出现这个错误 The underlying provider failed on Open 网上看了一下是数据库原因,继续查看hangfire 的日志,明细如下:

DEBUG 2020-03-25 16:25:08,040 [er #1] Hangfire.Processing.BackgroundExecution – Execution RecurringJobScheduler is in the Faulted state now due to an exception, execution will be retried no more than in 00:00:01

System.Data.SqlClient.SqlException (0x80131904): 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 – 无法打开到 SQL Server 的连接) —> System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。

在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)

在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)

在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)

在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)

在 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)

在 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)

在 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)

在 System.Data.SqlClient.SqlConnection.Open()

在 Hangfire.SqlServer.SqlServerStorage.CreateAndOpenConnection()

在 Hangfire.SqlServer.SqlServerConnection.AcquireLock(String resource, TimeSpan timeout)

在 Hangfire.SqlServer.SqlServerConnection.AcquireDistributedLock(String resource, TimeSpan timeout)

在 Hangfire.Server.RecurringJobScheduler.UseConnectionDistributedLock(JobStorage storage, Func`2 action)

在 Hangfire.Server.RecurringJobScheduler.EnqueueNextRecurringJobs(BackgroundProcessContext context)

在 Hangfire.Server.RecurringJobScheduler.Execute(BackgroundProcessContext context)

在 Hangfire.Server.BackgroundProcessDispatcherBuilder.ExecuteProcess(Guid executionId, Object state)

在 Hangfire.Processing.BackgroundExecution.Run(Action`2 callback, Object state)

问题没有重现,后来自己恢复了,也许是连接故障

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值