diff --git a/@xen-orchestra/immutable-backups/src/directory.mts b/@xen-orchestra/immutable-backups/src/directory.mts index a867c3a45b..09b5b87df4 100644 --- a/@xen-orchestra/immutable-backups/src/directory.mts +++ b/@xen-orchestra/immutable-backups/src/directory.mts @@ -8,17 +8,18 @@ export async function makeImmutable(dirPath: string): Promise { // chattr processes all paths even when some are missing (it does not abort on the first // error), so every existing path is correctly lifted. // -// Per-path "while trying to stat" messages (ENOENT) are silently ignored regardless of -// locale — these are always expected for optional paths (.xva, .alias.vhd, …) that are -// absent in delta backups. chattr localises the error description but "while trying to -// stat" is always emitted in English, so we match on that suffix only. +// Per-path "while trying to stat" messages (ENOENT) are silently ignored — these are always +// expected for optional paths (.xva, .alias.vhd, …) that are absent in delta backups. chattr +// translates that whole message, so it is run under `LC_ALL=C`: without it, every batch +// containing an optional missing path fails on a localised system, which means no backup ever +// gets locked there. // // Any other error (e.g. EAGAIN on NFS when the file is still open, permission denied) is // retried up to 3 times with a 1 s delay before being re-thrown. async function execChattrWithMissingFiles(args: string[]): Promise { for (let attempt = 0; ; attempt++) { try { - await execa('chattr', args) + await execa('chattr', args, { env: { LC_ALL: 'C' } }) return } catch (err) { const stderr = (err as ExecaError).stderr ?? '' diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 56e0abcbd7..88385421f3 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -16,6 +16,7 @@ ### Bug fixes > Users must be able to say: "I had this issue, happy to know it's fixed" +- [Immutable backups] Backups are protected again on file servers whose system language is not English: immutability was silently not applied at all on those (PR [#10182](https://github.com/vatesfr/xen-orchestra/pull/10182)) ### Packages to release @@ -33,6 +34,7 @@ +- @xen-orchestra/immutable-backups patch - @xen-orchestra/web minor