Bug 787791

Summary: imgfactory build fails w/ RuntimeError: cat: open: /etc/init.d/sshd: No such file
Product: [Retired] CloudForms Cloud Engine Reporter: dgao
Component: imagefactoryAssignee: Ian McLeod <imcleod>
Status: CLOSED NOTABUG QA Contact: Martin Kočí <mkoci>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: akarol, brad, dajohnso, deltacloud-maint, dgao, hbrock, morazi, ssachdev, whayutin
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-13 10:53:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
template_file none

Description dgao 2012-02-06 18:27:36 UTC
cli call: aeolus image build --target ec2,rhevm,vsphere --template rhel_audrey.tmpl

from imgfactory.log

2012-02-06 11:53:41,199 DEBUG imgfac.builders.BaseBuilder.RHEL6_vsphere_Builder pid(3622) Message: Exception caught in ImageFactory
2012-02-06 11:53:41,200 DEBUG imgfac.builders.BaseBuilder.RHEL6_vsphere_Builder pid(3622) Message: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/imgfac/builders/Fedora_vsphere_Builder.py", line 49, in build_image
    self.build_upload(build_id)
  File "/usr/lib/python2.6/site-packages/imgfac/builders/Fedora_vsphere_Builder.py", line 115, in build_upload
    self.output_descriptor = self.guest.customize_and_generate_icicle(libvirt_xml)
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 1178, in customize_and_generate_icicle
    return self._internal_customize(libvirt_xml, True)
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 1143, in _internal_customize
    self._collect_setup(modified_xml)
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 461, in _collect_setup
    self._image_ssh_teardown_step_2(g_handle)
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 211, in _image_ssh_teardown_step_2
    startuplink = self._get_service_runlevel_link(g_handle, 'sshd')
  File "/usr/lib/python2.6/site-packages/oz/RedHat.py", line 168, in _get_service_runlevel_link
    lines = g_handle.cat('/etc/init.d/' + service).split("\n")
  File "/usr/lib/python2.6/site-packages/guestfs.py", line 1263, in cat
    return libguestfsmod.cat (self._o, path)
RuntimeError: cat: open: /etc/init.d/sshd: No such file or directory


Confusing thing is that Fedora_vsphere_Builder.py is kicked off instead of RHEL6_vsphere_Builder.py.

Comment 1 dgao 2012-02-06 18:29:16 UTC
Created attachment 559716 [details]
template_file

Comment 2 dgao 2012-02-06 18:34:50 UTC
[root@intel-d3c4702-01 ~]# rpm -qa | grep "imagefactory"
imagefactory-jeosconf-ec2-rhel-1.0.0rc3-1.el6.noarch
imagefactory-1.0.0rc3-1.el6.noarch
rubygem-imagefactory-console-0.4.0-1.el6.noarch
imagefactory-jeosconf-ec2-fedora-1.0.0rc3-1.el6.noarch

Comment 3 jrd 2012-02-06 19:23:01 UTC
Is this a regression?

Comment 4 Ian McLeod 2012-02-07 15:24:36 UTC
I don't believe so.  This would seem to indicate that the sshd startup script was somehow removed during customization.  That's weird.  Will attempt to duplicate using the same template on my own test install.

Comment 5 Ian McLeod 2012-02-09 15:27:09 UTC
I could not reproduce this running with the same template.  Can you try again on a fresh install?

Comment 6 Martin Kočí 2012-02-13 10:53:07 UTC
I haven't reproduced the issue either with the latest current packages available. I have tried that few times and always I have built images successfully. 

# rpm -qa|grep "imagefactory-\|oz-\|iwhd\|aeolus-"
imagefactory-jeosconf-ec2-fedora-1.0.0rc4_2_gf16dfc5-1.el6.noarch
aeolus-conductor-0.9.0-0.20120118181603git71cd8bc.el6.noarch
oz-0.8.0-4.el6.noarch
aeolus-all-0.9.0-0.20120118181603git71cd8bc.el6.noarch
rubygem-imagefactory-console-0.5.0-4.20110824113238gitd9debef.el6.noarch
aeolus-conductor-doc-0.9.0-0.20120118181603git71cd8bc.el6.noarch
aeolus-configure-2.6.0-0.20120118121620gita996371.el6.noarch
imagefactory-1.0.0rc4_2_gf16dfc5-1.el6.noarch
iwhd-1.2-3.el6.x86_64
rubygem-aeolus-cli-0.4.0-0.20120118121626git6fddd65.el6.noarch
imagefactory-jeosconf-ec2-rhel-1.0.0rc4_2_gf16dfc5-1.el6.noarch
rubygem-aeolus-image-0.4.0-0.20120118121635git0d31a37.el6.noarch
aeolus-conductor-daemons-0.9.0-0.20120118181603git71cd8bc.el6.noarch

I haven't tried that with older packages. Assuming this is either fixed with the latest packages or it was some environment issue. I'm closing this bug as NOTABUG. Let's reopen the bug if the issue appears again.