chatboxai/chatbox · error · Error

Backup contains an entry not listed in manifest: ${path}

Error message

Backup contains an entry not listed in manifest: ${path}

What it means

Thrown when the zip contains an entry whose path is not listed in the manifest. The manifest must enumerate every archived file; an unlisted entry is treated as unexpected content (possible tampering or unrecognized future-format files). Propagates after rollback.

Source

Thrown at src/renderer/packages/backup/import-backup.ts:100

    manifest.data.settings,
    manifest.data.copilots,
    manifest.data.sessionSettings,
    ...manifest.sessions,
    ...manifest.resources,
  ].filter((entry): entry is NonNullable<typeof entry> => Boolean(entry))
  const expectedPaths = new Set<string>([BACKUP_MANIFEST_PATH])
  for (const descriptor of descriptors) {
    if (expectedPaths.has(descriptor.path)) throw new Error(`Manifest contains a duplicate path: ${descriptor.path}`)
    expectedPaths.add(descriptor.path)
    const staged = stagedEntries.get(descriptor.path)
    if (!staged) throw new Error(`Backup entry is missing: ${descriptor.path}`)
    if (staged.size !== descriptor.size) throw new Error(`Backup entry size mismatch: ${descriptor.path}`)
    if (staged.checksum.value !== descriptor.checksum.value) {
      throw new Error(`Backup entry checksum mismatch: ${descriptor.path}`)
    }
  }
  for (const path of stagedEntries.keys()) {
    if (!expectedPaths.has(path)) throw new Error(`Backup contains an entry not listed in manifest: ${path}`)
  }
  if (expectedPaths.size !== stagedEntries.size) throw new Error('Backup manifest entry list is incomplete')
  validateBackupManifestGraph(manifest)
}

async function readStagedResource(storage: BackupStorage, plan: Pick<ResourceWritePlan, 'resource' | 'tempKey'>) {
  const base64 = await storage.getBlob(plan.tempKey)
  if (base64 === null) throw new Error(`Staged resource is missing: ${plan.resource.path}`)
  return decodeStoredBlob(base64ToBytes(base64), plan.resource.encoding, plan.resource.mimeType)
}

async function findAvailableCollisionKey(storage: BackupStorage, originalKey: string, reserved: Set<string>) {
  for (let attempt = 0; attempt < 100; attempt++) {
    let candidatePrefix = 'resource:imported'
    for (const prefix of ['picture:', 'file:', 'link:', 'parseFile-', 'parseUrl-']) {
      if (originalKey.startsWith(prefix)) {
        candidatePrefix = `${prefix}imported`
        break

View on GitHub (pinned to 81571269ad)

Solutions

  1. Use a backup produced by a compatible app version.
  2. If you added files to the zip, remove them or regenerate a consistent archive.
  3. Update the manifest to list every archived file (only if you control the format).

Example fix

// before: zip carries __MACOSX metadata not in the manifest
await importBackupArchive(file, options)
// after: list entries and confirm each is manifest-listed before import
const extra = zipEntryPaths.filter((p) => !expectedPaths.has(p))
if (extra.length) throw new Error('Unexpected entries: ' + extra.join(', '))
Defensive patterns

Strategy: validation

Validate before calling

// Compare archive entries against manifest-declared paths before importing.
const extra = zipEntryPaths.filter((p) => !expectedPaths.has(p))
if (extra.length) throw new Error('Archive contains unmanifested entries: ' + extra.join(', '))

Try / catch

try {
  await importBackupArchive(file, options)
} catch (error) {
  if (error instanceof Error && error.message.startsWith('Backup contains an entry not listed in manifest')) {
    // Re-zip excluding foreign files (e.g. __MACOSX, .DS_Store).
    throw new Error('Archive has unexpected entries', { cause: error })
  }
  throw error
}

Prevention

When it happens

Trigger: stagedEntries has a path that is neither BACKUP_MANIFEST_PATH nor any descriptor.path from settings/copilots/sessionSettings/sessions/resources.

Common situations: Someone dropped an extra file into the zip; a backup from a newer format version the importer does not recognize; a manifest that was trimmed but the zip was not.

Related errors


AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12). Data as JSON: /api/errors/e54273d7902d1de6. Report an issue: GitHub.