Bug 1193485 - AJAX call returns 500 when discovery provisioning is finished
Summary: AJAX call returns 500 when discovery provisioning is finished
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
low
high
Target Milestone: Unspecified
Assignee: orabin
QA Contact: Sachin Ghai
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: 1193977
TreeView+ depends on / blocked
 
Reported: 2015-02-17 12:59 UTC by Sachin Ghai
Modified: 2017-02-23 20:30 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 13:56:31 UTC
Target Upstream Version:


Attachments (Terms of Use)
UI raises 500 Internal Server Error on provisioning a discovered host (75.95 KB, image/png)
2015-02-17 12:59 UTC, Sachin Ghai
no flags Details
undefined method `managed?' for nil:NilClass on accessing the https://<host_name>/discovered_hosts/mac525400df80c8/edit (43.52 KB, image/png)
2015-02-17 13:02 UTC, Sachin Ghai
no flags Details
no error in firebug when discovered host submitted for provisioning (70.96 KB, image/png)
2015-06-05 12:17 UTC, Sachin Ghai
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 9424 0 None None None 2016-04-22 15:43:38 UTC

Description Sachin Ghai 2015-02-17 12:59:39 UTC
Created attachment 992654 [details]
UI raises 500 Internal Server Error on provisioning a discovered host

Description of problem:
I was trying to provision a discovered host manually. And I click on 'provision' from discovered_host page. I filled all details and submit it.

On submitting the form UI raises following error in firebug:

"NetworkError: 500 Internal Server Error - https://dhcp201-167.englab.pnq.redhat.com/discovered_hosts/mac525400df80c8/edit"

production.log contains:

Processing by HostsController#resources as HTML
  Parameters: {"range"=>"7", "id"=>"mac525400df80c8.englab.pnq.redhat.com"}
  Rendered hosts/_resources.html.erb (4.8ms)
Completed 200 OK in 27ms (Views: 8.0ms | ActiveRecord: 2.7ms)
Processing by DiscoveredHostsController#edit as */*
  Parameters: {"id"=>"mac525400df80c8"}
  Rendered hosts/edit.html.erb within layouts/application (1.6ms)
Operation FAILED: undefined method `managed?' for nil:NilClass
  Rendered common/500.html.erb (8.3ms)
Completed 500 Internal Server Error in 51ms (Views: 21.5ms | ActiveRecord: 0.0ms)


Please note provisioning succeed.

Version-Release number of selected component (if applicable):
Satellite-6.1.0-RHEL-6-20150210.0
Sat6.1.0 beta snap2

How reproducible:
always

Steps to Reproduce:
1. pxe boot a host
2. once node is registered with sat6
3. go to Hosts --> Discovered host -> provision

Actual results:
provisioning succeed, but UI raises following error in firebug:

"NetworkError: 500 Internal Server Error - https://dhcp201-167.englab.pnq.redhat.com/discovered_hosts/mac525400df80c8/edit"

production.log contains:

Processing by HostsController#resources as HTML
  Parameters: {"range"=>"7", "id"=>"mac525400df80c8.englab.pnq.redhat.com"}
  Rendered hosts/_resources.html.erb (4.8ms)
Completed 200 OK in 27ms (Views: 8.0ms | ActiveRecord: 2.7ms)
Processing by DiscoveredHostsController#edit as */*
  Parameters: {"id"=>"mac525400df80c8"}
  Rendered hosts/edit.html.erb within layouts/application (1.6ms)
Operation FAILED: undefined method `managed?' for nil:NilClass
  Rendered common/500.html.erb (8.3ms)
Completed 500 Internal Server Error in 51ms (Views: 21.5ms | ActiveRecord: 0.0ms)


Expected results:
No error should be raised.

Additional info:
I manually installed foreman discovery plugin on sat6.1 beta snap2 as it was not installed by default and restarted katello-service.

Comment 1 Sachin Ghai 2015-02-17 13:02:24 UTC
Created attachment 992656 [details]
undefined method `managed?' for nil:NilClass on accessing the https://<host_name>/discovered_hosts/mac525400df80c8/edit

Comment 3 Lukas Zapletal 2015-02-18 08:31:47 UTC
Setting low priority as it has zero effects on functionality. I've already seen that before with upstream. We need to fix this later on.

Comment 5 Lukas Zapletal 2015-02-18 12:16:47 UTC
Note for myself: Not yet sure if the upstream issue is correct. Need to investigate.

Comment 6 Bryan Kearney 2015-02-18 13:06:02 UTC
Upstream bug assigned to gsutclif

Comment 7 Lukas Zapletal 2015-02-18 16:38:09 UTC
Sachin, out of my curiousity, when you simply create new Host on a Satellite 6.0 instance, won't you get the very same error? Maybe this is not Discovery related at all.

Comment 8 Bryan Kearney 2015-02-26 13:05:17 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/9147 has been closed
-------------
Greg Sutcliffe
Applied in changeset commit:5440d482b0087fe29b3fb4567e0ca73f2d3af221.

Comment 10 Bryan Kearney 2015-03-13 18:04:58 UTC
Upstream bug assigned to gsutclif

Comment 11 Lukas Zapletal 2015-03-16 10:42:54 UTC
Assigned to Marek who actually rewrote Gregs patch upstream.

Comment 12 Bryan Kearney 2015-03-16 12:05:05 UTC
Upstream bug assigned to gsutclif

Comment 13 Marek Hulan 2015-03-16 14:31:00 UTC
I think you should reassign upstream bug, otherwise it's always reassigned. But I don't think it's related to that upstream bug as it was reported after new nic change. This seems to me like something in discovery.

Comment 14 Lukas Zapletal 2015-03-16 15:02:48 UTC
Will merge that manually.

Comment 15 Bryan Kearney 2015-03-16 16:05:37 UTC
Upstream bug assigned to gsutclif

Comment 17 Lukas Zapletal 2015-03-18 09:38:13 UTC
Ok after discussion with Marek I am putting the link back to the original upstream bug and giving it to Ori.

Ori can you please re-test this bug with 2.0.1 rebased version of discovery? We might be fixing this, I think I saw it during our bunch of bugfixes.

Comment 18 Sachin Ghai 2015-03-19 05:06:54 UTC
I think anything related to 500 ISE should be on higher priority. This error looks ugly in all aspects. We really need to get this fixed by beta only. Setting the blocker flag to get into beta.

Comment 19 Lukas Zapletal 2015-03-19 09:47:52 UTC
When you see 500 in the UI that's totally blocker, but in this case we only see 500 only in the production.log. Satellite 6 operates well. For this reason I gave it lower prio.

Comment 20 Lukas Zapletal 2015-03-23 08:52:11 UTC
We do not see this anymore with https://gitlab.sat.lab.tlv.redhat.com/satellite6/foreman_discovery/merge_requests/2 merged, please retest.

Comment 22 Sachin Ghai 2015-05-08 13:28:19 UTC
Reproducible with sat6 GA snap3 compose2 


2015-05-08 18:49:01 [I] Processing by DiscoveredHostsController#edit as */*
2015-05-08 18:49:01 [I]   Parameters: {"id"=>"mac525400d5d951"}
2015-05-08 18:49:01 [I]   Rendered hosts/edit.html.erb within layouts/application (2.2ms)
2015-05-08 18:49:01 [W] Operation FAILED: undefined method `managed?' for nil:NilClass
2015-05-08 18:49:01 [I]   Rendered common/500.html.erb (13.0ms)
2015-05-08 18:49:01 [I] Completed 500 Internal Server Error in 73ms (Views: 17.6ms | ActiveRecord: 0.1ms)
20

Comment 23 orabin 2015-05-26 14:23:40 UTC
upstream issue is closed

Comment 27 Sachin Ghai 2015-06-05 12:15:11 UTC
Verified with sat6.1 GA snap7. The reported issue has been fixed. please see screenshot for verification.

Comment 28 Sachin Ghai 2015-06-05 12:17:41 UTC
Created attachment 1035203 [details]
no error in firebug when discovered host submitted for provisioning

Comment 29 Bryan Kearney 2015-08-11 13:30:17 UTC
This bug is slated to be released with Satellite 6.1.

Comment 30 Bryan Kearney 2015-08-12 13:56:31 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.


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