Bug #12429
closedforeman-proxy service not started on some hosts
Description
Foreman-proxy in discovery image service not started on some hosts with many network interface (9 in our case). This causes, that machine is not automatically restarted after discovery and auto-provisioning is not continuing. We need to reboot it manually.
Discovery image version 3.0.4, Discovery plugin version 4.1.1.
Foreman logs error:
2015-11-10T10:41:03 [app] [I] Create DHCP reservation for mac44a842403d3c.cloud.testlab-44:a8:42:40:3d:3c/172.27.19.153 2015-11-10T10:41:03 [app] [I] Add DNS A record for mac44a842403d3c.cloud.testlab/172.27.19.153 2015-11-10T10:41:03 [sql] [I] Add the TFTP configuration for mac44a842403d3c.cloud.testlab 2015-11-10T10:41:03 [sql] [I] Fetching required TFTP boot files for mac44a842403d3c.cloud.testlab 2015-11-10T10:41:04 [app] [W] Unable to reboot mac44a842403d3c | Errno::ECONNREFUSED: Connection refused - connect(2) for "172.27.19.153" port 8443 | /usr/lib/ruby/2.1.0/net/http.rb:879:in `initialize' | /usr/lib/ruby/2.1.0/net/http.rb:879:in `open'
Foreman-proxy service on fdi-image not running:
[root@fdi ~]# systemctl status foreman-proxy.service foreman-proxy.service - Foreman Proxy Loaded: loaded (/usr/lib/systemd/system/foreman-proxy.service; enabled) Active: failed (Result: exit-code) since Tue 2015-11-10 09:59:04 UTC; 1min 41s ago Process: 1038 ExecStartPre=/usr/bin/generate-proxy-cert (code=exited, status=1/FAILURE) Nov 10 09:59:04 fdi systemd[1]: foreman-proxy.service: control process exited, code=exited status=1 Nov 10 09:59:04 fdi systemd[1]: Failed to start Foreman Proxy. Nov 10 09:59:04 fdi systemd[1]: Unit foreman-proxy.service entered failed state.
Issue is in script for key generation - /usr/bin/generate-proxy-cert.
Line
IP=$(nmcli -t -f IP4.ADDRESS con show primary 2>/dev/null | cut -f2 -d: | cut -f1 -d/)
does not return IP address and exists with return code 1.
Updated by The Foreman Bot about 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman-discovery-image/pull/48 added
Updated by Kamil Madac about 9 years ago
Solution (workaround?) is to start foreman-proxy after NetworkManager-wait-online.service is ready.
More in https://github.com/theforeman/foreman-discovery-image/pull/48
Updated by The Foreman Bot about 9 years ago
- Assignee set to Lukas Zapletal
- Pull request https://github.com/theforeman/foreman-discovery-image/pull/50 added
Updated by Lukas Zapletal about 9 years ago
- Pull request deleted (
https://github.com/theforeman/foreman-discovery-image/pull/48)
Updated by Kamil Madac about 9 years ago
Hi Lukas,
I just replaced NetworkManager-wait-online.service with network-online.target in /usr/lib/systemd/system/foreman-proxy.service as you suggested in PR conversation, but it doesn't work :( I have again the same issue - Node is discovered, foreman sends commnand to reboot it, but foreman-proxy is not running so it is stucked in 'Discovery Status' screen. Our servers are Dell R730 with 2 x 4 port NICs + 1 IPMI port all connected to Cisco 3750 switches.
Updated by Kamil Madac about 9 years ago
My fault. I forgot to replace both lines (Wants= and After=) in foreman-proxy.service (https://github.com/lzap/foreman-discovery-image/commit/c72e80902b4cd34c4b8369f3ec118b8ef7ac9bf6). Once I did it, provisioning works as expected.
Updated by Lukas Zapletal about 9 years ago
Great, can you please confirm in the PR itself that the build I made works as expected? Or at least show us the patch you made on your own build. Thanks. It's the https://github.com/theforeman/foreman-discovery-image/pull/50
Updated by Anonymous almost 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman-discovery-image|0c18ba2a6d04e5105db1e2085fe69f091b6922c7.