Skip to content
Latchkey

Unapproved license is blocking the build in CI

A license-compliance scanner exited non-zero because a dependency uses a license outside your approved set. The build is blocked on purpose: the gate is reporting a policy violation, so the fix is to remediate the dependency or record an approved exception, not to remove the check.

What this error means

A license-check step (license-checker, pip-licenses, go-licenses, cargo-deny, FOSSA, Trivy, or a custom script) fails with a package name and a license that is not on the allow list, and the pipeline stops before deploy.

Terminal
License policy check failed:
  package: some-lib 2.1.0
  license: GPL-3.0 (not in approved list)
  build blocked by license policy

Common causes

A new or upgraded dependency changed the license set

A dependency bump pulled in a package with a license your policy does not approve, so the gate that used to pass now fails on this revision.

The approved list does not cover a legitimate license

A license that legal actually permits was never added to the allow list, so a valid dependency is blocked until the policy is updated.

How to fix it

Remediate or record an approved exception

  1. Identify the exact package and license from the gate output.
  2. Replace the dependency with a permissively licensed alternative, or
  3. If legal approves the license, add it (or a per-package exception) to the policy.
Terminal
# example: allow a vetted license in the tool's config
# (license-checker shown; adapt to your scanner)
npx license-checker --onlyAllow "MIT;ISC;Apache-2.0;MPL-2.0"

Keep the gate, document the decision

Do not delete the check to unblock a release. Record the approval (allow-list entry or exception) with a reason so the audit trail stays intact.

notes
# document approvals alongside the policy file
# e.g. deny.toml exceptions, or an ALLOWED-LICENSES.md note

How to prevent it

  • Run the license gate on every PR so new licenses surface before release.
  • Keep the approved list current with legal so valid licenses are not blocked.
  • Record exceptions with reasons rather than disabling the check.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →