n8n-io/n8n · warning

Third-party licenses file not found

Error message

Third-party licenses file not found

What it means

The endpoint serves the bundled THIRD_PARTY_LICENSES.md from CLI_DIR. If readFile rejects (file missing or unreadable), the catch sets a 404 with body 'Third-party licenses file not found'.

Source

Thrown at packages/cli/src/controllers/third-party-licenses.controller.ts:23

import { CLI_DIR } from '@/constants';

@RestController('/third-party-licenses')
export class ThirdPartyLicensesController {
	/**
	 * Get third-party licenses content
	 * Requires authentication to access
	 */
	@Get('/')
	async getThirdPartyLicenses(_: Request, res: Response) {
		const licenseFile = resolve(CLI_DIR, 'THIRD_PARTY_LICENSES.md');

		try {
			const content = await readFile(licenseFile, 'utf-8');
			res.setHeader('Content-Type', 'text/markdown; charset=utf-8');
			res.send(content);
		} catch {
			res.status(404).send('Third-party licenses file not found');
		}
	}
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Run the build/license-extraction step that produces THIRD_PARTY_LICENSES.md so it lands in CLI_DIR.
  2. Ensure the deployment image copies the generated file into the CLI distribution directory.
  3. Verify CLI_DIR resolution on the host if a custom working dir is set.
Defensive patterns

Strategy: fallback

Validate before calling

// Optional: probe for the file's existence is not exposed; treat 404 as non-fatal.
async function getLicensesSafely(api) {
  const res = await api.get('/third-party-licenses');
  return res.status === 404 ? null : res.body;
}

Try / catch

try {
  await api.get('/third-party-licenses');
} catch (e) {
  if (e.status === 404 && /Third-party licenses file not found/.test(e.message)) {
    // regenerate/bundle the asset; surface a soft 'not available' in the UI
  } else { throw e; }
}

Prevention

When it happens

Trigger: GET /third-party-licenses when the THIRD_PARTY_LICENSES.md file is absent from CLI_DIR at runtime.

Common situations: Build step that generates/bundles the licenses file was skipped or failed; a slim/custom deployment image omitted the asset; CLI_DIR resolves to an unexpected path.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/97dcd5acda69fcee. Report an issue: GitHub.