Bug 1834972 - virt-builder fails to parse CentOS 7's image-index [NEEDINFO]
Summary: virt-builder fails to parse CentOS 7's image-index
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-12 19:07 UTC by Ken Dreyer (Red Hat)
Modified: 2021-04-26 20:00 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:
kbsingh: needinfo? (bstinson)


Attachments (Terms of Use)

Description Ken Dreyer (Red Hat) 2020-05-12 19:07:37 UTC
Description of problem:
virt-index-validate says that CentOS 7's image-index file is fine, butvirt-builder cannot parse it.

Version-Release number of selected component (if applicable):
libguestfs-tools-c-1.40.2-8.fc31.x86_64

How reproducible:
always

Steps to Reproduce:
1. yum install libguestfs-tools-c
2. wget https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7
3. gpg2 --import RPM-GPG-KEY-CentOS-7
4. virt-builder -l --source https://cloud.centos.org/centos/7/images/image-index.asc --fingerprint 24C6A8A7F4A80EB5
5. 

Actual results:

virt-builder fails with an error:

virt-builder: cannot parse ‘revision’ field for ‘CentOS-7-GenericCloud-1801-01’
virt-builder: error: The index file downloaded from 
‘https://cloud.centos.org/centos/7/images/image-index.asc’ is corrupt.
You need to ask the supplier of this file to fix it and upload a fixed 
version.

However the syntax checking tool "virt-index-validate" reports no errors:

$ wget https://cloud.centos.org/centos/7/images/image-index.asc
$ virt-index-validate image-index.asc
image-index.asc validated OK

Expected results:
virt-builder and virt-index-validate agree on whether this file is valid or not.

Additional info:
The offending section seems to be this:

[CentOS-7-GenericCloud-1801-01]
name=CentOS-7-GenericCloud
file=CentOS-7-x86_64-GenericCloud-1801-01.qcow2.xz
arch=x86_64
revision=1801-01
format=qcow2
size=877985792
checksum=e3ab5e8da1c580143c8425c12e6baf53697400d9de4ec0dad47c690adeeabc7d6476eaf713bce3eae94e8856750ce37f519781086cfc6180163a67dde5285549

Specifically virt-builder errors when there is a "-" character in the "revision" field.

Comment 1 Richard W.M. Jones 2020-05-18 09:23:20 UTC
The revision field is bogus, it should be a simple integer.

Comment 2 Richard W.M. Jones 2020-05-18 09:23:56 UTC
Karanbir, any idea what creates this file?

Comment 3 Karanbir Singh 2020-05-25 12:28:04 UTC
this is a script that runs on the mirror infra itself, Fabian or Brian can likely work this.

Comment 4 farrotin 2020-05-25 12:39:03 UTC
I don't know where the script that generates this is located, and not something I can help with .. I even asked myself last time we had some cloud images someone to regen it and and then sign it too.
So that would be Johnny and/or Brian indeed

Comment 5 Ken Dreyer (Red Hat) 2021-04-26 17:31:50 UTC
There are two issues here:

1) The CentOS team has a script that should not generate these indexes with "-" in the revision field.

2) virt-builder and virt-index-validate should agree on whether this file is valid or not.

Comment 6 Richard W.M. Jones 2021-04-26 20:00:02 UTC
There's a bug in virt-index-validate in that it shouldn't report that the
file is valid (since it is not).  The problem remains that CentOS needs
to put a simple integer in that field, it's not a string.  (It's also
not the revision field like RPM's NVR).


Note You need to log in before you can comment on or make changes to this bug.