Interface is not added properly

I noticed weird behaviour of interfaces of our Windows hosts. Starting from the beginning, I can see IP address and MAC address in the main panel for host:

When I switch to NICs tab, I see properly (most likely) added interfaces:

If I go to “Edit” on this host and “Interfaces” I see nothing:

Now, the most funny part. I can go to “+ Add Interface” and with all empty fields, I can click “OK” and magically interfaces are added with additional empty one:

I can submit this, but this interfaces won’t be there when I will go there next time. This is very confusing, and I have no idea why there is behaviour like that. We have this issue only with Windows hosts. Linux hosts are good.

I believe this issue is causing that we can’t update IP addresses in foreman as we used to do it, by gathering Ansible facts.

Expected outcome:
Interfaces should be saved and available all the time.

Foreman and Proxy versions:
Foreman - 3.1.3
Proxy - 3.1.2

Foreman and Proxy plugin versions:
foreman-tasks - 5.2.3
foreman_ansible - 7.0.4
foreman_default_hostgroup - 6.0.0
foreman_discovery - 19.0.1
foreman_hooks - 0.3.17
foreman_kubevirt - 0.1.9
foreman_openscap - 5.1.1
foreman_puppet - 2.0.6
foreman_remote_execution - 5.0.6
foreman_setup - 7.0.0
foreman_snapshot_management - 2.0.1
foreman_templates - 9.1.0
katello - 4.3.1

Distribution and version:
CentOS Linux release 7.9.2009 (Core)

1 Like

I don’t have a windows instance, but I tried to reproduce with another OS and couldn’t… looking at the code it doesn’t seem related to an OS, do you see any errors
in the logs or in the browser console? thanks

1 Like

I see some errors in Foreman logs when I’m going to host editing. I’m not sure if this is related. Also, I noticed that we have exactly the same behaviour for all hosts, not only Windows.

I see the following errors in the logs:

 388441e4 | ActionController::RoutingError (No route matches [GET] "/assets/host_edit-e461a891b011baa34308f3473ec89a99b69915ecf02c9782ac3e82932a3f7c9c.js"):
 388441e4 |   
 388441e4 | lib/foreman/silenced_logger.rb:37:in `silence'
 388441e4 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
 388441e4 | katello (4.3.1) lib/katello/prevent_json_parsing.rb:12:in `call'
 21bc9dc8 | ActionController::RoutingError (No route matches [GET] "/webpack/foreman_ansible/"):
 21bc9dc8 |   
 21bc9dc8 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
 21bc9dc8 | katello (4.3.1) lib/katello/prevent_json_parsing.rb:12:in `call'
 152619fc | ActionController::RoutingError (No route matches [GET] "/webpack/foreman_openscap/"):
 152619fc |   
 152619fc | lib/foreman/middleware/logging_context_request.rb:11:in `call'
 152619fc | katello (4.3.1) lib/katello/prevent_json_parsing.rb:12:in `call'
2022-06-23T08:10:39 [F|app|5a6883aa]   
 5a6883aa | ActionController::RoutingError (No route matches [GET] "/webpack/foreman_puppet/"):
 5a6883aa |   
 5a6883aa | lib/foreman/middleware/logging_context_request.rb:11:in `call'
 5a6883aa | katello (4.3.1) lib/katello/prevent_json_parsing.rb:12:in `call'
2022-06-23T08:10:39 [I|app|b1f4e153] Started GET "/webpack/foreman_remote_execution/" for at 2022-06-23 08:10:39 -0500
2022-06-23T08:10:39 [F|app|4c95b82e]   
 4c95b82e | ActionController::RoutingError (No route matches [GET] "/webpack/katello/"):
 4c95b82e |   
 4c95b82e | lib/foreman/middleware/logging_context_request.rb:11:in `call'
 4c95b82e | katello (4.3.1) lib/katello/prevent_json_parsing.rb:12:in `call'
2022-06-23T08:10:39 [F|app|3757cda9]   
 3757cda9 | ActionController::RoutingError (No route matches [GET] "/webpack/foreman_snapshot_management/"):
 3757cda9 |   
 3757cda9 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
 3757cda9 | katello (4.3.1) lib/katello/prevent_json_parsing.rb:12:in `call'
2022-06-23T08:10:39 [F|app|b1f4e153]   
 b1f4e153 | ActionController::RoutingError (No route matches [GET] "/webpack/foreman_remote_execution/"):
 b1f4e153 |   
 b1f4e153 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
 b1f4e153 | katello (4.3.1) lib/katello/prevent_json_parsing.rb:12:in `call'
2022-06-23T08:10:39 [F|app|e65d9ef5]   
 e65d9ef5 | ActionController::RoutingError (No route matches [GET] "/webpack/foreman_ansible/"):
 e65d9ef5 |   
 e65d9ef5 | lib/foreman/middleware/logging_context_request.rb:11:in `call'
 e65d9ef5 | katello (4.3.1) lib/katello/prevent_json_parsing.rb:12:in `call'

Oh… then I guess that’s the reason, no javascript seems to be loaded to the page,
and we are counting on /assets/host_edit.js to fill the data on the table,

are you in production or development mode? What is your setup look like?
I am not really sure why it tries to catch those JS links as they were rails controllers…