Dokploy/dokploy · critical · Error

error instanceof Error ? error.message : "Error restoring mo

Error message

error instanceof Error ? error.message : "Error restoring mongo backup"

What it means

restoreComposeBackup wraps its whole restore flow in try/catch and rethrows either the caught error's message or the generic fallback 'Error restoring mongo backup' (copy-paste artifact: this is the compose restore, not mongo). Any failure in docker compose commands, volume handling, or file ops surfaces here.

Source

Thrown at packages/server/src/utils/restore/compose.ts:99

		emit(
			`Restoring database: ${backupInput.databaseName} from ${backupInput.backupFile}`,
		);

		if (serverId) {
			await execAsyncRemote(serverId, restoreCommand);
		} else {
			await execAsync(restoreCommand);
		}

		emit("Restore completed successfully!");
	} catch (error) {
		console.error(error);
		emit(
			`Error: ${
				error instanceof Error ? error.message : "Error restoring mongo backup"
			}`,
		);
		throw new Error(
			error instanceof Error ? error.message : "Error restoring mongo backup",
		);
	}
};

View on GitHub (pinned to 546686ea35)

Solutions

  1. Read console.error output emitted just before the throw to find the real underlying error
  2. Verify the backup archive is complete and volumes/paths match the original compose stack
  3. Ensure docker and compose plugin are available and the user has permissions
  4. Free disk space and retry the restore
Defensive patterns

Strategy: try-catch

Validate before calling

if (!existsSync(backupPath)) throw new Error('Backup file missing before restore');

Try / catch

try {
  await restoreComposeBackup(...);
} catch (e) {
  emit(`Restore failed: ${e instanceof Error ? e.message : String(e)}`);
  // keep partial state for manual cleanup
}

Prevention

When it happens

Trigger: Docker CLI errors during compose up, missing backup archive entries, permission issues on volume paths, or a non-Error rejection (e.g. string throw) which triggers the fallback message.

Common situations: Restoring a compose backup with mismatched volume definitions, insufficient disk space, or a partially uploaded backup file.

Related errors


AI-assisted analysis of Dokploy/dokploy@546686ea35 (2026-08-27). Data as JSON: /api/errors/924429664561c41d. Report an issue: GitHub.