From 8741ad43b4619012f8e3a88ca84c5d9524198115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Tue, 17 Dec 2024 22:19:05 -0500 Subject: [PATCH 1/2] incusd/cluster: Add missing error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/incusd/api_cluster_evacuation.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/incusd/api_cluster_evacuation.go b/cmd/incusd/api_cluster_evacuation.go index e2f3756a33e..58157377ec3 100644 --- a/cmd/incusd/api_cluster_evacuation.go +++ b/cmd/incusd/api_cluster_evacuation.go @@ -235,6 +235,8 @@ func evacuateInstancesFunc(ctx context.Context, inst instance.Instance, opts eva l.Warn("No migration target available for instance") return nil } + + return err } // Start migrating the instance. From f2838e8eacffe5621f75f918064a2ee5fcfcfd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Tue, 17 Dec 2024 23:13:05 -0500 Subject: [PATCH 2/2] incusd/cluster: Clarify error on DB failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/incusd/api_cluster_evacuation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/incusd/api_cluster_evacuation.go b/cmd/incusd/api_cluster_evacuation.go index 58157377ec3..7fda222faaf 100644 --- a/cmd/incusd/api_cluster_evacuation.go +++ b/cmd/incusd/api_cluster_evacuation.go @@ -530,7 +530,7 @@ func evacuateClusterSelectTarget(ctx context.Context, s *state.State, inst insta // Get the source member info. srcMember, err := tx.GetNodeByName(ctx, inst.Location()) if err != nil { - return fmt.Errorf("Failed getting current cluster member of instance %q", inst.Name()) + return fmt.Errorf("Failed loading location details %q for instance %q in project %q: %w", inst.Location(), inst.Name(), inst.Project().Name, err) } sourceMemberInfo = &srcMember