+++ This bug was initially created as a clone of Bug #2004853 +++
Since today (2021-09-16) I am not able to install some packages on a clean install of https://archives.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2. It's "clean" in the sense that it's fetched and passed directly to a packer instance which then provisions the entire VM so there's no work done inside the image prior that process. Example:
[root@fedora33-cloud-31864 spdk]# dnf install -y autoconf
[...]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Dependencies resolved.
[...]
Running transaction check
No available modular metadata for modular package 'perl-AutoLoader-5.74-471.module_f33+12592+71aff0e2.noarch', it cannot be installed on the system
No available modular metadata for modular package 'perl-B-1.80-471.module_f33+12592+71aff0e2.x86_64', it cannot be installed on the system
[...]
Error: No available modular metadata for modular package
[...]
--- Additional comment from Petr Pisar on 2021-09-21 08:28:13 GMT ---
This is caused by DNF which explicitly strictly validates modulemd-v2 documents before using them.
Since the old libmodulemd 2.9.4 does not recognize static_context field, it reports that the document is not strictly valid and DNF will discard it.
Because DNF discards all documents in a modular repository, it errors with "No available modular metadata for modular package".
DNF needs stop strictly validating the documents. Without strict validation, old libmodulemd will ignore unknown fields and DNF will happily consume them.
You can work around the DNF issues by upgrading libmodulemd first. Then subsequent invocations of DNF will recognize the same documents as valid. Because you use DNF for updating libmodulemd (and dnf, once fixed), you need temporarily disable modular repositories "dnf --disable-repo 'fedora-modular*' upgrade libmodulemd".
[...]
--- Additional comment from on 2021-09-22 10:41:40 GMT ---
I made a PR that switches off the strict validation for dnf (it is done through libdnf) https://github.com/rpm-software-management/libdnf/pull/1346.
-----
RHEL-9 is affected (libdnf-0.63.0-4.el9).
We need to apply this fix to enable future enhancements of the modulemd-v2 format. Without the fix DNF would leak packages of the new modules into non-modular package set.
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 (new packages: libdnf), 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:3959