Bug 2056451

Summary: osbuild fails to build an ISO >= 4GB
Product: Red Hat Enterprise Linux 8 Reporter: Christophe Besson <cbesson>
Component: osbuild-composerAssignee: Ondřej Budai <obudai>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact: Eliane Ramos Pereira <elpereir>
Priority: medium    
Version: 8.5CC: atodorov, ckellner, elpereir, joseph.j.figaniak, jrusz, obudai, sbarcomb, scdbackup
Target Milestone: rcKeywords: Reproducer, WorkAround
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: osbuild-composer-46-1.el8 Doc Type: Bug Fix
Doc Text:
.`osbuild` no longer fails to build an ISO image bigger than 4GB Image Builder users can create a customized image by adding additional packages. If the total size of the packages and their dependencies exceeded 4GB size, users of RHEL 8.5 and earlier releases would see the following error: ---- ubprocess.CalledProcessError: Command '['/usr/bin/xorrisofs', '-verbose', '-V', 'RHEL-8-5-0-BaseOS-x86_64', '-sysid', 'LINUX', '-isohybrid-mbr', '/usr/share/syslinux/isohdpfx.bin', '-b', 'isolinux/isolinux.bin', '-c', 'isolinux/boot.cat', '-boot-load-size', '4', '-boot-info-table', '-no-emul-boot', '-rock', '-joliet', '-eltorito-alt-boot', '-e', 'images/efiboot.img', '-no-emul-boot', '-isohybrid-gpt-basdat', '-o', '/run/osbuild/tree/installer.iso', '/run/osbuild/inputs/tree']' returned non-zero exit status 32. ---- The problem happened because the ISO 9660 Level Of Interchange `-isolevel 3` argument was not passed to the `xorrisofs` command. To work around the problem, users had to permanently alter the ISO level value to 3. With the RHEL 8.6 release, the problem has been fixed, and users no longer need to permanently alter the ISO level value.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 13:49:32 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:
Attachments:
Description Flags
blueprint none

Description Christophe Besson 2022-02-21 09:43:13 UTC
Created attachment 1862347 [details]
blueprint

Created attachment 1862347 [details]
blueprint

Description of problem:
The customer is unable to build an image installer (ISO format) when the size of the generated "liveimg.tar" exceeds 4GB

Version-Release number of selected component (if applicable):
osbuild-35-3.el8
python3-osbuild-35-3.el8
osbuild-composer-33.2-1.el8

How reproducible:
Always

Steps to Reproduce:
1. Use the "toobig.toml" shared as an attachment
2. Push it and compose an image-installer

Actual results:
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08 bootiso:0-org.osbuild.xorrisofs failure:
 :
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         ['/usr/bin/xorrisofs', '-verbose', '-V', 'RHEL-8-5-0-BaseOS-x86_64', '-sysid', 'LINUX', '-isohybrid-mbr', '/usr/share/syslinux/isohdpfx.bin', '-b', 'isolinux/isolinux.bin', '-c', 'isolinux/boot.cat', '-boot-load-size', '4', '-boot-info-table', '-no-emul-boot', '-rock', '-joliet', '-eltorito-alt-boot', '-e', 'images/efiboot.img', '-no-emul-boot', '-isohybrid-gpt-basdat', '-o', '/run/osbuild/tree/installer.iso', '/run/osbuild/inputs/tree']
 :
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         Drive current: -outdev 'stdio:/run/osbuild/tree/installer.iso'
 :
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         Media summary: 0 sessions, 0 data blocks, 0 data, 25.1g free
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         Added to ISO image: directory '/'='/run/osbuild/inputs/tree'
 :
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         libisofs: FAILURE : File "/liveimg.tar" cannot be added to image because its size is 4 GiB or larger
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         libisofs: FAILURE : A file is bigger than supported by used standard
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         xorriso : FAILURE : Failed to prepare session write run
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         xorriso : NOTE : -return_with SORRY 32 triggered by problem severity FAILURE
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         Traceback (most recent call last):
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08           File "/run/osbuild/bin/org.osbuild.xorrisofs", line 160, in <module>
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08             args["options"])
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08           File "/run/osbuild/bin/org.osbuild.xorrisofs", line 153, in main
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08             subprocess.run(cmd, check=True)
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08           File "/usr/lib64/python3.6/subprocess.py", line 438, in run
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08             output=stdout, stderr=stderr)
Feb 18 17:26:08 localhost.localdomain osbuild-worker[472244]: 2022/02/18 17:26:08         subprocess.CalledProcessError: Command '['/usr/bin/xorrisofs', '-verbose', '-V', 'RHEL-8-5-0-BaseOS-x86_64', '-sysid', 'LINUX', '-isohybrid-mbr', '/usr/share/syslinux/isohdpfx.bin', '-b', 'isolinux/isolinux.bin', '-c', 'isolinux/boot.cat', '-boot-load-size', '4', '-boot-info-table', '-no-emul-boot', '-rock', '-joliet', '-eltorito-alt-boot', '-e', 'images/efiboot.img', '-no-emul-boot', '-isohybrid-gpt-basdat', '-o', '/run/osbuild/tree/installer.iso', '/run/osbuild/inputs/tree']' returned non-zero exit status 32.

Expected results:
Works :)

Additional info:
Hard-coding the ISO level to 3 works around the issue:

--- /usr/lib/osbuild/stages/org.osbuild.xorrisofs.orig	2022-02-21 10:33:41.991038589 +0100
+++ /usr/lib/osbuild/stages/org.osbuild.xorrisofs	2022-02-21 10:34:02.464431930 +0100
@@ -93,7 +93,8 @@
     sys_id = options.get("sysid")
     efi = options.get("efi")
     isohybrid = options.get("isohybridmbr")
-    isolevel = options.get("isolevel")
+    #isolevel = options.get("isolevel")
+    isolevel = 3
 
     cmd = [
         "/usr/bin/xorrisofs",

Comment 1 Ondřej Budai 2022-02-21 09:55:14 UTC
Christian, does it make sense to set the isolevel to 3 in the image definition? I checked RHEL 8.5 boot and "DVD" isos and they seem to be level 3.

$ iso-info rhel-8.5-x86_64-boot.iso 
iso-info version 2.1.0 x86_64-redhat-linux-gnu
Copyright (c) 2003-2005, 2007-2008, 2011-2015, 2017 R. Bernstein
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________
ISO 9660 image: rhel-8.5-x86_64-boot.iso
Application : GENISOIMAGE ISO 9660_HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE
System      : LINUX
Volume      : RHEL-8-5-0-BaseOS-x86_64
Joliet Level: 3

$ iso-info rhel-8.5-x86_64-boot.iso
iso-info version 2.1.0 x86_64-redhat-linux-gnu
Copyright (c) 2003-2005, 2007-2008, 2011-2015, 2017 R. Bernstein
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________
ISO 9660 image: rhel-8.5-x86_64-boot.iso
Application : GENISOIMAGE ISO 9660_HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE
System      : LINUX
Volume      : RHEL-8-5-0-BaseOS-x86_64
Joliet Level: 3

Comment 2 Christian Kellner 2022-02-21 10:55:44 UTC
Ondřej, for sure! I am surprised we are not doing so already!

Comment 3 Ondřej Budai 2022-02-21 13:17:09 UTC
Created a PR upstream: https://github.com/osbuild/osbuild-composer/pull/2325

Comment 5 Ondřej Budai 2022-02-25 10:55:53 UTC
Upstream PR merged, this will land in the next osbuild-composer rebase.

Comment 6 Thomas Schmitt 2022-02-26 08:04:15 UTC
Hi,

the file size problem was indeed caused by the fact that the ISO 9660
Level Of Interchange was not set to 3 (= multi-extent).

But the information from iso-info (companion of libcdio) about other
ISOs:

  Joliet Level: 3

does not tell that -iso-level >=3 was applied when those ISOs were made.
The Joliet level is rather about character sets. libcdio gets this info 
from the Joliet superblock (SVD).
joliet.pdf "Identifying an ISO 9660 SVD as Unicode (UCS-2)" talks of
ISO 2022, which seems to define escape sequences for switching between
UCS-2 planes (https://en.wikipedia.org/wiki/Universal_Coded_Character_Set).

The ISO 9660 Level Of Interchange is not announced by any volume
descriptor. It can only be detected by looking in the tree of directory
records for more than one consequtive records with the same file name.
Together they describe a multi-extent data file which is allowed only if
level 3 is enabled at ISO production time.

ISO level 3 is ok if the ISO shall be read by Linux or MS-Windows.
Other systems might habe problems with multi-extent files. (But xorriso
is able to extract them on any system where it can be built.)

Have a nice day :)

Thomas

Comment 11 Alexander Todorov 2022-03-08 11:16:14 UTC
From https://gitlab.com/osbuild/ci/osbuild-composer/-/jobs/2174390852:

Running test: regression-bigiso.sh

Passed tests: regression-excluded-dependency.sh regression-include-excluded-packages.sh regression-composer-works-behind-satellite.sh regression-composer-works-behind-satellite-fallback.sh regression-bigiso.sh

Moving to VERIFIED.

Comment 13 errata-xmlrpc 2022-05-10 13:49:32 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 (osbuild-composer bug fix and enhancement update), 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/RHBA-2022:1841