• .Net Core Cap 异常


    近期观察日志发现每次服务重启都会出现如下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:projectsdapperDapperSqlMapper.Async.cs:line 678
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQueryAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in C:projectsmysqlconnectorsrcMySqlConnectorMySql.Data.MySqlClientMySqlCommand.cs:line 226
       at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken)
    in C:projectsmysqlconnectorsrcMySqlConnectorCoreCommandExecutor.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:projectsmysqlconnectorsrcMySqlConnectorMySql.Data.MySqlClientMySqlDataReader.cs:line 391 at MySql.Data.MySqlClient.MySqlDataReader.ActivateResultSet() in C:projectsmysqlconnectorsrcMySqlConnectorMySql.Data.MySqlClientMySqlDataReader.cs:line 130 at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in C:projectsmysqlconnectorsrcMySqlConnectorCoreResultSet.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执行

    处理方法:

    将此函数重写下,就处理了

  • 相关阅读:
    svn 指定不更新目录
    C# 修改win环境变量 来加载dll库
    基本组件
    在SD卡上创建/删除文件夹 使用DDMS透视图管理SD卡
    linux中图形界面改成文本
    表格布局和线性布局
    文件操作
    静态库的生成和调用
    船载电子海图系统(E C S )概述
    GPS全球定位系统构成及原理
  • 原文地址:https://www.cnblogs.com/zhihang/p/14714487.html
Copyright © 2020-2023  润新知