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

restoreMongoBackup catches failures of the mongorestore-based flow (docker exec into the mongo container with a gunzipped archive) and rethrows error.message or a generic fallback. Root cause is logged via console.error and emitted to the restore event stream.

Source

Thrown at packages/server/src/utils/restore/mongo.ts:56

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

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

		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. Inspect the emitted error and docker logs on the mongo container for mongorestore output
  2. Validate the archive (gunzip -t, mongorestore --archive --dryRun if available)
  3. Align mongodump/mongorestore and server versions between backup and restore targets
  4. Ensure the mongo container is running and credentials are correct
Defensive patterns

Strategy: try-catch

Validate before calling

execSync('gunzip -t archive.gz');

Try / catch

try {
  await restoreMongoBackup(...);
} catch (e) {
  // read emitted error lines, check mongorestore version compatibility
}

Prevention

When it happens

Trigger: mongorestore version mismatch with the archive format (e.g. archive from newer mongodump), corrupt gzip stream, wrong mongo container name, or auth failure inside the container.

Common situations: Restoring a dump from MongoDB 6 into a 4.4 container; archive truncated mid-transfer; container stopped mid-restore.

Related errors


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