KeygraphHQ/shannon · error · PentestError

CONFIG_VALIDATION_FAILED

CONFIG_VALIDATION_FAILED

Error message

Configuration file too large: ${stats.size} bytes (maximum: ${maxFileSize} bytes)

What it means

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).

Source

Thrown at apps/worker/src/config-parser.ts:195

export const parseConfig = async (configPath: string): Promise<Config> => {
  try {
    // 1. Verify file exists
    if (!(await fs.pathExists(configPath))) {
      throw new PentestError(
        `Configuration file not found: ${configPath}`,
        'config',
        false,
        { configPath },
        ErrorCode.CONFIG_NOT_FOUND,
      );
    }

    // 2. Check file size
    const stats = await fs.stat(configPath);
    const maxFileSize = 1024 * 1024; // 1MB
    if (stats.size > maxFileSize) {
      throw new PentestError(
        `Configuration file too large: ${stats.size} bytes (maximum: ${maxFileSize} bytes)`,
        'config',
        false,
        { configPath, fileSize: stats.size, maxFileSize },
        ErrorCode.CONFIG_VALIDATION_FAILED,
      );
    }

    // 3. Read and check for empty content
    const configContent = await fs.readFile(configPath, 'utf8');

    if (!configContent.trim()) {
      throw new PentestError(
        'Configuration file is empty',
        'config',
        false,
        { configPath },
        ErrorCode.CONFIG_VALIDATION_FAILED,

View on GitHub (pinned to 1ae0a142f8)

Solutions

  1. Confirm -c points at the intended small YAML.
  2. Move large embedded content (blobs, logs) out of the config file.
  3. Check `du -h <config-path>` and trim below 1 MB.
Defensive patterns

Strategy: validation

Validate before calling

import { stat } from 'zx/fs';
const MAX = 1024 * 1024;
const { size } = await stat(configPath);
if (size > MAX) throw new Error(`Config ${configPath} is ${size} bytes; limit is ${MAX}.`);

Prevention

When it happens

Trigger: The -c path resolves to a large non-config file, or a YAML carrying a huge embedded blob (base64, a pasted log).

Common situations: Mistakenly pointing -c at a repo dump, a SARIF log, or a config with an accidentally pasted large block.

Related errors


AI-assisted analysis of KeygraphHQ/shannon@1ae0a142f8 (2026-08-12). Data as JSON: /api/errors/6e61047232966bca. Report an issue: GitHub.