paperclipai/paperclip · error · Error

The default LLM Wiki space cannot be archived.

Error message

The default LLM Wiki space cannot be archived.

What it means

Thrown by updateSpace when the resolved space is the default space (slug === DEFAULT_SPACE_SLUG) and the caller tries to set its status to 'archived'. The default space is required infrastructure and cannot be archived via the update path.

Source

Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:1473

    settings: input.settings ?? {},
    status: "active",
    createdAt: null,
    updatedAt: null,
  };
  await bootstrapSpaceFiles(ctx, input.companyId, space);
  await upsertWikiInstance(ctx, { companyId: input.companyId, wikiId });
  return { status: "created", space };
}

export async function updateSpace(ctx: PluginContext, input: UpdateSpaceInput): Promise<{ status: "ok"; space: WikiSpace }> {
  const nextStatus = input.status ?? null;
  if (nextStatus !== null && nextStatus !== "active" && nextStatus !== "archived") {
    throw new Error("LLM Wiki space status must be active or archived.");
  }
  const space = nextStatus === "active" ? await resolveSpaceAnyStatus(ctx, input) : await resolveSpace(ctx, input);
  const nextDisplayName = stringField(input.displayName);
  if (space.slug === DEFAULT_SPACE_SLUG && nextStatus === "archived") {
    throw new Error("The default LLM Wiki space cannot be archived.");
  }
  await ctx.db.execute(
    `UPDATE ${spaceTable(ctx)}
        SET display_name = COALESCE($4, display_name),
            settings = CASE WHEN $5::jsonb IS NULL THEN settings ELSE settings || $5::jsonb END,
            status = COALESCE($6, status),
            updated_at = now()
      WHERE company_id = $1 AND wiki_id = $2 AND slug = $3`,
    [
      input.companyId,
      space.wikiId,
      space.slug,
      nextDisplayName,
      input.settings ? jsonParam(input.settings) : null,
      nextStatus ?? null,
    ],
  );
  if (nextStatus === "archived") {

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Exclude the default space from archive operations.
  2. If you need to disable ingestion on the default space, disable the ingestion profile instead of archiving the space.
  3. Skip status updates for slug === 'default'.

Example fix

// before
for (const s of spaces) {
  await updateSpace(ctx, { companyId, spaceSlug: s.slug, status: "archived" });
}

// after
for (const s of spaces) {
  if (s.slug === DEFAULT_SPACE_SLUG) continue;
  await updateSpace(ctx, { companyId, spaceSlug: s.slug, status: "archived" });
}
Defensive patterns

Strategy: type-guard

Validate before calling

function assertNotArchivingDefault(slug, status) {
  if (slug === "default" && status === "archived") {
    throw new Error("The default LLM Wiki space cannot be archived.");
  }
}

Type guard

function isArchiveDefaultViolation(slug, status) {
  return slug === "default" && status === "archived";
}

Try / catch

try {
  await updateSpace(ctx, { companyId, spaceSlug, status });
} catch (err) {
  if (/default LLM Wiki space cannot be archived/.test(err.message)) {
    // disable ingestion instead
    return updatePaperclipIngestionProfile(ctx, { companyId, spaceSlug, profile: { ...profile, enabled: false } });
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling updateSpace on the default space with status: 'archived'.

Common situations: Bulk-archiving all spaces without excluding the default; UI 'archive all' action; script treating every space uniformly.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/fd8b75212234a5f3. Report an issue: GitHub.