From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Gabriel Goller <g.goller@proxmox.com>
Subject: Re: [pve-devel] [RFC PATCH manager] migrate: fix conntrack migration and ha-resources checkbox
Date: Fri, 1 Aug 2025 08:38:16 +0200 [thread overview]
Message-ID: <141b96fb-fdb3-4f0a-941e-0cfb76393797@proxmox.com> (raw)
In-Reply-To: <20250731155846.277381-1-g.goller@proxmox.com>
Am 31.07.25 um 17:58 schrieb Gabriel Goller:
> The checkbox wasn't displayed and following errors were on the console:
>
> failed to query /capabilites/qemu/migration on '': [object Object] pvemanagerlib.js:20401:25
> Uncaught (in promise) TypeError: comigratedHAResources is not iterable
> checkQemuPreconditions https://172.16.0.18:8006/pve2/js/pvemanagerlib.js?ver=9.0.0~17:20595
>
> Error is an object, so we need to print it in the next line, otherwise
> only [object Object] is shown. Check if comigratedHAResources is
> iterable, otherwise don't iterate over it.
>
> Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
> ---
>
> Tested this quickly but no idea if it's correct. Maybe Daniel and
> Christoph could have a look at it.
>
> www/manager6/window/Migrate.js | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
> index b5ecb9603cf1..c884fbddd1aa 100644
> --- a/www/manager6/window/Migrate.js
> +++ b/www/manager6/window/Migrate.js
> @@ -254,7 +254,8 @@ Ext.define('PVE.window.Migrate', {
> } catch (err) {
> // Only emit a warning in the case the target node does not (yet) support the
> // `capabilites/qemu/migration` endpoint and simply treat all features as unsupported.
> - console.warn(`failed to query /capabilites/qemu/migration on '${target}': ${err}`);
FWIW, could be also done by moving it out from the template string to a separate param:
console.warn(`failed to query /capabilites/qemu/migration on '${target}':`, err);
> + console.warn(`failed to query /capabilites/qemu/migration on '${target}':`);
> + console.warn(err);
> }
>
> me.fetchingNodeMigrateInfo = false;
> @@ -447,7 +448,7 @@ Ext.define('PVE.window.Migrate', {
> }
>
> let comigratedHAResources = migrateStats['comigrated-ha-resources'];
> - if (comigratedHAResources !== undefined) {
> + if (comigratedHAResources !== undefined && typeof comigratedHAResources[Symbol.iterator] === 'function') {
If it exists this is always an array per the schema though,
so the following might be enough:
if (typeof comigratedHAResources === 'array') {
Or use the ExtJS frameworks' Ext.isIterable() while under the hood it's a bit more
heuristic than your check, it should cover all (for us) relevant cases
if (Ext.isIterable(comigratedHAResources)) {
Your variant might be fine as Proxmox.Utils method though, but rather overkill for
now.
> for (const sid of comigratedHAResources) {
> const text = Ext.String.format(
> gettext(
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-08-01 6:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 15:58 Gabriel Goller
2025-08-01 6:38 ` Thomas Lamprecht [this message]
2025-08-01 7:11 ` Daniel Kral
2025-08-01 7:35 ` Thomas Lamprecht
2025-08-01 8:02 ` Daniel Kral
2025-08-01 15:44 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=141b96fb-fdb3-4f0a-941e-0cfb76393797@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=g.goller@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.