Open Closed

ABP 10.6 on Oracle/Devart: login fails — NullReferenceException in Devart query translation on POST /connect/token #10881


User avatar
0
ThomasA created

Check the docs before asking a question: https://abp.io/docs/latest Check the samples to see the basic tasks: https://abp.io/docs/latest/samples The exact solution to your question may have been answered before, and please first use the search on the homepage.

Provide us with the following info: 🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration button.

2026-09-14 17:31:00.062 +02:00 [Error] (Microsoft.EntityFrameworkCore.Query) An exception occurred while iterating over the results of a query for context type '"Volo.Abp.OpenIddict.EntityFrameworkCore.OpenIddictDbContext"'."\r\n""System.NullReferenceException: Object reference not set to an instance of an object.\r\n at (Object)\r\n at System.Data.Common.CommandTrees.DbExpressionCloner.VisitSqlParameter(SqlParameterExpression sourceParameterExpression)\r\n at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression)\r\n at Devart.Common.Entity.DbExpressionRelinqer.cHg(SqlExpression )\r\n at Devart.Common.Entity.DbExpressionRelinqer.eHK(SqlExpression )\r\n at System.Linq.Enumerable.ListSelectIterator2.ToList()\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)\r\n at Devart.Common.Entity.DbExpressionRelinqer.VisitIn(InExpression inExpression)\r\n at pwq.ch8(Object, InExpression inExpression, pwq)\r\n at System.Data.Common.CommandTrees.DbExpressionCloner.VisitIn(InExpression inExpression)\r\n at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression)\r\n at Devart.Common.Entity.DbExpressionRelinqer.cHg(SqlExpression )\r\n at Devart.Common.Entity.DbExpressionRelinqer.VisitSqlBinary(SqlBinaryExpression sqlBinaryExpression)\r\n at System.Data.Common.CommandTrees.DbExpressionCloner.VisitSqlBinary(SqlBinaryExpression sqlBinaryExpression)\r\n at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression)\r\n at Devart.Common.Entity.DbExpressionRelinqer.cHg(SqlExpression )\r\n at Devart.Common.Entity.DbExpressionRelinqer.VisitWherePredicate(SqlExpression predicate)\r\n at Devart.Common.Entity.DbExpressionRelinqer.VisitSelect(SelectExpression selectExpression)\r\n at System.Data.Common.CommandTrees.DbExpressionCloner.VisitSelect(SelectExpression selectExpression)\r\n at d1P.ch8(Object, SelectExpression selectExpression, d1P)\r\n at System.Data.Common.CommandTrees.OracleExpressionCloner.VisitSelect(SelectExpression source)\r\n at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression)\r\n at Devart.Common.Entity.DbQueryProcessor.Process(Expression selectExpression, ParametersCacheDecorator parametersValues)\r\n at XPv.ch8(Object, Expression selectExpression, ParametersCacheDecorator parametersValues, XPv)\r\n at Devart.Data.Oracle.Entity.OracleQueryProcessor.Process(Expression selectExpression, ParametersCacheDecorator parametersValues)\r\n at Microsoft.EntityFrameworkCore.Query.RelationalParameterBasedSqlProcessor.Process(Expression queryExpression, Dictionary2 parameters, Boolean& canCache)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.RelationalCommandCache.GetRelationalCommandTemplate(Dictionary2 parameters)\r\n at Microsoft.EntityFrameworkCore.Internal.RelationalCommandResolverExtensions.RentAndPopulateRelationalCommand(RelationalCommandResolver relationalCommandResolver, RelationalQueryContext queryContext)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.MoveNextAsync()" System.NullReferenceException: Object reference not set to an instance of an object. at (Object) at System.Data.Common.CommandTrees.DbExpressionCloner.VisitSqlParameter(SqlParameterExpression sourceParameterExpression) at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression) at Devart.Common.Entity.DbExpressionRelinqer.cHg(SqlExpression ) at Devart.Common.Entity.DbExpressionRelinqer.eHK(SqlExpression ) at System.Linq.Enumerable.ListSelectIterator2.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Devart.Common.Entity.DbExpressionRelinqer.VisitIn(InExpression inExpression) at pwq.ch8(Object, InExpression inExpression, pwq) at System.Data.Common.CommandTrees.DbExpressionCloner.VisitIn(InExpression inExpression) at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression) at Devart.Common.Entity.DbExpressionRelinqer.cHg(SqlExpression ) at Devart.Common.Entity.DbExpressionRelinqer.VisitSqlBinary(SqlBinaryExpression sqlBinaryExpression) at System.Data.Common.CommandTrees.DbExpressionCloner.VisitSqlBinary(SqlBinaryExpression sqlBinaryExpression) at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression) at Devart.Common.Entity.DbExpressionRelinqer.cHg(SqlExpression ) at Devart.Common.Entity.DbExpressionRelinqer.VisitWherePredicate(SqlExpression predicate) at Devart.Common.Entity.DbExpressionRelinqer.VisitSelect(SelectExpression selectExpression) at System.Data.Common.CommandTrees.DbExpressionCloner.VisitSelect(SelectExpression selectExpression) at d1P.ch8(Object, SelectExpression selectExpression, d1P) at System.Data.Common.CommandTrees.OracleExpressionCloner.VisitSelect(SelectExpression source) at Microsoft.EntityFrameworkCore.Query.SqlExpressionVisitor.VisitExtension(Expression extensionExpression) at Devart.Common.Entity.DbQueryProcessor.Process(Expression selectExpression, ParametersCacheDecorator parametersValues) at XPv.ch8(Object, Expression selectExpression, ParametersCacheDecorator parametersValues, XPv) at Devart.Data.Oracle.Entity.OracleQueryProcessor.Process(Expression selectExpression, ParametersCacheDecorator parametersValues) at Microsoft.EntityFrameworkCore.Query.RelationalParameterBasedSqlProcessor.Process(Expression queryExpression, Dictionary2 parameters, Boolean& canCache) at Microsoft.EntityFrameworkCore.Query.Internal.RelationalCommandCache.GetRelationalCommandTemplate(Dictionary2 parameters) at Microsoft.EntityFrameworkCore.Internal.RelationalCommandResolverExtensions.RentAndPopulateRelationalCommand(RelationalCommandResolver relationalCommandResolver, RelationalQueryContext queryContext) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken) at Volo.Abp.OpenIddict.Scopes.EfCoreOpenIddictScopeRepository.FindByNamesAsync(String[] names, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.OpenIddict.Scopes.AbpOpenIddictScopeStore.FindByNamesAsync(ImmutableArray1 names, CancellationToken cancellationToken)+MoveNext() at Volo.Abp.OpenIddict.Scopes.AbpOpenIddictScopeStore.FindByNamesAsync(ImmutableArray1 names, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult() at Volo.Abp.OpenIddict.Scopes.AbpOpenIddictScopeCache.FindByNamesAsync(ImmutableArray1 names, CancellationToken cancellationToken)+MoveNext() at Volo.Abp.OpenIddict.Scopes.AbpOpenIddictScopeCache.FindByNamesAsync(ImmutableArray1 names, CancellationToken cancellationToken)+MoveNext() at Volo.Abp.OpenIddict.Scopes.AbpOpenIddictScopeCache.FindByNamesAsync(ImmutableArray1 names, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult() at OpenIddict.Core.OpenIddictScopeManager1.<>c__DisplayClass20_0.<<FindByNamesAsync>g__ExecuteAsync|0>d.MoveNext() --- End of stack trace from previous location --- at OpenIddict.Core.OpenIddictScopeManager1.<>c__DisplayClass20_0.<<FindByNamesAsync>g__ExecuteAsync|0>d.MoveNext() --- End of stack trace from previous location --- at OpenIddict.Core.OpenIddictScopeManager1.<>c__DisplayClass20_0.<<FindByNamesAsync>g__ExecuteAsync|0>d.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token) at OpenIddict.Core.OpenIddictScopeManager1.ListResourcesAsync(ImmutableArray1 scopes, CancellationToken cancellationToken)+MoveNext() at OpenIddict.Core.OpenIddictScopeManager1.ListResourcesAsync(ImmutableArray1 scopes, CancellationToken cancellationToken)+MoveNext() at OpenIddict.Core.OpenIddictScopeManager1.ListResourcesAsync(ImmutableArray1 scopes, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult() at Volo.Abp.OpenIddict.Controllers.AbpOpenIdDictControllerBase.GetResourcesAsync(ImmutableArray1 scopes) at Volo.Abp.OpenIddict.Controllers.AbpOpenIdDictControllerBase.GetResourcesAsync(ImmutableArray`1 scopes) at Volo.Abp.OpenIddict.Controllers.TokenController.SetSuccessResultAsync(OpenIddictRequest request, IdentityUser user) at Volo.Abp.OpenIddict.Controllers.TokenController.HandlePasswordAsync(OpenIddictRequest request) at Volo.Abp.OpenIddict.Controllers.TokenController.HandleAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

Steps

  1. ABP 10.6 solution configured for Oracle through the Devart provider ("DatabaseType": "Oracle").
  2. Run the DbMigrator so the schema is at 10.6 and the OpenIddict applications are seeded.
  3. Start the HTTP API host. It starts cleanly — no error yet.
  4. POST /connect/token: grant_type=password scope=
  5. Result: HTTP 500, NullReferenceException thrown during query translation on OpenIddictDbContext, inside Devart.Common.Entity.DbExpressionRelinqer.VisitIn.
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi,

    Could you share the exact Devart.Data.Oracle.EFCore version in your solution? You can run this in the .EntityFrameworkCore project folder and send the Devart.* and Microsoft.EntityFrameworkCore* lines:

    dotnet list package --include-transitive
    

    In the meantime, could you try these one at a time and let us know the result:

    1. Upgrade Devart.Data.Oracle.EFCore to the latest 11.2.192.10. Devart has fixed several Contains query issues for EF Core 10 in recent releases: https://www.devart.com/dotconnect/oracle/revision_history.html

    2. If it still fails, switch the parameterized collection translation to constants in your YourProjectNameEntityFrameworkCoreModule:

    Configure<AbpDbContextOptions>(options =>
    {
        options.UseOracle(builder =>
        {
            builder.UseParameterizedCollectionMode(Microsoft.EntityFrameworkCore.ParameterTranslationMode.Constant);
        });
    });
    

    The question was closed shortly after it was created. If you've already solved it, could you share what fixed it?

    Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.