From 6c982496f7b9cd9ef08308e1edd820b3910a7833 Mon Sep 17 00:00:00 2001 From: Miika Alikirri Date: Wed, 25 Jun 2025 14:07:00 +0300 Subject: [PATCH] nics: ignore domain not found error caused by domain being removed If user is in the VMDetails page during migration, the VM might get deleted before domainInterfaceAddresses is done processing. This race condition can end up causing a confusing view where the UI shows a redundant "Domain not found" error, and the regular "VM doesn't exist" page at the same time --- src/components/vm/nics/vmNicsCard.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/vm/nics/vmNicsCard.tsx b/src/components/vm/nics/vmNicsCard.tsx index e45e14f..53674cc 100644 --- a/src/components/vm/nics/vmNicsCard.tsx +++ b/src/components/vm/nics/vmNicsCard.tsx @@ -301,8 +301,15 @@ export class VmNetworkTab extends React.Component { const allRejected = !domifaddressAllSources.some(promise => promise.status == 'fulfilled'); + // If user is in the VMDetails page during migration, the VM might get deleted + // before domainInterfaceAddresses is done processing. This race condition can end up + // causing a confusing view where the UI shows a redundant "Domain not found error" + // and the regular VM doesn't exist page, at the same time. + const domainNotFound = domifaddressAllSources.some(promise => + promise.status === 'rejected' && promise.reason?.message.startsWith("Domain not found:") + ); - if (allRejected) { + if (allRejected && !domainNotFound) { this.props.onAddErrorNotification({ text: cockpit.format(_("Failed to fetch the IP addresses of the interfaces present in $0"), this.props.vm.name), detail: [...new Set(domifaddressAllSources.map(promise => promise.status == 'rejected' && promise.reason ? promise.reason.message : ''))].join(', '),