Skip to content

Weird failure with a non-existent profile in a kiwi description #8463

Open
@dcermak

Description

Issue Description

I have tried to build a bunch of images from a single kiwi file leveraging profiles. Unfortunately, I've made a tiny mistake and left a non-existent profile, which resulted in an unhelpful no imagetype set for this architecture/profile error message.

The image description is the following:

<?xml version="1.0" encoding="utf-8"?>

<!-- The line below is required in order to use the multibuild OBS features -->
<!-- OBS-Profiles: @BUILD_FLAVOR@ -->
<!-- OBS-ExclusiveArch: aarch64 x86_64 -->

<image schemaversion="7.1" name="SLE-12-SP3">
    <description type="system">
        <author>Dan Cermak</author>
        <contact>dcermak@suse.com</contact>
        <specification>
            SUSE Linux Enterprise 12 SP3 - BYOL (bring your own license)
        </specification>
    </description>
    <profiles>
        <profile name="libvirt" description="Base profile for the libvirt Vagrant Box" arch="x86_64"/>
        <profile name="virtualbox" description="Base profile for the Virtualbox Vagrant Box" arch="x86_64"/>
        <profile name="libvirt_sles" description="Vagrant Box for SLES using libvirt" arch="x86_64">
            <requires profile="libvirt"/>
        </profile>
        <profile name="libvirt_sled" description="Vagrant Box for SLED using libvirt" arch="x86_64">
            <requires profile="libvirt"/>
        </profile>
        <profile name="libvirt_aarch64_sles" description="Vagrant Box for SLES for libvirt on aarch64" arch="aarch64"/>
        <profile name="virtualbox_sles" description="Vagrant Box for SLES using VirtualBox" arch="x86_64">
            <requires profile="virtualbox"/>
        </profile>
        <profile name="virtualbox_sled" description="Vagrant Box for SLED using VirtualBox" arch="x86_64">
            <requires profile="virtualbox"/>
        </profile>
    </profiles>
    <preferences>
        <version>12.3</version>
        <packagemanager>zypper</packagemanager>
        <locale>en_US</locale>
        <keytable>us</keytable>
        <timezone>Europe/Berlin</timezone>
        <rpm-excludedocs>true</rpm-excludedocs>
        <rpm-check-signatures>false</rpm-check-signatures>
        <bootsplash-theme>SLE</bootsplash-theme>
        <bootloader-theme>SLE</bootloader-theme>
    </preferences>
    <preferences profiles="libvirt">
        <type image="vmx" filesystem="ext4" format="vagrant" boottimeout="0" bootloader="grub2" firmware="efi">
            <vagrantconfig provider="libvirt" virtualsize="42"/>
            <size unit="G">42</size>
        </type>
    </preferences>
    <preferences profiles="libvirt_aarch64">
        <type image="vmx" filesystem="ext4" format="vagrant" boottimeout="0" bootloader="grub2" firmware="efi">
            <vagrantconfig provider="libvirt" virtualsize="42" embedded_vagrantfile="aarch64_vagrantfile"/>
            <size unit="G">42</size>
        </type>
    </preferences>
    <preferences profiles="virtualbox">
        <type image="vmx" filesystem="ext4" format="vagrant" boottimeout="0" bootloader="grub2">
            <vagrantconfig provider="virtualbox" virtualbox_guest_additions_present="false" virtualsize="42"/>
            <size unit="G">42</size>
        </type>
    </preferences>

    <users>
        <user password="vagrant" home="/root" name="root" groups="root" pwdformat="plain" />
        <user password="vagrant" home="/home/vagrant" name="vagrant" groups="vagrant" pwdformat="plain" />
    </users>

    <repository type="rpm-md">
        <source path="obsrepositories:/"/>
    </repository>

    <packages type="image">
        <package name="checkmedia"/>
        <package name="ca-certificates"/>
        <package name="ca-certificates-mozilla"/>
        <package name="curl"/>
        <package name="plymouth-dracut"/>
        <package name="iputils"/>
        <package name="vim"/>
        <package name="grub2"/>
        <package name="grub2-x86_64-efi" arch="x86_64"/>
        <package name="grub2-arm64-efi" arch="aarch64"/>
        <package name="lvm2"/>
        <package name="plymouth"/>
        <package name="fontconfig"/>
        <package name="fonts-config"/>
        <package name="tar"/>
        <package name="parted"/>
        <package name="openssh"/>
        <package name="iproute2"/>
        <package name="less"/>
        <package name="bash-completion"/>
        <package name="which"/>
        <package name="shim" arch="x86_64"/>
        <package name="sudo"/>
        <package name="SUSEConnect"/>
        <package name="systemd"/>
        <package name="suse-build-key"/>
        <package name="sles-release-DVD"/>
        <package name="kernel-default"/>
        <package name="timezone"/>
        <package name="rsync"/>

        <!-- FIXME: change this to python3 once Ansible switches to it -->
        <package name="python"/>
        <package name="python-xml"/>

        <!-- for dracut -->
        <package name="keyutils"/>
        <package name="wicked"/>
        <package name="dmraid"/>

        <!-- to get enough entropy, otherwise network interfaces won't get up -->
        <package name="haveged"/>

    </packages>

    <packages type="image" profiles="libvirt_sles,virtualbox_sles">
        <package name="sles-release-DVD"/>
        <!-- creates /etc/os-release & /etc/products.d/ -->
        <!-- those need to be present for SUSEConnect to recognize the product -->
        <package name="sles-release"/>
    </packages>

    <packages type="image" profiles="libvirt_sled,virtualbox_sled">
        <!-- creates /etc/os-release & /etc/products.d/ -->
        <!-- those need to be present for SUSEConnect to recognize the product -->
        <package name="sled-release"/>
        <package name="sled-release-MINI"/>
    </packages>

    <packages type="bootstrap">
        <package name="udev"/>
        <package name="filesystem"/>
        <package name="glibc-locale"/>
        <package name="cracklib-dict-full"/>
        <package name="ca-certificates"/>
    </packages>
</image>

and requires the following _multibuild:

<multibuild>
    <flavor>libvirt_sles</flavor>
    <flavor>libvirt_sled</flavor>
    <flavor>libvirt_aarch64_sles</flavor>
    <flavor>virtualbox_sles</flavor>
    <flavor>virtualbox_sled</flavor>
</multibuild>

This fails for aarch64 with no imagetype set for this architecture/profile. The culprit is this line:

<preferences profiles="libvirt_aarch64">

it should be actually:

<preferences profiles="libvirt_aarch64_sles">

My guess is that there is something odd in OBS when it parses the kiwi description, as the build can be tricked into actually starting by changing this line:

        <profile name="libvirt_aarch64_sles" description="Vagrant Box for SLES for libvirt on aarch64" arch="aarch64"/>

to:

        <profile name="libvirt_aarch64_sles" description="Vagrant Box for SLES for libvirt on aarch64" arch="aarch64">
           <requires profile="libvirt_aarch64"/>
         </profile>

The build will then actually start for aarch64 and not fail with no imagetype set for this architecture/profile but instead with a kiwi error message, because the profile libvirt_aarch64 does not exist.

Note, if you have access to build.suse.de, then you can check out project: https://build.suse.de/package/show/home:dancermak:SLE-12-SP3/kiwi-images-vagrant

Expected Result

OBS should have started the build for aarch64 with the buggy xml description and let kiwi produce an error message that the "libvirt_aarch64" profile does not exist.

How to Reproduce

  1. Go to https://build.suse.de/package/show/home:dancermak:SLE-12-SP3/kiwi-images-vagrant
  2. Checkout revision 1
  3. Run the build on aarch64
  4. See the error produced by the build

Further Information

Metadata

Assignees

No one assigned

    Labels

    BackendThings regarding the OBS backendBug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions