Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections cannot be managed in family organization #2750

Closed
1 task done
Tracked by #2480
Barzangi-82 opened this issue Feb 27, 2023 · 8 comments · Fixed by #2765
Closed
1 task done
Tracked by #2480

Collections cannot be managed in family organization #2750

Barzangi-82 opened this issue Feb 27, 2023 · 8 comments · Fixed by #2765
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment

Comments

@Barzangi-82
Copy link

Steps To Reproduce

  1. Upgrade docker container to latest 2023.2.1 release
  2. Login to the Webvault
  3. Click "Organizations" tab, vault tab under organization should be selected automatically

Expected Result

A view showing the filter view with the collections etc. on the left and the collections/entries in the middle pane.

Actual Result

A loading indicator on the left running "forever" (waited 15 minutes) and all entries of the entire vault loading in the middle with a gray empty square where normally the collections it is in are shown. (According to the online view in the webvault).

Also the "api.log" shows the following error:

fail[39m[22m[49m:` Bit.Api.Utilities.ExceptionHandlerFilterAttribute[0]
      => SpanId:8de51beafea0925d, TraceId:89ce70322580ad6bb13c9e4618aaeb44, ParentId:0000000000000000 => ConnectionId:0HMONBQUKRF78 => RequestPath:/organizations/<redacted>/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)

Screenshots or Videos

2023-02-27 20_00_37-Vaults _ Bitwarden Web Vault

Additional Context

Seems to be related to some issue with EF-translation of the query. Looking at the code it seems that the "groups" and "user" query could have the same issue. (Lines 188 & 193 src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs)
Doing some research one possible solution from Stackoverflow was to add an "orderBy" in the query: https://stackoverflow.com/questions/70423147/translation-of-select-which-contains-grouping-parameter-without-composition-is

You can also not edit any existing user, add a new one or add a new collection, as it only shows the loading indicator in the popup and also narrows down to the same error in the logs.

Githash Version

3cedc0c-dirty

Environment Details

  • Synology DSM 7.1.1
  • Docker
  • Intel Pentium N3710

Database Image

mariadb: 10.6

Issue-Link

#2480

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
@Barzangi-82 Barzangi-82 added bug bw-unified-deploy An Issue related to Bitwarden unified deployment labels Feb 27, 2023
@LoveNumberr
Copy link

L'errore specifico riportato indica che l'espressione LINQ non può essere tradotta. Ciò potrebbe essere dovuto a un problema di compatibilità tra la versione di Docker che hai aggiornato e il codice sorgente dell'applicazione Webvault.
Una soluzione potrebbe essere quella di controllare se ci sono aggiornamenti disponibili per l'applicazione Webvault che potrebbero risolvere questo problema di compatibilità. In alternativa, potrebbe essere necessario aprire una segnalazione di errore con il team di supporto dell'applicazione per richiedere assistenza nella risoluzione del problema.

@sso-bitwarden
Copy link

Hi there,

Thank you for your report!

I was able to reproduce this issue, and have flagged this to the Bitwarden engineering team.

Thanks once again!

@cvondra
Copy link

cvondra commented Mar 1, 2023

Any idea on time frame when this will be fixed? Paying for a family sub that is unusable due to this error.

@cvondra
Copy link

cvondra commented Mar 7, 2023

Latest push to /dev works perfectly.

@holow29
Copy link

holow29 commented Mar 9, 2023

Beta tag seems to still have this issue even though it says it is on server 2023.2.2 as of latest push. I'm not really sure how that happens. I assumed dev = beta when they are pushed at the same time (and at the least that the server would include changes made prior to the version bump).

@cvondra
Copy link

cvondra commented Mar 9, 2023

That's a great question. I don't know what changes were pushed to beta. It was odd to see both pushed at the same time last night and I immediately changed my tag to beta and rebuilt the container. I too noticed that this fix was not implemented in the beta at that time. There's not a lot of view into their pipeline to understand what is pushing when.

@holow29
Copy link

holow29 commented Mar 9, 2023

Glad to have confirmation. @justindbaur can you provide any insight into why this might be the case? Usually the server releases are versioned such that any commit before the tag is included. How could it be then that the beta release says version 2023.2.2 but does not have this fix in it, which is in a commit prior to the version bump?

@justindbaur
Copy link
Member

@holow29 Our code is not versioned that anything before a tag is included. We create an rc branch that is essentially frozen without higher approval to fix a bug, once that code has been approved by our QA we THEN make a tag like: XXXX.X.0 and that will be our months release. We release that code and if there are any bugs that need fixing we will create a XXXX.X.n+1 tag BASED ON XXXX.X.n and that bug fix NOT master. The attached PR was just merged into master and I did not backport the fix for hotfixing.

I won't say a definitive never but unified issues will very rarely be hotfixed while it is in beta. Once it is out of beta it will be just like the standard product.

The dev tag is updated whenever we push to master and the beta tag is pushed to whenever we build on the rc branch which doesn't exist right now as we haven't frozen our code for an upcoming release yet. We will be shortly though and the beta tag will get the fix then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants