bitwarden / self-host

Bitwarden's self-hosted release repository
GNU General Public License v3.0
326 stars 58 forks source link

Collections cannot be managed #84

Closed Barzangi-82 closed 1 year ago

Barzangi-82 commented 1 year ago

I just updated my self-hosted docker to the latest version 2023.2.1 and now I am unable to manage collections in my family organization. The vault overview shows all entries just fine including the display if it is my own entry or from the family organization. When I open the organization tab it just shows all entries without the collections and the left pane where the collections should be displayed is only showing the rotating circles trying to load the collection list I suppose. I cannot add a new collection as the popup only shows the same loading indicator. In the entry table all entries are shown but instead of the collection names it just shows some small grey boxes.

The docker uses a maria-db database for data storage. The api.log contains the following message:

fail[39m[22m[49m:` Bit.Api.Utilities.ExceptionHandlerFilterAttribute[0]
      => SpanId:8de51beafea0925d, TraceId:89ce70322580ad6bb13c9e4618aaeb44, ParentId:0000000000000000 => ConnectionId:0HMONBQUKRF78 => RequestPath:/organizations/2c1ac356-be09-422c-b4fe-af8f01695194/collections/details RequestId:0HMONBQUKRF78:00000002 => Bit.Api.Controllers.CollectionsController.GetManyWithDetails (Api)
      The LINQ expression 'DbSet<CollectionGroup>()
          .Where(cg => cg.Collection.OrganizationId == __organizationId_0 && __Select_1
              .Contains(cg.Collection.Id))
          .GroupBy(cg => cg.CollectionId)
          .Select(g => g)' could not be translated. Additional information: Translation of 'Select' which contains grouping parameter without composition is not supported. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
      System.InvalidOperationException: The LINQ expression 'DbSet<CollectionGroup>()
          .Where(cg => cg.Collection.OrganizationId == __organizationId_0 && __Select_1
              .Contains(cg.Collection.Id))
          .GroupBy(cg => cg.CollectionId)
          .Select(g => g)' could not be translated. Additional information: Translation of 'Select' which contains grouping parameter without composition is not supported. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
         at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.Expand(Expression query)
         at Microsoft.EntityFrameworkCore.Query.QueryTranslationPreprocessor.Process(Expression query)
         at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.<Execute>b__0()
         at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
         at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
         at Bit.Infrastructure.EntityFramework.Repositories.CollectionRepository.<>c__DisplayClass10_1.<GetManyByUserIdWithAccessAsync>b__7(CollectionDetails collection) in /source/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs:line 247
         at System.Linq.Enumerable.SelectListIterator`2.ToList()
         at Bit.Infrastructure.EntityFramework.Repositories.CollectionRepository.GetManyByUserIdWithAccessAsync(Guid userId, Guid organizationId) in /source/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs:line 246
         at Bit.Api.Controllers.CollectionsController.GetManyWithDetails(Guid orgId) in /source/src/Api/Controllers/CollectionsController.cs:line 88
         at lambda_method1059(Closure , Object )
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Barzangi-82 commented 1 year ago

In the users tab the collections are shown in the overview but when you try to manage them for a user, only the loading indicator appears in the popup and the logs seems to be complaining about the same issue:

      The LINQ expression 'DbSet<CollectionGroup>()
          .Where(cg => cg.Collection.OrganizationId == __organizationId_0 && __Select_1
              .Contains(cg.Collection.Id))
          .GroupBy(cg => cg.CollectionId)
          .Select(g => g)' could not be translated. Additional information: Translation of 'Select' which contains grouping parameter without composition is not supported. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
      System.InvalidOperationException: The LINQ expression 'DbSet<CollectionGroup>()
          .Where(cg => cg.Collection.OrganizationId == __organizationId_0 && __Select_1
              .Contains(cg.Collection.Id))
          .GroupBy(cg => cg.CollectionId)
          .Select(g => g)' could not be translated. Additional information: Translation of 'Select' which contains grouping parameter without composition is not supported. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
         at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.Expand(Expression query)
         at Microsoft.EntityFrameworkCore.Query.QueryTranslationPreprocessor.Process(Expression query)
         at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.<Execute>b__0()
         at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
         at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
         at Bit.Infrastructure.EntityFramework.Repositories.CollectionRepository.<>c__DisplayClass10_1.<GetManyByUserIdWithAccessAsync>b__7(CollectionDetails collection) in /source/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs:line 247
         at System.Linq.Enumerable.SelectListIterator`2.ToList()
         at Bit.Infrastructure.EntityFramework.Repositories.CollectionRepository.GetManyByUserIdWithAccessAsync(Guid userId, Guid organizationId) in /source/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs:line 246
         at Bit.Api.Controllers.CollectionsController.GetManyWithDetails(Guid orgId) in /source/src/Api/Controllers/CollectionsController.cs:line 88
         at lambda_method1059(Closure , Object )
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Barzangi-82 commented 1 year ago

Just found out there is a special bug report form and section in the server repository for the unified-server stuff. So I reposted it there: https://github.com/bitwarden/server/issues/2750