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

Organization domain maintenance failed because of untranslated query #3722

Open
1 task done
holow29 opened this issue Jan 30, 2024 · 2 comments
Open
1 task done

Organization domain maintenance failed because of untranslated query #3722

holow29 opened this issue Jan 30, 2024 · 2 comments
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment

Comments

@holow29
Copy link
Contributor

holow29 commented Jan 30, 2024

Steps To Reproduce

  1. Deploy docker/self-host:v2024.1.2
  2. Create organization with user (maybe not required - unsure)

Other steps may be required, but I am unsure how to trigger Organization Domain Maintenance.

Expected Result

No errors in admin.log

Actual Result

Error in admin.log:

fail: Bit.Core.Services.OrganizationDomainService[0]
      Organization domain maintenance failed
      System.InvalidOperationException: The LINQ expression 'DbSet<OrganizationDomain>()
          .Where(o => (DateTime.UtcNow - o.CreationDate).Days == 4 && o.VerifiedDate == null)' could not be translated. 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.QueryableMethodTranslatingExpressionVisitor.<VisitMethodCall>g__CheckTranslated|15_0(ShapedQueryExpression translated, <>c__DisplayClass15_0& )
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         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__DisplayClass12_0`1.<ExecuteAsync>b__0()
         at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetAsyncEnumerator(CancellationToken cancellationToken)
         at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.GetAsyncEnumerator()
         at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
         at Bit.Infrastructure.EntityFramework.Repositories.OrganizationDomainRepository.GetExpiredOrganizationDomainsAsync() in /source/src/Infrastructure.EntityFramework/Repositories/OrganizationDomainRepository.cs:line 126
         at Bit.Core.Services.OrganizationDomainService.OrganizationDomainMaintenanceAsync() in /source/src/Core/Services/Implementations/OrganizationDomainService.cs:line 101

Screenshots or Videos

No response

Additional Context

Appears to have been reported a few months ago: #3416

Githash Version

dca8d00

Environment Details

Docker

Database Image

mariadb:11

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.
@holow29 holow29 added bug bw-unified-deploy An Issue related to Bitwarden unified deployment labels Jan 30, 2024
@Greenderella
Copy link
Member

Hi @holow29

Can you confirm if after clearing the logs as suggested here solves the issue?

@holow29
Copy link
Contributor Author

holow29 commented Jan 31, 2024

@Greenderella I have cleared the logs once but the issue came back; it appears to be intermittent - as I said, I am unsure when organization domain maintenance is triggered. Regardless, it is clear the query is not being translated by EF correctly for MySQL/mariadb and that should probably be resolved.

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

No branches or pull requests

2 participants