Linking to a host does not work when the wrong location is selected

From an internal dashboard we link directly to hosts pages, for example But when the Location that was last picked on the foreman UI does not match the location of the specified host, foreman reports " Host not found Please try to update your request"

Expected outcome:
Foreman should show the hosts page of the specified host, regardless of the last picked location.

Foreman and Proxy versions:
Foreman version 2.2.1

Foreman and Proxy plugin versions:

Distribution and version:
Debian 10

this is expected & correct behavior, if a host machine is not under the scope of selected organization / location, users should not be able to see the host.

Maybe it is correct, but it’s not expected, at least not by me. Especially since it is not possible to do anything from the page shown. There is only a back button. There is no option to change the Location when at that page,since none of the menu bars are shown.

Even having a hosts page open in one tab, and selecting a different Location in another tab, makes it impossible to refresh the hosts page. Instead the same error is shown. I would not call this expected behavior.

Is there a parameter which we can add to the URL maybe? Something like ?location=any for example?

The nav bar should be shown in Foreman 2.4.0, there was a bug that users without view_locations/organizations permissions could not switch it (Bug #29914: User without view_organization permission cannot switch organization - Foreman). As a workaround until 2.4.0 is released (around March) you could grant the user the relevant view permissions.

You are right, it’s confusing for the case you described.
Sadly I don’t know simple solution for your case, so far I came up with two ways how fix the issue:

  • On error page show menus (left & top) so users can change the scope
  • Allow to define scope with URL parameters organization_id & location_id (right allowed only for API calls)