#28591·nomad

UI: region switcher fails from any route with a region-scoped ID in the URL

Author: tpkapadiaCreated Sep 22, 2026Updated Sep 22, 2026

Nomad version

Nomad v2.0.6 (behaviour also present on main at time of writing)

Operating system and Environment details

Federated multi-region cluster, 7 regions, one server per region, TLS enabled, ACLs disabled. Each agent runs in -dev mode. Noting that for completeness, though it is not material here: the fault is entirely client-side in the UI's router — gotoRegion reuses the current route's dynamic segments regardless of what the servers are doing — and the underlying API behaviour it trips over (an allocation ID resolving only within its own region) is normal, correct Nomad behaviour, reproduced below against the HTTP API directly.

Issue

The region switcher preserves the current route, including its dynamic segments. Because allocation IDs, node IDs and job names are region-scoped, switching region from any route that has one of those in the path re-requests an ID that cannot exist in the destination region, and the switch fails.

ui/app/components/region-switcher.js:

javascript
@action
async gotoRegion(region) {
  // Fetch token for the new region before transitioning
  await this.get('token.fetchSelfTokenAndPolicies').perform(region).catch();

  this.router.transitionTo({ queryParams: { region } });
}

transitionTo({ queryParams }) with no route name keeps the current route and its dynamic segments, changing only ?region=. The model hook then re-fetches the same ID against the new region and 404s.

This is confirmed at the API layer — an allocation ID is only resolvable in its own region:

$ curl -s "$NOMAD_ADDR/v1/allocation/$ALLOC?region=region-a"
# 200, the allocation

$ curl -s -w '\nHTTP %{http_code}\n' "$NOMAD_ADDR/v1/allocation/$ALLOC?region=region-b"
alloc not found
HTTP 404

The resulting UX differs by route, but no route actually performs the region switch the user asked for:

  • Allocation routes — ui/app/routes/allocations/allocation.js catches errors[0].detail === 'alloc not found', raises a sticky critical notification reading Allocation of id: <uuid> was not found., then goBackToReferrer(transition.from.name). The user gets a red error naming a UUID they did not ask about, and no region change.
  • Job routes — notFoundJobHandler catches the 404 and toasts Job "<name>" has been deleted / "this is usually because it was purged from elsewhere", then redirects to the jobs list. The job has not been deleted; it exists in the region the user just left. This message is actively misleading.
  • Other ID-bearing routes (clients, servers, volumes) are affected by the same root cause.

Switching from a route with no dynamic segment (/ui/jobs, /ui/clients, /ui/servers) works correctly, as does deep-linking with an explicit ?region=.

The practical impact is that whether the region switcher works depends on where the user happens to be standing, which is not discoverable. Landing on a job detail page and using the switcher — a natural thing to do — fails every time with a "has been deleted" message about a job that is fine.

Reproduction steps

  1. Federate two regions, region-a and region-b, each running at least one job.
  2. In the UI, navigate to an allocation in region-a: /ui/allocations/<alloc_id>.
  3. Use the region switcher to select region-b.

Expected Result

The UI switches to region-b, falling back to the nearest sensible ancestor route that is not region-scoped (e.g. /ui/allocations or /ui/jobs) when the current route's ID cannot exist in the destination region.

Actual Result

A sticky critical notification: Allocation of id: <uuid> was not found. The UI returns to the referring route and the active region is unchanged.

Repeating step 2-3 from a job detail route instead produces Job "<name>" has been deleted — for a job that has not been deleted.

Suggested fix

Have gotoRegion transition to a region-safe route rather than reusing the current one, e.g. resolve the current route to its closest ancestor with no dynamic segments before transitioning. Failing that, the job route's 404 copy should not assert deletion when a region switch is in flight.