rpm-software-management/createrepo_c

Parsing primary.xml error: Start tag expected, '<' not found

asarubbo opened this issue · 4 comments

Not really a bug report, but just a suggestion based on what happened.

I switched from 0.21.1 to 1.0.0

When I launched createrepo_c I got a failure because the program was not compiled with zstd support. At this point I imagine that zstd must be mandatory instead of optional or at least it should not be the default algo when the program is not compiled with zstd support.

Anyway I built it with zstd support and everything was fine, except the fact that I got an error while doing yum makecache from an up-to-date CentOS 7, the error was:

Parsing primary.xml error: Start tag expected, '<' not found

So what I did:

  • a backup of my yum archive
  • downgraded createrepo_c to 0.21.1
  • run again createrepo_c
  • made a diff between the backup of my yum archive and the freshly generate archive

Then I discovered that I did not have anymore primary.xml.gz, instead there was primary.xml.zst.
So on my side I fixed it by adding --general-compress-type=gz --compress-type=gz but since CentOS 7 is still widely used and it seems to lack support for repo compressed in zst I'd suggest to move the default to gz

If you look at the description in https://fedoraproject.org/wiki/Changes/createrepo_c_1.0.0#Detailed_Description, it lays out some of the rationale - notably that this isn't the only compatibility glitch with EL7 introduced in 1.0.

The other major one is

When adding groups.xml to repodata createrepo_c currently adds two variants to repomd.xml. The specified file as is, uncompressed, with the type "group" and also a compressed variant with type "group_XX", where XX is compression suffix. This is atypical and unexpected. We propose to include just one variant of groups.xml using specified compression and repomd.xml type "group". This is not compatible with yum in RHEL 7. If required users will still be able to create repositories with the old layout using modifyrepo_c.

Further information: https://bugzilla.redhat.com/show_bug.cgi?id=2056318

The version of createrepo_c shipped with CentOS Stream 8 or 9 will always be compatible by default and only Fedora Rawhide currently would have this package. Do you need to use the latest version for some reason? Are you building it yourself?

We are also considering adding some kind of a compatibility option to generate metadata compatible with older releases even with new createrepo_c.
For example: --compat=rhel7

There's already a --compatibility mode, is it not possible to overload that? Or add modes to it, such that --compatibility behaves the same, but --compatibility=rhel7 includes these behaviors?