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

Directory Connector Sync fails #5055

Open
1 task done
KramNamez opened this issue Nov 21, 2024 · 3 comments
Open
1 task done

Directory Connector Sync fails #5055

KramNamez opened this issue Nov 21, 2024 · 3 comments
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment

Comments

@KramNamez
Copy link

Steps To Reproduce

When trying to use bwdc sync, an unhandled server error occurs, and the server logs [ERR] The entity type 'OrganizationUser' was not found. Ensure that the entity type has been added to the model.

Directory connector is able to connect to our LDAP and gets the expected users and groups, but the call to import it into Bitwarden fails.

Expected Result

Users and groups successfully imported into Bitwarden.

Actual Result

Users and groups failed to be imported into Bitwarden.

Screenshots or Videos

No response

Additional Context

No response

Githash Version

ad8aec9-dirty

Environment Details

No response

Database Image

Postgres 16.4

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.
@KramNamez KramNamez added bug bw-unified-deploy An Issue related to Bitwarden unified deployment labels Nov 21, 2024
@daniellbw
Copy link

Hi there,

I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below.

Thanks!

@KramNamez
Copy link
Author

I wish I did, but I really don't know what would help. I tried going through the code to figure out where things go wrong, I tried hunting down similar bug reports with EF, but nothing was fruitful, short of trying to build BW from source and debugging like that. And I'm not yet at a point where I'm going quite that far :)

@KramNamez
Copy link
Author

Bit.Api.Utilities.ExceptionHandlerFilterAttribute[0]"
=> SpanId:b5e4f2c8e290246b, TraceId:fc5586b9e6f104c8b539f6270cac8fa4, ParentId:0000000000000000 => ConnectionId:0HN8DICCJTKBS => RequestPath:/public/organization/import RequestId:0HN8DICCJTKBS:00000001 => IpAddress:::1 UserAgent:Bitwarden_DC/[object Promise] (LINUX) DeviceType:8 Origin:8 ClientVersion:2024.10.0 => Bit.Api.AdminConsole.Public.Controllers.OrganizationController.Import (Api)"
System.InvalidOperationException: The entity type 'OrganizationUser' was not found. Ensure that the entity type has been added to the model."
The entity type 'OrganizationUser' was not found. Ensure that the entity type has been added to the model."
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.GetOrCreateEntry(Object entity)"
   at Microsoft.EntityFrameworkCore.DbContext.SetEntityStates(IEnumerable`1 entities, EntityState entityState)"
   at Bit.Infrastructure.EntityFramework.Repositories.OrganizationUserRepository.ReplaceManyAsync(IEnumerable`1 organizationUsers) in /source/src/Infrastructure.EntityFramework/AdminConsole/Repositories/OrganizationUserRepository.cs:line 497"
   at Microsoft.EntityFrameworkCore.DbContext.UpdateRange(IEnumerable`1 entities)"
   at Bit.Core.Services.OrganizationService.ImportAsync(Guid organizationId, IEnumerable`1 groups, IEnumerable`1 newUsers, IEnumerable`1 removeUserExternalIds, Boolean overwriteExisting, EventSystemUser eventSystemUser) in /source/src/Core/AdminConsole/Services/Implementations/OrganizationService.cs:line 1664"
   at Bit.Infrastructure.EntityFramework.Repositories.OrganizationUserRepository.UpsertManyAsync(IEnumerable`1 organizationUsers) in /source/src/Infrastructure.EntityFramework/AdminConsole/Repositories/OrganizationUserRepository.cs:line 565"
   at Bit.Api.AdminConsole.Public.Controllers.OrganizationController.Import(OrganizationImportRequestModel model) in /source/src/Api/AdminConsole/Public/Controllers/OrganizationController.cs:line 51"
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, 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.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)"
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)"
   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)"

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