Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

程序运行过程中,偶发抛出Status unavailable, waiting for recovery. Authentication to host 'localhost' failed. #1897

Open
LucasYao93 opened this issue Oct 8, 2024 · 4 comments

Comments

@LucasYao93
Copy link

LucasYao93 commented Oct 8, 2024

问题描述及重现代码:

程序运行过程中,偶发的抛出Status unavailable, waiting for recovery. Authentication to host 'localhost' failed. 后自动恢复。

数据库连接信息:
Server=localhost;Port=3306;Database=epams;Uid=root;Pwd=root;Charset=utf8mb4;Min Pool Size=50;Max Pool Size=200;

以下是堆栈信息
堆栈信息
2024-10-08 10:25:55,657 [RDT20240929135801] ERROR Wayeal.EPAMS.AnalysisService.RealDataWorkThread - RealDataWorkThread throw message. 【主库】Status unavailable, waiting for recovery. Authentication to host 'localhost' failed.
System.Exception: 【主库】Status unavailable, waiting for recovery. Authentication to host 'localhost' failed.
---> System.Exception: 【主库】Status unavailable, waiting for recovery. Authentication to host 'localhost' failed.
---> System.Security.Authentication.AuthenticationException: Authentication to host 'localhost' failed.
at MySql.Data.Common.Ssl.StartSSL(Stream& baseStream, Encoding encoding, String connectionString)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at System.Data.Common.DbConnection.OpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
at FreeSql.MySql.MySqlConnectionPoolPolicy.OnGetAsync(Object1 obj) --- End of inner exception stack trace --- at FreeSql.Internal.ObjectPool.ObjectPool1.GetFree(Boolean checkAvailable)
at FreeSql.Internal.ObjectPool.ObjectPool1.GetAsync() at FreeSql.Internal.CommonProvider.AdoProvider.ExecuteReaderMultipleAsync(Int32 multipleResult, DbConnection connection, DbTransaction transaction, Func3 fetchHandler, Action2 schemaHandler, CommandType cmdType, String cmdText, Int32 cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken) --- End of inner exception stack trace --- at FreeSql.Internal.CommonProvider.AdoProvider.LoggerException(IObjectPool1 pool, PrepareCommandResult pc, Exception ex, DateTime dt, StringBuilder logtxt, Boolean isThrowException)
at FreeSql.Internal.CommonProvider.AdoProvider.ExecuteReaderMultipleAsync(Int32 multipleResult, DbConnection connection, DbTransaction transaction, Func3 fetchHandler, Action2 schemaHandler, CommandType cmdType, String cmdText, Int32 cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken)
at FreeSql.Internal.CommonProvider.Select0Provider`2.ToListAfPrivateAsync(String sql, GetAllFieldExpressionTreeInfo af, ReadAnonymousTypeOtherInfo[] otherData, CancellationToken cancellationToken)
at Wayeal.EPAMS.Infrastructure.Repositories.DeviceRepository.GetListAsync(Int32 skipCount, Int32 maxResultCount) in D:\repository\EPAMS\Wayeal.EPAMS.Server\src\02_Infrastructure\Wayeal.EPAMS.Infrastructure\Repositories\DeviceRepository.cs:line 33
at Wayeal.EPAMS.ConfigurationCenterService.Domains.DeviceDomainService.GetListAsync(Int32 skipCount, Int32 maxResultCount) in D:\repository\EPAMS\Wayeal.EPAMS.Server\src\08_ConfigurationCenter\Wayeal.EPAMS.ConfigurationCenterService\Domains\DeviceDomainService.cs:line 61
at Wayeal.EPAMS.AnalysisService.RealDataWorkThread.GenerateWorkParameterAsync(IServiceScope scope, DateTime timePoint) in D:\repository\EPAMS\Wayeal.EPAMS.Server\src\11_AnalysisService\Wayeal.EPAMS.AnalysisService\RealDataWorkThread\RealDataWorkThread.cs:line 96
at Wayeal.EPAMS.AnalysisService.RealDataWorkThread.RunningAsync() in D:\repository\EPAMS\Wayeal.EPAMS.Server\src\11_AnalysisService\Wayeal.EPAMS.AnalysisService\RealDataWorkThread\RealDataWorkThread.cs:line 70
at Wayeal.EPAMS.AnalysisService.RealDataWorkThread.RunningAsync() in D:\repository\EPAMS\Wayeal.EPAMS.Server\src\11_AnalysisService\Wayeal.EPAMS.AnalysisService\RealDataWorkThread\RealDataWorkThread.cs:line 75

数据库版本

Mysql.5.7.44

安装的Nuget包

FreeSql 3.2.815
MySql.Data 8.0.30
FreeSql.DbContext 3.2.815
FreeSql.Provider.MySql 3.2.815

net core

Net6.0

@2881099
Copy link
Collaborator

2881099 commented Oct 9, 2024

.UseAdoConnectionPool(true)

@LucasYao93
Copy link
Author

.UseAdoConnectionPool(true)

感谢回复,能否帮忙解答下,是什么原因造成的吗?

@2881099
Copy link
Collaborator

2881099 commented Oct 10, 2024

字面理解就好,物理连接问题。这个问题freesql链接池背锅已久,意思让你们用ado.net链接池。

@LucasYao93
Copy link
Author

字面理解就好,物理连接问题。这个问题freesql链接池背锅已久,意思让你们用ado.net链接池。

请问下,这个背锅,背的是谁的锅?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants