Fission-AI/OpenSpec · error · SchemaLoadError

Failed to read schema at

Error message

Failed to read schema at '${schemaPath}': ${ioError.message}

What it means

The schema file was located but could not be read from disk (fs.readFileSync failed, e.g. EACCES or EISDIR). The original OS-level error is wrapped in a SchemaLoadError carrying the schema path, so inspect err.cause for the underlying reason.

Solutions

  1. Check that the process has read permission on the schema file and its parent directories
  2. Verify the schema path is a regular file, not a directory or broken symlink
  3. Inspect the wrapped cause error for the exact errno and act on it
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/core/artifact-graph/resolver.ts:202 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/9e9ffed9a1fac7cb. Report an issue: GitHub.

Appendix: source

Thrown at src/core/artifact-graph/resolver.ts:202

  const normalizedName = name.replace(/\.ya?ml$/, '');

  const schemaDir = getSchemaDir(normalizedName, projectRoot);
  if (!schemaDir) {
    const availableSchemas = listSchemas(projectRoot);
    throw new Error(
      `Schema '${normalizedName}' not found. Available schemas: ${availableSchemas.join(', ')}`
    );
  }

  const schemaPath = path.join(schemaDir, 'schema.yaml');

  // Load and parse the schema
  let content: string;
  try {
    content = fs.readFileSync(schemaPath, 'utf-8');
  } catch (err) {
    const ioError = err instanceof Error ? err : new Error(String(err));
    throw new SchemaLoadError(
      `Failed to read schema at '${schemaPath}': ${ioError.message}`,
      schemaPath,
      ioError
    );
  }

  try {
    return parseSchema(content);
  } catch (err) {
    if (err instanceof SchemaValidationError) {
      throw new SchemaLoadError(
        `Invalid schema at '${schemaPath}': ${err.message}`,
        schemaPath,
        err
      );
    }
    const parseError = err instanceof Error ? err : new Error(String(err));
    throw new SchemaLoadError(

View on GitHub (pinned to 6926ccb18a)