Bug 1677916

Summary: Clone vm fails with error "TypeError: no implicit conversion of nil into String" if host is disassociated
Product: Red Hat Satellite Reporter: Ranjan Kumar <rankumar>
Component: Compute Resources - libvirtAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: chrobert, mhulan, oprazak, orabin, rjerrido
Target Milestone: 6.5.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:40:09 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:

Description Ranjan Kumar 2019-02-16 20:04:27 UTC
Description of problem: Cloning disassociated host fails with error

2019-02-16T14:26:39 [I|app|4c181046] Processing by HostsController#clone as HTML
2019-02-16T14:26:39 [I|app|4c181046]   Parameters: {"id"=>"tower.example.com"}
2019-02-16T14:26:39 [I|app|4c181046] Current user set to admin (admin)
2019-02-16T14:26:39 [W|app|4c181046] Action failed
TypeError: no implicit conversion of nil into String
/opt/theforeman/tfm/root/usr/share/gems/gems/fog-libvirt-0.4.1/lib/fog/libvirt/requests/compute/list_domains.rb:9:in `lookup_domain_by_uuid'
/opt/theforeman/tfm/root/usr/share/gems/gems/fog-libvirt-0.4.1/lib/fog/libvirt/requests/compute/list_domains.rb:9:in `list_domains'
/opt/theforeman/tfm/root/usr/share/gems/gems/fog-libvirt-0.4.1/lib/fog/libvirt/models/compute/servers.rb:15:in `get'
/usr/share/foreman/app/models/compute_resource.rb:181:in `find_vm_by_uuid'
/usr/share/foreman/app/models/compute_resources/foreman/model/libvirt.rb:40:in `find_vm_by_uuid'
/usr/share/foreman/app/models/compute_resource.rb:335:in `vm_compute_attributes_for'
/usr/share/foreman/app/models/compute_resources/foreman/model/libvirt.rb:190:in `vm_compute_attributes_for'
/usr/share/foreman/app/models/host/managed.rb:654:in `clone'
/usr/share/foreman/app/controllers/hosts_controller.rb:93:in `clone'


Version-Release number of selected component (if applicable): 6.5.0


How reproducible: Always


Steps to Reproduce:
1. Go to all host, edit host and disassociate host
2. Now go back to host profile and click on "clone"
    Oops, we're sorry but something went wrong no implicit conversion of nil into String

This is working in Satellite 6.4.2

Comment 3 Marek Hulan 2019-02-26 08:27:50 UTC
Created redmine issue https://projects.theforeman.org/issues/26156 from this bug

Comment 4 Marek Hulan 2019-02-26 08:29:01 UTC
seems we need to clean more attributes, such as compute attributes on disassociation

Comment 5 orabin 2019-04-01 08:38:39 UTC
Does this still happen with 6.5 Beta?
I wasn't able to reproduce upstream.

Comment 6 Ranjan Kumar 2019-04-02 08:08:19 UTC
@orabin, This issue is not reproducible this on latest snap of satellite 6.5

Comment 7 orabin 2019-04-02 09:58:28 UTC
Thanks for checking! I'm moving this to ON_QA

Comment 8 Lukáš Hellebrandt 2019-04-11 13:20:03 UTC
Also can't reproduce using reproducer from OP => Verified with Sat 6.5 snap 23.

Comment 10 errata-xmlrpc 2019-05-14 12:40:09 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/RHSA-2019:1222