Red Hat Bugzilla – Bug 1313667
Refresh facts or Reboot on a shutdown host leads to 500
Last modified: 2017-04-03 21:40:33 EDT
Could not get facts from proxy https://10.35.27.150:8443: Connection timed out - connect(2) for "10.35.27.150" port 8443
We need to show proper error instead.
Moving to POST since upstream bug http://projects.theforeman.org/issues/12559 has been closed
Applied in changeset commit:foreman_discovery|5ec1ccacb2b2cafff34a07d60964fa40b165e5d2.
2) In case user try to reboot the host which is either shutdown or unreachable then webUI throws following error:
Error: ERF50-5094 [Foreman::WrappedException]: Failed to reboot host mac5254001d9fad with error ERF50-4973 [Foreman::WrappedException]: Unable to reboot mac5254001d9fad via https://ibm-x3550m3-07.lab.eng.brq.redhat.com:9090/discovery/192.168.100.11: 500 Internal Server Error ([RestClient::InternalServerError]: 500 Internal Server Error) ([Foreman::WrappedException]: ERF50-4973 [Foreman::WrappedException]: Unable to reboot mac5254001d9fad via https://ib...)
I think we shouldn't show "500 internal Server Error" as part of error notification.
And in case of 1), error should also be thrown on webUI.
This has been merged and it expected. Instead of 500 page we get an error. The word "nice" might mislead you, it's a bit unpolished, but still it is not a 500 page which was the issue we fixed. Getting:
ERF50-5094 [Foreman::WrappedException]: Failed to reboot host mac525400973bed with error ERF50-4973 [Foreman::WrappedException]: Unable to reboot mac525400973bed via https://192.168.122.110:8443: Legacy direct service only supports http scheme ([ArgumentError]: Legacy direct service only supports http scheme) ([Foreman::WrappedException]: ERF50-4973 [Foreman::WrappedException]: Unable to reboot mac525400973bed via https://19...)
Error: ERF50-7522 [Foreman::WrappedException]: Failed to refresh facts for mac525400973bed with error Could not get facts from proxy https://192.168.122.110:8443: No route to host - connect(2) for "192.168.122.110" port 8443 ([RuntimeError]: Could not get facts from proxy https://192.168.122.110:8443: No route to host - connect...)
For refresh facts.
I only experienced when clickingg on Refresh facts twice, the second error message is ignored. I consider this a minor thing that isn't worth investigating.
Verified with sat6.2 GA snap11.0
I can see proper error on refreshing facts of a offline/not-reachable host or rebooting the offline/not-reachable host.
Please see attached screenshots for verification.
Created attachment 1158699 [details]
error on rebooting a offline discovered host
Created attachment 1158713 [details]
error on refreshing_facts of a offline discovered host
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
We have tried to reboot the host from discovered host list in foreman and getting 500 Internal Server Error, based on this bug report discussion we have enabled the DEBUG mode in /etc/foreman-proxy/settings.yml file, kindly check the below log reports and assist us to rectify the error.
2016-08-13T15:50:55 [sql] [I] ForemanDiscovery: Rebooting mac3860778778b6
2016-08-13T15:50:55 [app] [W] Unable to reboot mac3860778778b6
| RestClient::InternalServerError: 500 Internal Server Error
D, [2016-08-13T16:05:36.280084 #30936] DEBUG -- : verifying remote client 192.168.1.134 against trusted_hosts ["ubuntu.foreman.in"]
E, [2016-08-13T16:05:36.283000 #30936] ERROR -- : failed to update Foreman: Connection reset by peer
192.168.1.134 - - [13/Aug/2016 16:05:36] "PUT /discovery/192.168.1.85/reboot HTTP/1.1" 500 50 0.0390
Exact error on the webUI is:
Failed to reboot host mac3860778778b6 with error ERF50-6734 [Foreman::WrappedException]: Unable to reboot mac3860778778b6: 500 Internal Server Error ([RestClient::InternalServerError]: 500 Internal Server Error)
Please open a support ticket via http://projects.theforeman.org/projects/foreman/issues/new and provide logs from discovery-image node.