Open Closed

API error after upgrade 7.3.2 to 7.4.0-rc.4 #5875


User avatar
0
linhhn@arius.vn created

My solution uses multi tenant However, I have an entity that is only created for the host tenant After upgrading from 7.3.2 to 7.4.0-rc.4, that entity's GET api generates an error

An exception occurred while iterating over the results of a query for context type '"MySite.EntityFrameworkCore.MySiteDbContext"'."
""System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
   at MySqlConnector.MySqlDataReader.GetString(Int32 ordinal) in /_/src/MySqlConnector/MySqlDataReader.cs:line 298
   at lambda_method6242(Closure, DbDataReader, Int32[])
   at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadObject(DbDataReader reader, Int32 ordinal, ReaderColumn column)
   at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadRow()
   at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.InitializeAsync(DbDataReader reader, IReadOnlyList`1 columns, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.InitializeAsync(IReadOnlyList`1 columns, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.InitializeAsync(IReadOnlyList`1 columns, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
   at Pomelo.EntityFrameworkCore.MySql.Storage.Internal.MySqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()"
  • ABP Framework version: v7.4.0-rc.4
  • UI Type: Angular
  • Database System: EF Core MySQL
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

3 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello linhhn@arius.vn ,

    Can you please share more steps to reproduce this issue, and also it will be helpful if you share some details of the entity that you are getting error. Like Entity parameters, and its inheritance.

    Thank you, Anjali

  • User Avatar
    0
    linhhn@arius.vn created

    Hello linhhn@arius.vn ,

    Can you please share more steps to reproduce this issue, and also it will be helpful if you share some details of the entity that you are getting error. Like Entity parameters, and its inheritance.

    Thank you, Anjali

    My solosution is Separate tenant schema Before upgrading to version 7.4.0-rc.4, I had an entity that was not checked into Multi-tenant. It works fine in 7.3.2. After upgrading, if you call the Get all data api of that entity, a 500 error will occur All code related to this entity is automatically generated, I do not customize

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    H

    Can you share a simple project?

    liming.ma@volosoft.com

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11