diff --git a/.changelog/18021.txt b/.changelog/18021.txt new file mode 100644 index 00000000000..e9a355432b3 --- /dev/null +++ b/.changelog/18021.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fixed a bug that could cause an error when accessing a region running versions of Nomad prior to 1.6.0 +``` diff --git a/ui/app/adapters/node-pool.js b/ui/app/adapters/node-pool.js index 93943b0f064..3fb92d27016 100644 --- a/ui/app/adapters/node-pool.js +++ b/ui/app/adapters/node-pool.js @@ -14,4 +14,21 @@ export default class NodePoolAdapter extends ApplicationAdapter { resource = pluralize(resource); return `/v1/${relationshipResource}/${resource}`; } + + findAll() { + return super.findAll(...arguments).catch((error) => { + // Handle the case where the node pool request is sent to a region that + // doesn't have node pools and the request is handled by the nodes + // endpoint. + const isNodeRequest = error.message.includes( + 'node lookup failed: index error: UUID must be 36 characters' + ); + if (isNodeRequest) { + return []; + } + + // Rethrow to be handled downstream. + throw error; + }); + } } diff --git a/ui/app/templates/clients/client/index.hbs b/ui/app/templates/clients/client/index.hbs index 8ef064f1c6c..8b726508dfa 100644 --- a/ui/app/templates/clients/client/index.hbs +++ b/ui/app/templates/clients/client/index.hbs @@ -247,7 +247,7 @@ Node Pool - {{this.model.nodePool}} + {{#if this.model.nodePool}}{{this.model.nodePool}}{{else}}-{{/if}} {{#if this.model.nodeClass}} diff --git a/ui/app/templates/components/client-node-row.hbs b/ui/app/templates/components/client-node-row.hbs index 000761d540b..716cf903da3 100644 --- a/ui/app/templates/components/client-node-row.hbs +++ b/ui/app/templates/components/client-node-row.hbs @@ -18,7 +18,9 @@