近期观察日志发现每次服务重启都会出现如下Cap 错误日志。环境.Net Core 3.1DotNetCore.CAP, Version=3.0.3.0DotNetCore.CAP.MySql, Version=3.0.3.0[05:54:21 INF] Starting the processing server.at DotNetCo...
近期观察日志发现每次服务重启都会出现如下Cap 错误日志。
环境
.Net Core 3.1
DotNetCore.CAP, Version=3.0.3.0
DotNetCore.CAP.MySql, Version=3.0.3.0
[05:54:21 INF] Starting the processing server. at DotNetCore.CAP.Internal.Bootstrapper.BootstrapAsync(CancellationToken stoppingToken) at DotNetCore.CAP.MySql.MySqlStorageInitializer.InitializeAsync(CancellationToken cancellationToken) at DotNetCore.CAP.MySql.MySqlStorageInitializer.InitializeAsync(CancellationToken cancellationToken) at Dapper.SqlMapper.ExecuteImplAsync(IDbConnection cnn, CommandDefinition command, Object param) in C:\projects\dapper\Dapper\SqlMapper.Async.cs:line 678 at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQueryAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlCommand.cs:line 226 at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken)
in C:\projects\mysqlconnector\src\MySqlConnector\Core\CommandExecutor.cs:line 62 at MySql.Data.MySqlClient.MySqlDataReader.CreateAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, IDictionary`2 cachedProcedures, IMySqlCommand command,
CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in
C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs:line 391 at MySql.Data.MySqlClient.MySqlDataReader.ActivateResultSet() in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs:line 130 at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in C:\projects\mysqlconnector\src\MySqlConnector\Core\ResultSet.cs:line 49 ---> MySql.Data.MySqlClient.MySqlException (0x80004005): CREATE command denied to user 'connection string' for table 'XXX_TableName'
通过下载源码分析(https://github.com/dotnetcore/CAP), 发现AddCap内部添加了 HostedService
HostedService 内部调用了Create Table 的Sql执行
处理方法:
将此函数重写下,就处理了
沃梦达教程
本文标题为:.Net Core Cap 异常
基础教程推荐
猜你喜欢
- ZooKeeper的安装及部署教程 2023-01-22
- C#类和结构详解 2023-05-30
- C# 调用WebService的方法 2023-03-09
- C#控制台实现飞行棋小游戏 2023-04-22
- 一个读写csv文件的C#类 2022-11-06
- C# windows语音识别与朗读实例 2023-04-27
- linux – 如何在Debian Jessie中安装dotnet core sdk 2023-09-26
- winform把Office转成PDF文件 2023-06-14
- unity实现动态排行榜 2023-04-27
- C# List实现行转列的通用方案 2022-11-02