From 80097ea7776ce99c1e8424e4b48591daafed31a2 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Wed, 10 Jan 2024 15:38:15 +0100 Subject: [PATCH] fix(backups/RestoreMetadataBackup): fix data path resolution Introduced by ad46bde30 Fixes https://xcp-ng.org/forum/post/68999 --- @xen-orchestra/backups/RestoreMetadataBackup.mjs | 2 +- CHANGELOG.unreleased.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/@xen-orchestra/backups/RestoreMetadataBackup.mjs b/@xen-orchestra/backups/RestoreMetadataBackup.mjs index 704f40f89..c6ade418b 100644 --- a/@xen-orchestra/backups/RestoreMetadataBackup.mjs +++ b/@xen-orchestra/backups/RestoreMetadataBackup.mjs @@ -21,7 +21,7 @@ export class RestoreMetadataBackup { }) } else { const metadata = JSON.parse(await handler.readFile(join(backupId, 'metadata.json'))) - const dataFileName = resolve(backupId, metadata.data ?? 'data.json') + const dataFileName = resolve('/', backupId, metadata.data ?? 'data.json').slice(1) const data = await handler.readFile(dataFileName) // if data is JSON, sent it as a plain string, otherwise, consider the data as binary and encode it diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 97c197ef2..3f70600bf 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -20,6 +20,7 @@ - [Plugin/load-balancer] Prevent unwanted migrations to hosts with low free memory (PR [#7288](https://github.com/vatesfr/xen-orchestra/pull/7288)) - Avoid unnecessary `pool.add_to_other_config: Duplicate key` error in XAPI log [Forum#68761](https://xcp-ng.org/forum/post/68761) - [Jobs] Reset parameters when editing method to avoid invalid parameters on execution [Forum#69299](https://xcp-ng.org/forum/post/69299) +- [Metadata Backup] Fix `ENOENT` error when restoring an _XO Config_ backup [Forum#68999](https://xcp-ng.org/forum/post/68999) ### Packages to release