Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1113014 - 500 ISE on creating a new host: Operation FAILED: can't convert nil into String
Summary: 500 ISE on creating a new host: Operation FAILED: can't convert nil into String
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Dmitri Dolguikh
QA Contact: Sachin Ghai
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: 1113292
TreeView+ depends on / blocked
 
Reported: 2014-06-25 09:31 UTC by Sachin Ghai
Modified: 2019-09-26 17:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1113292 (view as bug list)
Environment:
Last Closed: 2014-07-02 14:04:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
host creation failed and Firebug raises 500 ISE (61.37 KB, image/png)
2014-06-25 09:31 UTC, Sachin Ghai
no flags Details
Logs from production.log (4.58 KB, text/x-log)
2014-06-25 09:32 UTC, Sachin Ghai
no flags Details
foreman-debug logs (240.22 KB, application/x-xz)
2014-06-25 09:34 UTC, Sachin Ghai
no flags Details
requested stack trace from production.log after enabling debug logs (24.28 KB, text/x-log)
2014-06-25 10:12 UTC, Sachin Ghai
no flags Details
Logs from production.log with host create (80.02 KB, text/x-log)
2014-06-25 10:55 UTC, Sachin Ghai
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 6398 0 None None None 2016-04-22 16:26:24 UTC

Description Sachin Ghai 2014-06-25 09:31:13 UTC
Created attachment 911999 [details]
host creation failed and Firebug raises 500 ISE

Description of problem:
I was trying to create a new host via UI and filled the form with all necessary info. But when I submit the form the firebug raised following error:

"NetworkError: 500 Internal Server Error - https://dhcp207-190.lab.eng.pnq.redhat.com/hosts/shost.katellolabs.org/vm"
vm
ReferenceError: _ is not defined

snippet from production.log 
============================
Processing by HostsController#vm as HTML
  Parameters: {"id"=>"shost.katellolabs.org"}
Operation FAILED: can't convert nil into String
  Rendered common/500.html.erb (10.2ms)
Completed 500 Internal Server Error in 46ms (Views: 15.4ms | ActiveRecord: 3.8ms)


Version-Release number of selected component (if applicable):
sat6 beta snap10 compose3

How reproducible:
tried once

Steps to Reproduce:
1. created new hostgroup and selected activation-key
2. filled up "New Host" form first with hostgroup and then unselect it
3. Filled all other details and submit the form

Actual results:
Processing by HostsController#vm as HTML
  Parameters: {"id"=>"shost.katellolabs.org"}
Operation FAILED: can't convert nil into String
  Rendered common/500.html.erb (10.2ms)
Completed 500 Internal Server Error in 46ms (Views: 15.4ms | ActiveRecord: 3.8ms)

Expected results:
host should be created successfully

Additional info:

Comment 1 Sachin Ghai 2014-06-25 09:32:39 UTC
Created attachment 912000 [details]
Logs from production.log

Comment 2 Sachin Ghai 2014-06-25 09:34:53 UTC
Created attachment 912001 [details]
foreman-debug logs

Comment 3 Dominic Cleal 2014-06-25 09:38:21 UTC
Please edit ~foreman/config/environments/production.rb and uncomment "config.log_level = :debug", run "service foreman restart" and retry to get a stack trace in the logs.

1. What type of compute resource are you provisioning onto?
2. If you visit the host page again, does it load correctly with power state?  i.e. is the bug only after initial provisioning

Comment 4 Sachin Ghai 2014-06-25 09:43:53 UTC
Looks like this issue is related to bz #1113012. As I stated in steps to reproduce, first I selected the hostgroup and then unselected. So looks like it was not unselected actually with empty row. 

I tried again with new host creation and without touching hostgroup dropdown. This time provisioning kicked off.

Comment 5 Sachin Ghai 2014-06-25 09:44:48 UTC
I'll share the requested info in comment3 in few minutes.

Comment 7 Sachin Ghai 2014-06-25 10:11:33 UTC
(In reply to Dominic Cleal from comment #3)
> Please edit ~foreman/config/environments/production.rb and uncomment
> "config.log_level = :debug", run "service foreman restart" and retry to get
> a stack trace in the logs.
> 
Please see attachment for traceback. 

> 1. What type of compute resource are you provisioning onto?
Libvirt

> 2. If you visit the host page again, does it load correctly with power
> state?  i.e. is the bug only after initial provisioning

On loading, All hosts page and selecting the failed VM, the state still shows "Loading Power state.." However, I can define a New Host

Comment 8 Sachin Ghai 2014-06-25 10:12:39 UTC
Created attachment 912018 [details]
requested stack trace from production.log after enabling debug logs

Comment 9 Dominic Cleal 2014-06-25 10:14:35 UTC
Could you provide the log including host creation?  This is only a partial bit.

Is the VM actually running?  I suspect it wasn't created.

Comment 10 Sachin Ghai 2014-06-25 10:27:51 UTC
I tried to check via virt-manager and it wasn't created. However UI shows its entry under "All hosts" with "Loading Power state..".

I'll try to re-create this issue and share the logs with host creation.

Comment 11 Sachin Ghai 2014-06-25 10:55:07 UTC
I can recreate the issue with following steps.

- Go to New Host page (Make sure one hostgroup already created)
- select hostgroup from drop down
- fill all details in form, I choose 'libvirt' compute resource
- de-select the selected hostgroup
- submit form


Going to attach complete logs with host_create in next comment.

Comment 12 Sachin Ghai 2014-06-25 10:55:52 UTC
Created attachment 912035 [details]
Logs from production.log with host create

Comment 13 Dominic Cleal 2014-06-25 11:23:46 UTC
There are a couple of odd things in both the latest log file and particularly the foreman-debug archive.  Are you getting an error when submitting the host, and then retrying?

The foreman-debug archive indicates a host creation that first fails with:

"Fetch TFTP boot files for shost.katellolabs.org task failed with the following error: invalid medium for RedHat 6.5"

And then a second attempt, which probably due to a bug in the form, is without the attributes required to create a new VM (I'd guess the "Virtual Machine" tab isn't visible when the form reloads).

(As a note to myself, validation of medium applicability to an OS should happen earlier too.)

Comment 14 Sachin Ghai 2014-06-25 11:38:31 UTC
(In reply to Dominic Cleal from comment #13)
> There are a couple of odd things in both the latest log file and
> particularly the foreman-debug archive.  Are you getting an error when
> submitting the host, and then retrying?
> 

Yes, initially when I deselected the hostgroup and submitted the form, I got following error. Since the Medium text box does not populated on UI when we select hostgroup, So when we unselect it, UI doesn't populate medium text box, it appears only on form submation and after below error.

Fetch TFTP boot files for shost1.katellolabs.org task failed with the following error: invalid medium for RedHat 6.5


> The foreman-debug archive indicates a host creation that first fails with:
> 
> "Fetch TFTP boot files for shost.katellolabs.org task failed with the
> following error: invalid medium for RedHat 6.5"
> 
Correct..

> And then a second attempt, which probably due to a bug in the form, is
> without the attributes required to create a new VM (I'd guess the "Virtual
> Machine" tab isn't visible when the form reloads).
> 
> (As a note to myself, validation of medium applicability to an OS should
> happen earlier too.)

Comment 15 Dominic Cleal 2014-06-25 11:41:28 UTC
Created redmine issue http://projects.theforeman.org/issues/6379 from this bug

Comment 16 Dominic Cleal 2014-06-25 11:56:06 UTC
Thanks for all of the logs and detail, that was a big help.

Note that the associated redmine is a tracker for two separate issues that are relevant here.

Comment 17 Bryan Kearney 2014-06-25 17:29:09 UTC
Upstream bug assigned to ddolguik

Comment 21 Sachin Ghai 2014-06-26 17:46:07 UTC
Verified with sat6 beta snap 11 compose2.

Could not reproduce the reported issue and can provision the host successfully.

Comment 22 Bryan Kearney 2014-07-02 14:04:54 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.


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