diegosouzapw/OmniRoute · error · Error

Backup metadata not found: ${backupId}

Error message

Backup metadata not found: ${backupId}

What it means

Error "Backup metadata not found: ${backupId}" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/shared/services/backupService.ts:162

  return backups;
}

/**
 * Restore a backup by its id (filename).
 */
export async function restoreBackup(toolId: string, backupId: string) {
  const dir = getToolBackupDir(toolId);
  // Anchor backupId within the tool dir — prevent path traversal via backupId
  const backupPath = safePath(toolId, backupId);
  const metaPath = backupPath + ".meta.json";

  // Read metadata to find original path
  let meta;
  try {
    const raw = await fs.readFile(metaPath, "utf-8");
    meta = JSON.parse(raw);
  } catch {
    throw new Error(`Backup metadata not found: ${backupId}`);
  }

  // Verify actual backup file exists
  try {
    await fs.access(backupPath);
  } catch {
    throw new Error(`Backup file not found: ${backupId}`);
  }

  // Before restoring, back up the current file (so restore is reversible)
  await createBackup(toolId, meta.originalPath);

  // Copy backup over the original
  const targetDir = path.dirname(meta.originalPath);
  await fs.mkdir(targetDir, { recursive: true });
  await fs.copyFile(backupPath, meta.originalPath);

  return {

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/shared/services/backupService.ts:162 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/135fa6a49bd9215a. Report an issue: GitHub.