{"record":{"id":"6e61047232966bca","repo":"KeygraphHQ/shannon","slug":"config-validation-failed","errorCode":"CONFIG_VALIDATION_FAILED","errorMessage":"Configuration file too large: ${stats.size} bytes (maximum: ${maxFileSize} bytes)","messagePattern":"Configuration file too large: (.+?) bytes \\(maximum: (.+?) bytes\\)","errorType":"validation","errorClass":"PentestError","httpStatus":null,"severity":"error","filePath":"apps/worker/src/config-parser.ts","lineNumber":195,"sourceCode":"\nexport const parseConfig = async (configPath: string): Promise<Config> => {\n  try {\n    // 1. Verify file exists\n    if (!(await fs.pathExists(configPath))) {\n      throw new PentestError(\n        `Configuration file not found: ${configPath}`,\n        'config',\n        false,\n        { configPath },\n        ErrorCode.CONFIG_NOT_FOUND,\n      );\n    }\n\n    // 2. Check file size\n    const stats = await fs.stat(configPath);\n    const maxFileSize = 1024 * 1024; // 1MB\n    if (stats.size > maxFileSize) {\n      throw new PentestError(\n        `Configuration file too large: ${stats.size} bytes (maximum: ${maxFileSize} bytes)`,\n        'config',\n        false,\n        { configPath, fileSize: stats.size, maxFileSize },\n        ErrorCode.CONFIG_VALIDATION_FAILED,\n      );\n    }\n\n    // 3. Read and check for empty content\n    const configContent = await fs.readFile(configPath, 'utf8');\n\n    if (!configContent.trim()) {\n      throw new PentestError(\n        'Configuration file is empty',\n        'config',\n        false,\n        { configPath },\n        ErrorCode.CONFIG_VALIDATION_FAILED,","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/KeygraphHQ/shannon/blob/1ae0a142f8525410a688f0309fd003cc5b1d92de/apps/worker/src/config-parser.ts#L177-L213","documentation":"parseConfig rejects when the config file exceeds 1 MB (1024 * 1024 bytes). The size cap is a guard against accidentally pointing -c at a binary or oversized file. Classified CONFIG_VALIDATION_FAILED (non-retryable).","triggerScenarios":"The -c path resolves to a large non-config file, or a YAML carrying a huge embedded blob (base64, a pasted log).","commonSituations":"Mistakenly pointing -c at a repo dump, a SARIF log, or a config with an accidentally pasted large block.","solutions":["Confirm -c points at the intended small YAML.","Move large embedded content (blobs, logs) out of the config file.","Check `du -h <config-path>` and trim below 1 MB."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { stat } from 'zx/fs';\nconst MAX = 1024 * 1024;\nconst { size } = await stat(configPath);\nif (size > MAX) throw new Error(`Config ${configPath} is ${size} bytes; limit is ${MAX}.`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep config files small — move blobs and logs out.","Double-check the -c target is the YAML config, not a sibling data file."],"tags":["config","filesystem","validation"],"backgroundTag":null,"analyzedSha":"1ae0a142f8525410a688f0309fd003cc5b1d92de","analyzedAt":"2026-08-12T17:40:03.583Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}