Bug 1313667 - Refresh facts or Reboot on a shutdown host leads to 500
Refresh facts or Reboot on a shutdown host leads to 500
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Discovery Plugin (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity high (vote)
: GA
: --
Assigned To: Lukas Zapletal
Sachin Ghai
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-02 02:39 EST by Lukas Zapletal
Modified: 2017-04-03 21:40 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-27 07:27:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
error on rebooting a offline discovered host (66.86 KB, image/png)
2016-05-18 06:17 EDT, Sachin Ghai
no flags Details
error on refreshing_facts of a offline discovered host (60.48 KB, image/png)
2016-05-18 06:19 EDT, Sachin Ghai
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 12559 None None None 2016-04-22 12:25 EDT

  None (edit)
Description Lukas Zapletal 2016-03-02 02:39:46 EST
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 04:07:28 EST
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 07:57:33 EST
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 11:55:37 EDT
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 06:16:59 EDT
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 06:17 EDT
Created attachment 1158699 [details]
error on rebooting a offline discovered host
Comment 9 Sachin Ghai 2016-05-18 06:19 EDT
Created attachment 1158713 [details]
error on refreshing_facts of a offline discovered host
Comment 10 Bryan Kearney 2016-07-27 07:27:54 EDT
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 06:39:14 EDT
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 06:41:16 EDT
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 09:26:36 EDT
Please open a support ticket via http://projects.theforeman.org/projects/foreman/issues/new and provide logs from discovery-image node.

Note You need to log in before you can comment on or make changes to this bug.