From 0f1822e417281e2577561ddca04700f519e99c7e Mon Sep 17 00:00:00 2001 From: aschumann-virtualcable Date: Tue, 21 Jul 2026 12:41:36 +0200 Subject: [PATCH] fix(physicalmachines): use the current MAC for Wake-on-LAN set_ready() woke the machine up with the _mac stored in the user-service. Records migrated from v3.6 carry an empty _mac, so the magic packet went nowhere and the machine never came up. Refresh ip/mac from the Server model before waking up. Also skip the WOL endpoint when the MAC is the null one: an all-zeros MAC is not a target, and building an endpoint for it only produced a request that could never work. --- src/uds/services/PhysicalMachines/deployment_multi.py | 3 +++ src/uds/services/PhysicalMachines/provider.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/uds/services/PhysicalMachines/deployment_multi.py b/src/uds/services/PhysicalMachines/deployment_multi.py index 9397b9c18..6fb5298a8 100644 --- a/src/uds/services/PhysicalMachines/deployment_multi.py +++ b/src/uds/services/PhysicalMachines/deployment_multi.py @@ -94,6 +94,9 @@ def get_unique_id(self) -> str: @typing.override def set_ready(self) -> types.states.TaskState: + # User-services migrated from v3.6 may carry an empty _mac, so refresh from + # the Server model before waking up or WOL would be sent to nothing. + self.update_ip() self.service().wakeup(self._ip, self._mac) return types.states.TaskState.FINISHED diff --git a/src/uds/services/PhysicalMachines/provider.py b/src/uds/services/PhysicalMachines/provider.py index b682d3103..9e33d36c4 100644 --- a/src/uds/services/PhysicalMachines/provider.py +++ b/src/uds/services/PhysicalMachines/provider.py @@ -36,7 +36,7 @@ from django.utils.translation import gettext_noop as _ -from uds.core import exceptions, services, types +from uds.core import consts, exceptions, services, types from uds.core.ui.user_interface import gui from uds.core.util import net, resolver @@ -119,7 +119,7 @@ def wake_on_lan_endpoint(self, host: str, mac: str) -> str: Returns: str: URL of WOL server or empty ('') if no server for the ip is found """ - if not self.config.value or not host or not mac: + if not self.config.value or not host or not mac or mac == consts.NULL_MAC: return '' # If host is a hostname, try to resolve it