Dokploy/dokploy · critical · Error

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

Error message

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

What it means

restoreMariadbBackup catches any failure in the execAsync-based mariadb restore (docker exec into the mariadb container, gunzip, mysql client) and rethrows error.message or the generic fallback. The true cause is visible in the console.error/emit lines preceding the throw.

Source

Thrown at packages/server/src/utils/restore/mariadb.ts:58

		);

		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 mariadb backup"
			}`,
		);
		throw new Error(
			error instanceof Error ? error.message : "Error restoring mariadb backup",
		);
	}
};

View on GitHub (pinned to 546686ea35)

Solutions

  1. Check the emitted 'Error: ...' line and container logs (docker logs mariadb) for the SQL-level cause
  2. Confirm backup file integrity (gunzip -t) and retry the download/restore
  3. Match MariaDB/MySQL major versions between backup source and target container
  4. Verify container name and credentials used by the exec command
Defensive patterns

Strategy: try-catch

Validate before calling

execSync('gunzip -t backup.sql.gz'); // validate archive first

Try / catch

try {
  await restoreMariadbBackup(...);
} catch (e) {
  const msg = e instanceof Error ? e.message : String(e);
  // inspect mariadb container logs for the SQL error, fix dump, retry
}

Prevention

When it happens

Trigger: mysql client rejects the dump (SQL syntax/version mismatch, charset issues), container name not found, backup file corrupt/truncated, or wrong credentials inside the container.

Common situations: Restoring a dump made on a newer MariaDB/MySQL into an older container; gzip stream truncated during download; root password mismatch in the target container.

Related errors


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