Bug 1313667

Summary: Refresh facts or Reboot on a shutdown host leads to 500
Product: Red Hat Satellite Reporter: Lukas Zapletal <lzap>
Component: Discovery PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, cwelton, ranjith, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/12559
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:27:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
error on rebooting a offline discovered host
none
error on refreshing_facts of a offline discovered host none

Description Lukas Zapletal 2016-03-02 07:39:46 UTC
Warning!
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.

Comment 2 Bryan Kearney 2016-03-02 09:07:28 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/12559 has been closed
-------------
Anonymous
Applied in changeset commit:foreman_discovery|5ec1ccacb2b2cafff34a07d60964fa40b165e5d2.

Comment 4 Sachin Ghai 2016-03-10 12:57:33 UTC
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.

Comment 6 Lukas Zapletal 2016-04-21 15:55:37 UTC
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...)

For reboot.

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.

Comment 7 Sachin Ghai 2016-05-18 10:16:59 UTC
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.

Comment 8 Sachin Ghai 2016-05-18 10:17:35 UTC
Created attachment 1158699 [details]
error on rebooting a offline discovered host

Comment 9 Sachin Ghai 2016-05-18 10:19:01 UTC
Created attachment 1158713 [details]
error on refreshing_facts of a offline discovered host

Comment 10 Bryan Kearney 2016-07-27 11:27:54 UTC
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.

https://access.redhat.com/errata/RHBA-2016:1501

Comment 11 ranjith 2016-08-13 10:39:14 UTC
Hello,

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.


/var/log/foreman/production.log:

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

/var/log/foreman-proxy/proxy.log:

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

Thanks.

Comment 12 ranjith 2016-08-13 10:41:16 UTC
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)

Comment 13 Lukas Zapletal 2016-08-19 13:26:36 UTC
Please open a support ticket via http://projects.theforeman.org/projects/foreman/issues/new and provide logs from discovery-image node.