Closed szubajak closed 7 years ago
Are you using in-memory config?
No we are not, we are loading our clients, scopes and resources configuration dynamically from a database.
Ok, I'll look into it.
Were you ever able to track down the exact location/cause? I did look into it and added a few ToArray() calls where it looked like it might be possibly related, but with out a repo it's hard to tell
We just released 2.0.0-RC1 and this is where I added these checks. Feel free to retest and report back. Also, if your load testing tool is something easy to use and something you can share, we can also use it to try to repro/test the issue.
That is the only log message type that I have. We are planning update to 2.0 in the near future, so thank you for the fix and effort.
I just found another place where I added a ToArray to ensure this is fixed. Thanks again.
@brockallen, i am currently having the same problem, i have the next configuration
Is there some library i should update?
System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.Collections.Generic.List
1.Enumerator.MoveNextRare()
at Microsoft.EntityFrameworkCore.Query.Expressions.SelectExpression.VisitChildren(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at Microsoft.EntityFrameworkCore.Query.Expressions.ColumnExpression.VisitChildren(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at System.Linq.Expressions.ExpressionVisitor.VisitBinary(BinaryExpression node)
at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.NullComparisonTransformingVisitor.VisitBinary(BinaryExpression expression)
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.ApplyOptimizations(Expression expression, Boolean searchCondition, Boolean joinCondition)
at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.VisitInnerJoin(InnerJoinExpression innerJoinExpression)
at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.1 items, Action
1 generationAction, Action1 joinAction) at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.VisitSelect(SelectExpression selectExpression) at .VisitSelect(SelectExpression ) at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.GenerateSql(IReadOnlyDictionary
2 parameterValues)
at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.GetRelationalCommand(IReadOnlyDictionary2 parameters) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable
1.Enumerator.BufferlessMoveNext(DbContext , Boolean buffer)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.Enumerator.MoveNext() at Microsoft.EntityFrameworkCore.Query.Internal.QueryBuffer.IncludeCollection[TEntity,TRelated,TElement](Int32 includeId, INavigation navigation, INavigation inverseNavigation, IEntityType targetEntityType, IClrCollectionAccessor clrCollectionAccessor, IClrPropertySetter inverseClrPropertySetter, Boolean tracking, TEntity entity, Func
1 relatedEntitiesFactory, Func3 joinPredicate) at lambda_method(Closure , QueryContext , ApiResource , Object[] ) at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler._Include[TEntity](QueryContext queryContext, TEntity entity, Object[] included, Action
3 fixup)
at lambda_method(Closure , ApiResource )
at System.Linq.Enumerable.SelectEnumerableIterator2.MoveNext() at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider._TrackEntities[TOut,TIn](IEnumerable
1 results, QueryContext queryContext, IList1 entityTrackingInfos, IList
1 entityAccessors)+MoveNext()
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor1.EnumeratorExceptionInterceptor.MoveNext() at System.Collections.Generic.LargeArrayBuilder
1.AddRange(IEnumerable1 items) at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable
1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at IdentityServer4.EntityFramework.Stores.ResourceStore.FindApiResourcesByScopeAsync(IEnumerable
1 scopeNames)
at IdentityServer4.Stores.IResourceStoreExtensions.FindResourcesByScopeAsync(IResourceStore store, IEnumerable1 scopeNames) at IdentityServer4.Stores.IResourceStoreExtensions.FindEnabledResourcesByScopeAsync(IResourceStore store, IEnumerable
1 scopeNames)
at IdentityServer4.Validation.ScopeValidator.AreScopesAllowedAsync(Client client, IEnumerable1 requestedScopes) at IdentityServer4.Validation.AuthorizeRequestValidator.ValidateScopeAsync(ValidatedAuthorizeRequest request) at IdentityServer4.Validation.AuthorizeRequestValidator.ValidateAsync(NameValueCollection parameters, ClaimsPrincipal subject) at IdentityServer4.Endpoints.AuthorizeEndpointBase.ProcessAuthorizeRequestAsync(NameValueCollection parameters, ClaimsPrincipal user, ConsentResponse consent) at IdentityServer4.Endpoints.AuthorizeEndpoint.ProcessAsync(HttpContext context) at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.Invoke(HttpContext context) at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.CspMiddleware.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)
I'm using IdentityServer4.EntityFramework 2.1.1 Problem is in FindApiResourcesByScopeAsync method.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi all,
Recently we had performance tests. Under load during performance test several users receiving 500 error.
Is that something we should care about?
Thanks for help in advance, Jakub