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

error 500 in Billing > Subscription #5223

Open
1 task done
rsulzenbacher opened this issue Jan 7, 2025 · 5 comments
Open
1 task done

error 500 in Billing > Subscription #5223

rsulzenbacher opened this issue Jan 7, 2025 · 5 comments
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment

Comments

@rsulzenbacher
Copy link

rsulzenbacher commented Jan 7, 2025

Steps To Reproduce

  1. Go to self-hosted instance
  2. Click on 'Admin Console'
  3. Then, go to 'Billing' > 'Subscription'

Expected Result

Webpage to renew/upload new license

Actual Result

Loading spinner, nothing more.
500 error page.

Screenshots or Videos

Screenshot 2025-01-07 at 10 52 22

Additional Context

From api.log

2025-01-07 09:42:59.263 +00:00 [ERR] Unable to resolve service for type 'Bit.Core.Billing.Repositories.IOrganizationInstallationRepository' while attempting to activate 'Bit.Api.Billing.Controllers.OrganizationsController'.
System.InvalidOperationException: Unable to resolve service for type 'Bit.Core.Billing.Repositories.IOrganizationInstallationRepository' while attempting to activate 'Bit.Api.Billing.Controllers.OrganizationsController'.
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ThrowHelperUnableToResolveService(Type type, Type requiredBy)
   at lambda_method600(Closure, IServiceProvider, Object[])
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Githash Version

ed090c8-dirty

Environment Details

bitwarden.sh version 2024.12.1
Docker version 27.2.0
Docker Compose version v2.20.3
Ubuntu Linux

Database Image

mariadb:10

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.
@rsulzenbacher rsulzenbacher added bug bw-unified-deploy An Issue related to Bitwarden unified deployment labels Jan 7, 2025
@EugenVau
Copy link

I've got the exactly same issue on bitwarden unified docker compose setup.

@mklitzn
Copy link

mklitzn commented Jan 23, 2025

Same here, with all versions after 2024.12.0-beta (that is the last one working) - including 2025.1.1-beta

@thesnallygaster
Copy link

thesnallygaster commented Jan 23, 2025

Exactly the same issue here on 2025.1.3 :|
In case it helps anyone I got these errors in the logs around the time I updated from 2024.12.1 to 2025.1.2
I think it may be related to this PR #5088 and may be fixed by this PR #5283

You can scratch that, the error I got appears to have gotten there before a database migration that added the missing/required table, that same query executes fine now but the error in Billing > Subscription is still the same

@mklitzn
Copy link

mklitzn commented Feb 8, 2025

still the same in bitwarden/self-host:2025.1.3-beta

2025-02-08 15:42:43.830 +01:00 [ERR] Unable to resolve service for type 'Bit.Core.Billing.Repositories.IOrganizationInstallationRepository' while attempting to activate 'Bit.Api.Billing.Controllers.OrganizationsController'.
System.InvalidOperationException: Unable to resolve service for type 'Bit.Core.Billing.Repositories.IOrganizationInstallationRepository' while attempting to activate 'Bit.Api.Billing.Controllers.OrganizationsController'.
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ThrowHelperUnableToResolveService(Type type, Type requiredBy)
   at lambda_method1125(Closure, IServiceProvider, Object[])
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

@maxkreja
Copy link

maxkreja commented Feb 8, 2025

For everyone that is having issues with renewing their licenses because of this issue, there is an easy workaround: we can skip the broken web interface and access the API to upload our new license.

DISCLAIMER: I have used AI to quickly search through the code and figure out this workaround and to generate the following instructions. It worked for me, but it might not work for you, and you should carefully review the following information before making any changes to productive installations.

Manual License Renewal for Self-Hosted Bitwarden Organizations

This is a workaround for the broken subscription management in the web interface. The API endpoint is the same one the web interface would use, we're just bypassing the broken UI.

Prerequisites

  • Your new license file (JSON format) from Bitwarden
  • Your organization ID (can be found in the URL when viewing your organization in the web vault)
  • A valid authentication token

Step-by-Step Instructions

1. Get an Authentication Token

  1. Log into your Bitwarden web vault
  2. Open browser developer tools (F12)
  3. Go to Network tab
  4. Make any action in the vault
  5. Find any request to your Bitwarden instance
  6. Copy the full Authorization header value (starts with "Bearer ")

2. Upload the License

Use the following curl command:

curl -X POST "https://YOUR_BITWARDEN_DOMAIN/api/organizations/licenses/self-hosted/YOUR_ORG_ID" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "License=@path/to/your/license.json"

Replace:

  • YOUR_BITWARDEN_DOMAIN with your instance's domain
  • YOUR_ORG_ID with your organization ID
  • YOUR_TOKEN with the Bearer token from step 1
  • path/to/your/license.json with the path to your license file

No restart is required. The changes should take effect immediately and premium features should be available again. You might lock- and unlock your vault once, if the client doesn't immediately recognize the renewed license.

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

5 participants