The API Answers 402 After a License Change (Pro)

A request that adds or changes data answers 402 Payment Required with this body (the figures and the measure are your own):

{"exceeded_usage": "DefectDojo is currently in read only mode as there are currently 131.25% (2625 / 2000) Total Findings"}

In the application, the same refusal shows a Usage Exceeded notification with that message, or the License Usage Exceeded error page. A classic page redirects with the message as a banner.

Before DefectDojo 3.2.200 the same refusal answered 429 Too Many Requests. It is not rate limiting, and retrying does not clear it.

Cause

Usage is at or above 130% of what the license allows for its measure, so DefectDojo has gone read only. Usage passed 90% first, which shows a warning but blocks nothing. A license with a monthly spend cap is the exception: it blocks at 100% of the cap, and its message gives the month-to-date spend in dollars.

The measure is named at the end of the message: Total Findings, Findings and Endpoints, Users, Assets, Allowed Storage, Weekly Finding Usage or Processed Findings. A license change can block an instance that was fine a minute earlier when the new license:

  • allows less of the same measure, or
  • counts a different measure, for example Findings and Endpoints in place of Total Findings.

Only writes are refused: POST, PUT and PATCH, apart from those that add no usage, such as a search sent as a POST, an export or a change to your own preferences. Reading, exporting, signing in and deleting keep working.

Confirm

Open View License in the application. It shows each measure the license counts, the current usage and the limit. The percentage in the 402 message is the same figure.

Fix

Bring usage back under the limit, or install a license whose limit covers it.

  • The wrong license was installed: install the right one the way you installed this one, for example sudo -E dojo-compose-cli license update on Docker Compose, or the license Secret on Kubernetes.
  • The license is right and usage is too high: reduce usage, for example by deleting data you no longer need, or contact DefectDojo for a license with a higher limit.

The usage figure is cached for up to two minutes. A license saved through the application recounts at once. If the 402 continues right after the new license is in place, wait two minutes and try again.