{"record":{"id":"97dcd5acda69fcee","repo":"n8n-io/n8n","slug":"third-party-licenses-file-not-found","errorCode":null,"errorMessage":"Third-party licenses file not found","messagePattern":"Third-party licenses file not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"packages/cli/src/controllers/third-party-licenses.controller.ts","lineNumber":23,"sourceCode":"\nimport { CLI_DIR } from '@/constants';\n\n@RestController('/third-party-licenses')\nexport class ThirdPartyLicensesController {\n\t/**\n\t * Get third-party licenses content\n\t * Requires authentication to access\n\t */\n\t@Get('/')\n\tasync getThirdPartyLicenses(_: Request, res: Response) {\n\t\tconst licenseFile = resolve(CLI_DIR, 'THIRD_PARTY_LICENSES.md');\n\n\t\ttry {\n\t\t\tconst content = await readFile(licenseFile, 'utf-8');\n\t\t\tres.setHeader('Content-Type', 'text/markdown; charset=utf-8');\n\t\t\tres.send(content);\n\t\t} catch {\n\t\t\tres.status(404).send('Third-party licenses file not found');\n\t\t}\n\t}\n}\n","sourceCodeStart":5,"sourceCodeEnd":27,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/controllers/third-party-licenses.controller.ts#L5-L27","documentation":"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'.","triggerScenarios":"GET /third-party-licenses when the THIRD_PARTY_LICENSES.md file is absent from CLI_DIR at runtime.","commonSituations":"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.","solutions":["Run the build/license-extraction step that produces THIRD_PARTY_LICENSES.md so it lands in CLI_DIR.","Ensure the deployment image copies the generated file into the CLI distribution directory.","Verify CLI_DIR resolution on the host if a custom working dir is set."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Optional: probe for the file's existence is not exposed; treat 404 as non-fatal.\nasync function getLicensesSafely(api) {\n  const res = await api.get('/third-party-licenses');\n  return res.status === 404 ? null : res.body;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await api.get('/third-party-licenses');\n} catch (e) {\n  if (e.status === 404 && /Third-party licenses file not found/.test(e.message)) {\n    // regenerate/bundle the asset; surface a soft 'not available' in the UI\n  } else { throw e; }\n}","preventionTips":["Run the license-extraction build step in CI.","Include THIRD_PARTY_LICENSES.md in deployment images."],"tags":["licensing","build","assets","deployment"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}