diff --git a/cmd/incusd/instances_post.go b/cmd/incusd/instances_post.go index 7e79ded32b7..66dac8f9b20 100644 --- a/cmd/incusd/instances_post.go +++ b/cmd/incusd/instances_post.go @@ -1248,15 +1248,13 @@ func instanceFindStoragePool(s *state.State, projectName string, req *api.Instan } func clusterCopyContainerInternal(s *state.State, r *http.Request, source instance.Instance, projectName string, profiles []api.Profile, req *api.InstancesPost) response.Response { - name := req.Source.Source - // Locate the source of the container var nodeAddress string err := s.DB.Cluster.Transaction(context.TODO(), func(ctx context.Context, tx *db.ClusterTx) error { var err error // Load source node. - nodeAddress, err = tx.GetNodeAddressOfInstance(ctx, projectName, name, source.Type()) + nodeAddress, err = tx.GetNodeAddressOfInstance(ctx, source.Project().Name, source.Name(), source.Type()) if err != nil { return fmt.Errorf("Failed to get address of instance's member: %w", err) }