Project

General

Profile

Actions

Bug #35061

open

Host form redirect does not work for unmanaged host

Added by Luis Pigueiras about 2 years ago. Updated 10 months ago.

Status:
Ready For Testing
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Using Foreman 3.3.0 here.

I am still seeing the problem that it's described in fixed bug: https://projects.theforeman.org/issues/34371, when editing a host and changing environment and pressing Enter when select it removes the domain from the name of the host. Then, when I click submit, the redirection doesn't work and it shows a 404 saying that it can't find the host (but Foreman has performed the environment change).

Does it have to do with my setup maybe? If for instance I changed the node to be managed instead of unmanaged I can see the same behaviour but the redirection works properly. If it's of any help, this is one of the hosts I have the problem:

```
Id: 1997
Name: node34.example.org
Organization: Default Organization
Location: Default Location
Host Group: controller/prod
Cert name: node34.example.org
Managed: no
Installed at:
Last report: 2022/06/14 11:48:06
Uptime (seconds): 508319
Status:
Global Status: OK
Build Status: Installed
Network:
IPv4 address: 10.80.46.53
MAC: fd:17:3f:00:45:a9
Domain: example.org
Network interfaces:
1) Id: 21513
Identifier: cali4dadcc13444
Type: interface
MAC address: ee:ee:ee:ee:ee:ee
FQDN:
2) Id: 21501
Identifier: eth0
Type: interface (primary, provision)
MAC address: fa:16:3e:00:45:a9
IPv4 address: 10.80.46.53
FQDN: node34.example.org
3) Id: 21504
Identifier: vxlan.calico
Type: interface
MAC address: 41:32:8f:a1:ea:ee
IPv4 address: 192.12.106.34
FQDN:
Operating system:
Architecture: x86_64
Operating System: RHEL 8.6
Build: no
Custom partition table:
Parameters:

All parameters:
host_registration_remote_execution => true
host_registration_insights => false
host_packages =>
Additional info:
Owner: xxxx
Owner Id: 5
Owner Type: Usergroup
Enabled: yes
Model: OpenStack Compute
Comment:
-
```

And the logs that I can see:

```
2022-06-14T14:02:47 [I|app|d3b4c82d] Started PATCH "/hosts/1997" for X.Y.Z.A at 2022-06-14 14:02:47 +0200
2022-06-14T14:02:47 [I|app|d3b4c82d] Processing by HostsController#update as /*
2022-06-14T14:02:47 [I|app|d3b4c82d] Parameters: {"utf8"=>"‚úì", "authenticity_token"=>"...", "host"=>{"name"=>"node34", "hostgroup_id"=>"1", "puppet_attributes"=>{"environment_id"=>"1616"}, "managed"=>"false", "progress_report_id"=>"[FILTERED]", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "mac"=>"fa:16:3e:7c:42:97", "identifier"=>"eth0", "name"=>"node34", "domain_id"=>"1", "ip"=>"10.80.64.130", "ip6"=>"", "managed"=>"1", "primary"=>"1", "provision"=>"1", "tag"=>"", "attached_to"=>"", "id"=>"21474"}}, "is_owned_by"=>"5-Users", "enabled"=>"1", "model_id"=>"1", "comment"=>"", "overwrite"=>"false"}, "id"=>"1997"}
2022-06-14T14:02:47 [I|aud|d3b4c82d] Host::Base (1997) update event on name node34, node34.bbp.epfl.ch
2022-06-14T14:02:47 [I|app|d3b4c82d] Redirected to https://foreman.bbp.epfl.ch/new/hosts/node34.bbp.epfl.ch
2022-06-14T14:02:47 [I|app|d3b4c82d] Completed 302 Found in 122ms (ActiveRecord: 26.2ms | Allocations: 22706)
2022-06-14T14:02:47 [I|app|ca4b0f00] Started GET "/new/hosts/node34.bbp.epfl.ch" for X.Y.Z.A at 2022-06-14 14:02:47 +0200
2022-06-14T14:02:47 [I|app|ca4b0f00] Processing by ReactController#index as */

2022-06-14T14:02:47 [I|app|ca4b0f00] Parameters: {"id"=>"node34.bbp.epfl.ch"}
2022-06-14T14:02:47 [I|app|ca4b0f00] Rendering react/index.html.erb within layouts/react_application
2022-06-14T14:02:47 [I|app|ca4b0f00] Rendered react/index.html.erb within layouts/react_application (Duration: 0.1ms | Allocations: 4)
2022-06-14T14:02:47 [I|app|ca4b0f00] Rendering layouts/base.html.erb
2022-06-14T14:02:47 [I|app|ca4b0f00] Rendered layouts/base.html.erb (Duration: 36.2ms | Allocations: 14909)
2022-06-14T14:02:47 [I|app|ca4b0f00] Completed 200 OK in 56ms (Views: 35.6ms | ActiveRecord: 5.9ms | Allocations: 17845)
2022-06-14T14:02:47 [I|app|98d16142] Started GET "/api/hosts/node34" for X.Y.Z.A at 2022-06-14 14:02:47 +0200
2022-06-14T14:02:47 [I|app|5689ad51] Started GET "/api/hosts/node34/power" for X.Y.Z.A at 2022-06-14 14:02:47 +0200
2022-06-14T14:02:47 [I|app|98d16142] Processing by Api::V2::HostsController#show as JSON
2022-06-14T14:02:47 [I|app|98d16142] Parameters: {"apiv"=>"v2", "id"=>"node34"}
2022-06-14T14:02:47 [I|app|5689ad51] Processing by Api::V2::HostsController#power_status as JSON
2022-06-14T14:02:47 [I|app|5689ad51] Parameters: {"apiv"=>"v2", "id"=>"node34"}
2022-06-14T14:02:47 [I|app|98d16142] Couldn't find Host::Managed with 'id'=node34 [WHERE "hosts"."type" = $1] (ActiveRecord::RecordNotFound)
2022-06-14T14:02:47 [I|app|5689ad51] Couldn't find Host::Managed with 'id'=node34 [WHERE "hosts"."type" = $1] (ActiveRecord::RecordNotFound)
2022-06-14T14:02:47 [I|app|6fe39e9d] Started GET "/api/audits?search=host%3Dnode34&per_page=3" for X.Y.Z.A at 2022-06-14 14:02:47 +0200
2022-06-14T14:02:47 [I|app|10fc9119] Started GET "/hosts/node34/statuses" for X.Y.Z.A at 2022-06-14 14:02:47 +0200
2022-06-14T14:02:47 [I|app|98d16142] Rendering api/v2/errors/not_found.json.rabl within api/v2/layouts/error_layout
2022-06-14T14:02:47 [I|app|5689ad51] Rendering api/v2/errors/not_found.json.rabl within api/v2/layouts/error_layout
2022-06-14T14:02:47 [I|app|5689ad51] Rendered api/v2/errors/not_found.json.rabl within api/v2/layouts/error_layout (Duration: 0.8ms | Allocations: 79)
2022-06-14T14:02:47 [I|app|5689ad51] Completed 404 Not Found in 69ms (Views: 9.3ms | ActiveRecord: 29.0ms | Allocations: 8152)
2022-06-14T14:02:47 [I|app|98d16142] Rendered api/v2/errors/not_found.json.rabl within api/v2/layouts/error_layout (Duration: 10.2ms | Allocations: 1314)
2022-06-14T14:02:47 [I|app|98d16142] Completed 404 Not Found in 90ms (Views: 24.7ms | ActiveRecord: 32.4ms | Allocations: 11264)
2022-06-14T14:02:47 [I|app|6fe39e9d] Processing by Api::V2::AuditsController#index as JSON
2022-06-14T14:02:47 [I|app|6fe39e9d] Parameters: {"search"=>"host=node34", "per_page"=>"3", "apiv"=>"v2"}
2022-06-14T14:02:47 [I|app|10fc9119] Processing by HostsController#statuses as JSON
2022-06-14T14:02:47 [I|app|10fc9119] Parameters: {"id"=>"node34"}
2022-06-14T14:02:47 [I|app|6fe39e9d] Rendering api/v2/audits/index.json.rabl within api/v2/layouts/index_layout
2022-06-14T14:02:47 [I|app|6fe39e9d] Rendered api/v2/audits/index.json.rabl within api/v2/layouts/index_layout (Duration: 10.7ms | Allocations: 1860)
2022-06-14T14:02:47 [I|app|10fc9119] Rendering common/404.html.erb within layouts/application
2022-06-14T14:02:47 [I|app|10fc9119] Rendered common/404.html.erb within layouts/application (Duration: 1.3ms | Allocations: 206)
2022-06-14T14:02:47 [I|app|10fc9119] Rendered layouts/_application_content.html.erb (Duration: 0.2ms | Allocations: 31)
2022-06-14T14:02:47 [I|app|10fc9119] Rendering layouts/base.html.erb
2022-06-14T14:02:47 [I|app|10fc9119] Rendered layouts/base.html.erb (Duration: 3.9ms | Allocations: 1338)
2022-06-14T14:02:47 [I|app|10fc9119] Completed 404 Not Found in 60ms (Views: 7.9ms | ActiveRecord: 22.4ms | Allocations: 8947)
2022-06-14T14:02:47 [I|app|6fe39e9d] Completed 200 OK in 81ms (Views: 15.8ms | ActiveRecord: 43.9ms | Allocations: 12249)
2022-06-14T14:02:49 [I|app|df3d0876] Started GET "/hosts/node34/edit" for X.Y.Z.A at 2022-06-14 14:02:49 +0200
2022-06-14T14:02:49 [I|app|df3d0876] Processing by HostsController#edit as HTML
2022-06-14T14:02:49 [I|app|df3d0876] Parameters: {"id"=>"node34"}
2022-06-14T14:02:49 [I|app|df3d0876] Rendering common/404.html.erb within layouts/application
2022-06-14T14:02:49 [I|app|df3d0876] Rendered common/404.html.erb within layouts/application (Duration: 1.0ms | Allocations: 206)
2022-06-14T14:02:49 [I|app|df3d0876] Rendered layouts/_application_content.html.erb (Duration: 0.2ms | Allocations: 31)
2022-06-14T14:02:49 [I|app|df3d0876] Rendering layouts/base.html.erb
2022-06-14T14:02:49 [I|app|df3d0876] Rendered layouts/base.html.erb (Duration: 3.0ms | Allocations: 1338)
2022-06-14T14:02:49 [I|app|df3d0876] Completed 404 Not Found in 29ms (Views: 6.5ms | ActiveRecord: 4.6ms | Allocations: 5013)
2022-06-14T14:02:51 [I|app|2776f491] Started GET "/" for X.Y.Z.A at 2022-06-14 14:02:51 +0200::%
```

Actions #1

Updated by The Foreman Bot over 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/9591 added
Actions #2

Updated by The Foreman Bot over 1 year ago

  • Pull request https://github.com/theforeman/foreman/pull/9602 added
Actions #3

Updated by Luis Pigueiras over 1 year ago

  • Pull request deleted (https://github.com/theforeman/foreman/pull/9602)
Actions #4

Updated by The Foreman Bot 10 months ago

  • Pull request deleted (https://github.com/theforeman/foreman/pull/9591)
Actions #5

Updated by Luis Pigueiras 10 months ago

We don't see it anymore in 3.6.2, so it can be closed

Actions

Also available in: Atom PDF