How do I find which users count against my Bitbucket Server license?

Still need help?

The Atlassian Community is here for you.

Ask the community

This article only applies to the Atlassian server platform. Learn more about the differences between cloud and server.

Problem

The number of licensed users is exhausted but it isn't evident what users are occupying license seats.

Resolution #1 (Bitbucket version 5.2.0+ only)

Install the Centralized license visibility plugin:

  1. Login to Bitbucket Server as an administrator and go to Administration >> Find New Apps
  2. Search for "centralized license visibility"
  3. Click Install

Once the plugin is installed, you may have to wait for a while. For 100k users, it may take up to 10 minutes so 15-20 minutes should be adequate. Then, run the following query against the database:

PostgreSQL
SELECT "VERSION", COUNT(*) FROM "AO_A020FF_LICENSED_USER"  GROUP BY "VERSION" ORDER BY 1 DESC;
Oracle
SELECT version, COUNT(*) FROM AO_A020FF_LICENSED_USER GROUP BY version ORDER BY 1 DESC;

The plugin always maintains last two sets of licensed users collected. Hence, a descending sort by version will show the latest licensed user count on the first row of the output

To force refresh the table, Use the following REST endpoint:

curl -u <admin-user> -X POST <bitbucket_url>/rest/panopticon/1.0/scheduler/collect-data

Resolution #2

Use the REST API endpoint /rest/api/1.0/admin/license to get the maximumNumberOfUsers, which is your upper bound for your current ongoing license as well as the currentNumberOfUsers which is the number of licensed users in the system:

curl -u username:password -X GET <bitbucket_url>/rest/api/1.0/admin/license 
Output Example
{
 "creationDate": 1532872800000,
 "purchaseDate": 1532872800000,
 "expiryDate": null,
 "numberOfDaysBeforeExpiry": 2147483647,
 "maintenanceExpiryDate": 1564408800000,
 "numberOfDaysBeforeMaintenanceExpiry": 203,
 "gracePeriodEndDate": null,
 "numberOfDaysBeforeGracePeriodExpiry": 2147483647,
 "maximumNumberOfUsers": 100,
 "unlimitedNumberOfUsers": false,
 "serverId": "<My server ID>",
 "supportEntitlementNumber": "SEN-500",
 "license": "<My license number>",
 "status": { 
   "currentNumberOfUsers": 13, 
   "serverId": "<My server ID>" 
 }

Resolution #3

Bitbucket development team wrote a small plugin that will help determine what users Bitbucket Server sees:

  1. Log in to Bitbucket Server as an administrator and go to Administration > Manage Add-on and click on "Upload add-on".
  2. Paste the following URL into the "From this URL" field and click "Upload": https://packages.atlassian.com/maven/com/atlassian/bitbucket/plugins/user-permission-debugger/0.9.0/user-permission-debugger-0.9.0.jar
    You can also go to the link to download the jar and use the upload option.
  3. Wait for the plugin to install, then:

    • Browse to <bitbucket_url>/plugins/servlet/users-with/LICENSED_USER which will display the active licensed users.

The plugin is locked down to administrators but it can be uninstalled from the Manage Plugins screen if preferred.


Existing feature request

BSERV-7571 - Getting issue details... STATUS


DescriptionThe number of licensed users is exhausted but it isn't evident what users are occupying license seats.
Last modified on Oct 16, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.