Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(xo-server): ignore disabled remotes when running VM backup #6430

Merged
merged 6 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [Plugin/auth-saml] Certificate input support multiline (PR [#6403](https://github.com/vatesfr/xen-orchestra/pull/6403))
- [Backup] Launch Health Check after a full backup (PR [#6401](https://github.com/vatesfr/xen-orchestra/pull/6401))
- [Backup] Fix `Lock file is already being held` error when deleting a VM backup while the VM is currently being backed up
- [Backup] Fix Backup stoping on `remote is disabled` error when other remotes are working (PR [#6430](https://github.com/vatesfr/xen-orchestra/pull/6430))
fbeauchamp marked this conversation as resolved.
Show resolved Hide resolved

### Packages to release

Expand Down
13 changes: 12 additions & 1 deletion packages/xo-server/src/xo-mixins/backups-ng/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,17 @@ export default class BackupNg {

const remotes = {}
const xapis = {}
const remoteErrors = {}
await waitAll([
asyncMapSettled(remoteIds, async id => {
const remote = await app.getRemoteWithCredentials(id)
let remote
try{
remote = await app.getRemoteWithCredentials(id)
}catch(error){
log.warn('Error while instantiating remote', {error, remoteId: id})
remoteErrors[id] = error
return
}
if (remote.proxy !== proxyId) {
throw new Error(
proxyId === undefined
Expand All @@ -221,6 +229,9 @@ export default class BackupNg {
}
}),
])
if(Object.keys(remotes).length === 0){
throw new Error(`couldn't instantiate any remote`, { errors: remoteErrors})
}

const params = {
job,
Expand Down