OSInside / kiwi

KIWI - Appliance Builder Next Generation
https://osinside.github.io/kiwi
GNU General Public License v3.0
301 stars 152 forks source link

config XML validation fails if no user pass specified despite it being an optional attribute #1599

Closed mitja-suncic closed 3 years ago

mitja-suncic commented 3 years ago

Problem description

Config XML file validation fails with the below error when the "password" attribute for a user is not set when attempting to create an Ubuntu Focal image.:

$ sudo kiwi-ng --logfile=./my_log.log --type=oem --profile=Disk system build --description=<path_to_config_file>/ubuntu-focal/ --target-dir=./my_img
[ INFO    ]: 10:26:56 | Loading XML description
[ INFO    ]: 10:26:56 | Support for XML markup available
[ INFO    ]: 10:26:57 | RelaxNG validation failed. See jing report:
[ INFO    ]: 10:26:57 | --> /tmp/xslt-m4p_uxze:24:74: error: element "user" missing required attribute "password"
/tmp/xslt-m4p_uxze:25:76: error: element "user" missing required attribute "password"

[ ERROR   ]: 10:26:57 | KiwiDescriptionInvalid: Failed to validate schema and/or schematron rules

Expected behaviour

Because documentation states that only the following 2 attributes are mandatory for user creation: " a)name: the UNIX username b)home: the path to the user’s home directory" (source: https://documentation.suse.com/kiwi/9/pdf/kiwi_color_en.pdf, p.37, 38) " and that the "password" attribute is optional, I was expecting to be able to create the image with the following 2 users specified in the config.xml file:

<image schemaversion="6.8" name="Ubuntu-20.04_appliance">
/.../
<users>
        <user name="someuser" home="/home/someuser"/>
        <user name="sysadmin" home="/home/sysadmin"/>
</users>

Steps to reproduce the behaviour

  1. Install Kiwi NG version 9.21.17
  2. Get Config XML template for an Ubuntu Focal image from the following Git repo: https://github.com/OSInside/kiwi-descriptions
  3. Edit the "user" section of the following Config XML file so that it only contains the "name" and "home" attributes: $ vim kiwi-descriptions/ubuntu/x86_64/ubuntu-focal/config.xml
  4. Try to create an Ubuntu Focal image by executing the following command: $ sudo kiwi-ng --logfile=./my_log.log --type=oem --profile=Disk system build --description=<path_to_templates>/kiwi-descriptions/ubuntu/x86_64/ubuntu-focal/ --target-dir=./my_img You should see the attempt fail with the following error message: error: element "user" missing required attribute "password"

OS and Software information

schaefi commented 3 years ago

Yeah docs or code is wrong, we have to check on that also related to #1100