coleam00/Archon · error

Downloaded YAML is empty for '${slug}'

Error message

Downloaded YAML is empty for '${slug}'

What it means

After downloading the workflow YAML for an install, the command verifies the content is not blank before writing it. An empty (whitespace-only) body from raw.githubusercontent.com would otherwise produce a useless zero-content workflow file, so it fails loudly with the slug named.

Source

Thrown at packages/cli/src/commands/workflow.ts:5191

  }

  console.log(`Run with: archon workflow run ${slug} "<message>"`);
}

async function installSingleFile(
  entry: MarketplaceEntryJson,
  slug: string,
  archonDir: string,
  force: boolean | undefined,
  existsSync: (p: string) => boolean,
  mkdirSync: (p: string, opts: { recursive: boolean }) => void,
  writeFileSync: (p: string, data: string) => void
): Promise<void> {
  const { owner, repo, path } = parseGitHubUrl(entry.sourceUrl);
  const content = await downloadRawFile(owner, repo, path, entry.sha);

  if (!content.trim()) {
    throw new Error(`Downloaded YAML is empty for '${slug}'`);
  }

  const workflowsDir = join(archonDir, 'workflows');
  const destPath = join(workflowsDir, `${slug}.yaml`);

  if (existsSync(destPath) && !force) {
    throw new Error(`Workflow '${slug}' already exists at ${destPath}.\nUse --force to overwrite.`);
  }

  mkdirSync(workflowsDir, { recursive: true });
  writeFileSync(destPath, content);
  console.log(`Installed '${entry.name}' to ${destPath}`);
}

async function installDirectory(
  entry: MarketplaceEntryJson,
  slug: string,
  archonDir: string,

View on GitHub (pinned to 0773b97458)

Solutions

  1. Check the file at the pinned SHA: `gh api repos/<owner>/<repo>/contents/<path>?ref=<sha>` — is it empty?
  2. Fix the marketplace entry's sha/path to point at the real non-empty workflow file
  3. Re-push the workflow content upstream and update the entry's SHA
  4. Retry in case a transient fetch glitch returned an empty body

Example fix

// before
if (!content.trim()) throw new Error(`Downloaded YAML is empty for '${slug}'`);
// after
const yaml = await parseYaml(content); // parse instead of just trimming
if (!content.trim() || typeof yaml !== 'object') {
  throw new Error(`Downloaded YAML is empty or unparseable for '${slug}' (sha ${entry.sha})`);
}
Defensive patterns

Strategy: validation

Validate before calling

const head = await fetch(`https://api.github.com/repos/${owner}/${repo}/contents/${path}?ref=${sha}`);
const meta = await head.json();
if (meta.size === 0) throw new Error(`Workflow file ${path}@${sha} is empty upstream`);

Type guard

function isNonEmptyYaml(content: string): boolean {
  return content.trim().length > 0;
}

Try / catch

try {
  await workflowInstallCommand(slug);
} catch (e) {
  if (e instanceof Error && e.message.includes('Downloaded YAML is empty')) {
    // fix marketplace sha/path or re-push content upstream
  } else throw e;
}

Prevention

When it happens

Trigger: `installSingleWorkflowFile` downloads via `downloadRawFile` and `content.trim()` is empty — e.g. the file at the pinned SHA is empty, or the fetch silently returned an empty body (rare transport/edge cases).

Common situations: Repo contains an intentionally empty placeholder workflow; the marketplace entry points at an empty file (wrong path resolved); an interrupted write upstream left an empty file at that SHA; odd CDN edge serving an empty body.

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/ba2e54c5c3ab91ae. Report an issue: GitHub.