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

Enterprise account unable to perform automatic or manual license sync when using Dev release #2784

Closed
1 task done
Tracked by #2480
ipiqadm opened this issue Mar 8, 2023 · 16 comments · Fixed by #2864
Closed
1 task done
Tracked by #2480
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment

Comments

@ipiqadm
Copy link

ipiqadm commented Mar 8, 2023

Steps To Reproduce

  1. Go to 'Organizations -> Billing'
  2. Click on 'Sync License'

Expected Result

The license will sync properly with the vault.bitwarden.com enterprise account license assigned to it. The Last License sync should display the time and date I had tried syncing it.

Actual Result

An error message displays in the top right corner and the license is not properly synced. The license last sync time does not updated and shows "Never"

"An error has occurred: An unhandled server error has occurred."

Screenshots or Videos

error billing

Additional Context

Had a requirement to move to the Dev channel in order to fix the bug for . Now have found that the Billing sync no longer works, but did appear to work normally via the Beta channel.

Rotated the "BILLING SYNC TOKEN" several times in the vault.bitwarden.com portal and saved in the self-hosted portal and same result with the error.

Unable to use self-hosted as I cannot manually or automatically sync the license when on the Dev channel.

Githash Version

465681c-dirty

Environment Details

Ubuntu 22.04.1 Server

Database Image

MariaDB
#mariadb10

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.
@ipiqadm ipiqadm added bug bw-unified-deploy An Issue related to Bitwarden unified deployment labels Mar 8, 2023
@sso-bitwarden
Copy link

Hi there,

Thank you for your report!

I was able to reproduce this issue on "dev" tag, and have flagged this to our engineering team.

Thanks once again!

@ipiqadm
Copy link
Author

ipiqadm commented Mar 14, 2023

Hello,

Perfect thank you and appears to also now be in the beta version as well. I had tried to revert to beta and same behavior with the license no longer working. Hopefully this can be fixed in a few months time before the expired license disables the org. Need to wait till this is fixed before we can roll out to our org.

@ipiqadm
Copy link
Author

ipiqadm commented Mar 20, 2023

This issue is also preventing us from using hosted at all with an enterprise account and the docker unified instance. Any chance this particular issue could be made higher priority? Our organization is now suspended due to not being able to add the license.

@KitKat31337
Copy link

KitKat31337 commented Apr 12, 2023

This is preventing me from rolling out as well.

Here is the detailed error that no-one seems to have provided.

fail: Bit.Api.Utilities.ExceptionHandlerFilterAttribute[0]
      => SpanId:e7750ec67ae7e6a6, TraceId:9b67af810c5c6046dc92ef225fabf117, ParentId:0000000000000000 => ConnectionId:0HMPQU1VRGHLV => RequestPath:/organizations/licenses/self-hosted/<installationId>/sync/ RequestId:0HMPQU1VRGHLV:00000002 => Bit.Api.Controllers.SelfHosted.SelfHostedOrganizationLicensesController.SyncLicenseAsync (Api)
      Unable to cast object of type 'Bit.Core.Entities.Organization' to type 'Bit.Core.Models.Data.Organizations.SelfHostedOrganizationDetails'.
      System.InvalidCastException: Unable to cast object of type 'Bit.Core.Entities.Organization' to type 'Bit.Core.Models.Data.Organizations.SelfHostedOrganizationDetails'.
         at lambda_method1723(Closure , Object , SelfHostedOrganizationDetails , ResolutionContext )
         at AutoMapper.Mapper.MapCore[TSource,TDestination](TSource source, TDestination destination, ResolutionContext context, Type sourceType, Type destinationType, MemberMap memberMap)
         at AutoMapper.Mapper.Map[TSource,TDestination](TSource source, TDestination destination)
         at AutoMapper.Mapper.Map[TDestination](Object source)
         at Bit.Infrastructure.EntityFramework.Repositories.OrganizationRepository.GetSelfHostedOrganizationDetailsById(Guid id) in /source/src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs:line 167
         at Bit.Api.Controllers.SelfHosted.SelfHostedOrganizationLicensesController.SyncLicenseAsync(String id) in /source/src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs:line 99
         at lambda_method1717(Closure , Object )
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.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)

@KitKat31337
Copy link

I may have located a work around @ipiqadm

When I manually sync on the admin page of the instance, https://bitwardenurl/admin , I do not get any errors in the page, or the logs. However, it does not update the last updated on the org sync either. So I wont know for sure until my trial ends and it would actually change the license details.

@ipiqadm
Copy link
Author

ipiqadm commented Apr 12, 2023

@KitKat31337 Thanks for posting the log error. @justindbaur did mention they were able to reproduce it as well. I had tried that work around you mentioned with the admin page and even though it said it was synced it didn't actually work after checking the normal portal. The update date doesn't change either in the admin portal page too. So right now I am postponing the role out till this get's fixed, but may have no choice, but to move to the regular super bloated install method via the script.

@Fergus-Youtap
Copy link

Hi @ipiqadm and @KitKat31337. I hit this error hard and it was frustrating. However, I found a simple workaround until this gets fixed, simply make a new organisation and upload your license file to that. Then export the data out your old org and import it into your new. The only issue I had with this method was needing to reinvite users to the org, which is kinda a hassle.

Hope that helps! Cheers

@ipiqadm
Copy link
Author

ipiqadm commented Apr 19, 2023

@Fergus-Youtap I was thinking about potentially doing that as a workaround, but we are paying month to month as we are still trialing Bitwarden enterprise. That would require us to pay for the entire year and then we also won't be able to add more licenses when needed without setting up a fresh Org again. Thanks for the suggestion though!

@ipiqadm
Copy link
Author

ipiqadm commented Apr 20, 2023

@Fergus-Youtap @KitKat31337 Looks like a fix was created and just need to wait for the merge be approved then we can test.

@justindbaur Thank you so much for working on getting this issue resolved. It was a deal breaker for us using the self-hosted docker unified method.

@justindbaur
Copy link
Member

@ipiqadm Of course, unfortunately it will not make the April cutoff so it won't be in the beta channel for a while but the ticket will close when the PR merges. Feel free to reopen if you run into more issues.

@ipiqadm
Copy link
Author

ipiqadm commented Apr 20, 2023

@justindbaur I have been running in dev tag for some time so no worries if this will be awhile before in Beta. I am waiting with baited breath for it to be merged to dev :).

@KitKat31337
Copy link

@justindbaur Any approx timeline on when it would be merged into dev? I have a month before my license needs to be rechecked?

@justindbaur
Copy link
Member

@KitKat31337 I'll try to bother someone on Monday to review it. Should be able to get it in some l soon after.

@Sonorpearl
Copy link

Can this be merged into beta?

@justindbaur
Copy link
Member

@Sonorpearl It will be but not for another ~4 weeks.

@ipiqadm
Copy link
Author

ipiqadm commented Apr 25, 2023

@Sonorpearl I have been running in dev for several months and the only issue I have run into was resolved with this fix so you can probably switch to dev now if you need the fix and move to beta later once it is released there.

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.

7 participants
@Sonorpearl @KitKat31337 @justindbaur @ipiqadm @sso-bitwarden @Fergus-Youtap and others