Bug 2270364

Summary: dnf install 'dnf-command(versionlock)' doesn't install the "versionlock" dnf command
Product: [Fedora] Fedora Container Images Reporter: Romain Geissler <romain.geissler>
Component: fedora-container-imageAssignee: Clement Verna <clems.verna>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 40CC: clems.verna, daniel.mach, fedoraproject, jmracek, mblaha, packaging-team-maint, pkratoch, praiskup, rpm-software-management
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-07-01 22:48:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Romain Geissler 2024-03-19 23:36:32 UTC
Hi,

With fedora 40, dnf install 'dnf-command(versionlock)' doesn't seem to work anymore. It still correctly installs the package python3-dnf-plugin-versionlock but in the end, the command "dnf versionlock" is still broken. The exact same thing with fedora 39 works fine.

Reproducible: Always

Steps to Reproduce:
1. Try with fedora 40, using podman:

> podman run --rm --pull=always registry.fedoraproject.org/fedora:40 sh -c 'dnf -y install "dnf-command(versionlock)" && dnf versionlock add bash'
(...) snapped
Installed:
  dbus-libs-1:1.14.10-3.fc40.x86_64
  python3-dateutil-1:2.8.2-13.fc40.noarch
  python3-dbus-1.3.2-6.fc40.x86_64
  python3-distro-1.9.0-3.fc40.noarch
  python3-dnf-plugin-versionlock-4.5.0-1.fc40.noarch
  python3-dnf-plugins-core-4.5.0-1.fc40.noarch
  python3-six-1.16.0-14.fc40.noarch
  python3-systemd-235-9.fc40.x86_64
  systemd-libs-255.4-1.fc40.x86_64

Complete!
No such command: versionlock. Please use /usr/bin/dnf --help
It could be a DNF plugin command, try: "dnf install 'dnf-command(versionlock)'"



2. While doing the exact same thing with fedora 39 works fine:

> podman run --rm --pull=always registry.fedoraproject.org/fedora:39 sh -c 'dnf -y install "dnf-command(versionlock)" && dnf versionlock add bash'
(...) snapped
Installed:
  dbus-libs-1:1.14.10-1.fc39.x86_64
  fonts-filesystem-1:2.0.5-12.fc39.noarch
  js-jquery-3.6.4-2.fc39.noarch
  python-systemd-doc-235-5.fc39.x86_64
  python3-dateutil-1:2.8.2-10.fc39.noarch
  python3-dbus-1.3.2-4.fc39.x86_64
  python3-distro-1.8.0-6.fc39.noarch
  python3-dnf-plugin-versionlock-4.5.0-1.fc39.noarch
  python3-dnf-plugins-core-4.5.0-1.fc39.noarch
  python3-six-1.16.0-12.fc39.noarch
  python3-systemd-235-5.fc39.x86_64
  web-assets-filesystem-5-20.fc39.noarch

Complete!
Last metadata expiration check: 0:00:12 ago on Tue Mar 19 23:34:57 2024.
Adding versionlock on: bash-0:5.2.21-1.fc39.*
Actual Results:  
Even after installing the right package, issuing "dnf versionlock" results in an error:
No such command: versionlock. Please use /usr/bin/dnf --help

Expected Results:  
"dnf versionlock" should be useable after having installed the right package.

Comment 1 Marek Blaha 2024-03-20 07:20:09 UTC
It looks like the F40 container image contains dnf versionlock config file witch
1. explicitly disable versionlock plugin
2. does not configure locklist parameter without which the plugin does not work (see configuration section of `man dnf-versionlock`)

❯ podman run --rm --pull=always registry.fedoraproject.org/fedora:40 sh -c 'cat /etc/dnf/plugins/versionlock.conf'
Trying to pull registry.fedoraproject.org/fedora:40...
Getting image source signatures
Copying blob d679df23bdee skipped: already exists  
Copying config 3cb2ec473c done   | 
Writing manifest to image destination
[main]
enabled = 0

So to workaround it you can for example do `rm /etc/dnf/plugins/versionlock.conf` before installation. But the real fix needs to be done in the container image.

❯ podman run --rm --pull=always registry.fedoraproject.org/fedora:40 sh -c 'rm -f /etc/dnf/plugins/versionlock.conf && dnf -y install "dnf-command(versionlock)" && sleep 3 && dnf versionlock add bash'
------ 8< -------------
Installed:
  dbus-libs-1:1.14.10-3.fc40.x86_64                                             
  python3-dateutil-1:2.8.2-13.fc40.noarch                                       
  python3-dbus-1.3.2-6.fc40.x86_64                                              
  python3-distro-1.9.0-3.fc40.noarch                                            
  python3-dnf-plugin-versionlock-4.5.0-1.fc40.noarch                            
  python3-dnf-plugins-core-4.5.0-1.fc40.noarch                                  
  python3-six-1.16.0-14.fc40.noarch                                             
  python3-systemd-235-9.fc40.x86_64                                             
  systemd-libs-255.4-1.fc40.x86_64                                              

Complete!
Last metadata expiration check: 0:00:08 ago on Wed Mar 20 07:13:53 2024.
Adding versionlock on: bash-0:5.2.26-3.fc40.*

Comment 2 Marek Blaha 2024-03-20 07:22:08 UTC
Oh, sorry for the `&& sleep 3` in the last example. It's completely useless and should not be there.

Comment 3 Romain Geissler 2024-04-25 16:56:59 UTC
Mmmmh checking today the released containers of fedora 40, it seems the issue is still present. I somehow had hoped this would have been fixed during the different pre-release periods.

Comment 4 Romain Geissler 2024-04-26 15:24:40 UTC
After investigation on my side, this regression is caused by the move to Kiwi to build the OCI images.

I have proposed an idea to fix this upstream, however since I litterally know nothing about kiwi this might be rejected ;) See https://github.com/OSInside/kiwi/pull/2538

Comment 5 Romain Geissler 2024-07-01 22:48:20 UTC
After the merge of my pull request upstream and the backport in fedora 40, this issue is now fixed. The file /etc/dnf/plugins/versionlock.conf is no longer present in current fedora 40/rawhide container images:

rgeissler@ncerndobedev6097:~> podman run --rm --pull=always registry.fedoraproject.org/fedora:40 sh -c 'cat /etc/dnf/plugins/versionlock.conf'                                                                10:44PM
Trying to pull registry.fedoraproject.org/fedora:40...
Getting image source signatures
Copying blob sha256:b97f2013e3149eadf360248592a1007bdcb5334a7aca325b3c9faf31a1f7b8a2
Copying config sha256:69903e40c994b97fe0d1edbd67b9cefb0083242781674cc9847189528bdb5d40
Writing manifest to image destination
cat: /etc/dnf/plugins/versionlock.conf: No such file or directory


rgeissler@ncerndobedev6097:~> podman run --rm --pull=always registry.fedoraproject.org/fedora:rawhide sh -c 'cat /etc/dnf/plugins/versionlock.conf'                                                           10:46PM
Trying to pull registry.fedoraproject.org/fedora:rawhide...
Getting image source signatures
Copying blob sha256:e7a4eccf3f8745931a853544c4dc355d9dd138a897d5f043d2db46b5c24400d0
Copying config sha256:7a3dd76cc0040977c5ffed6a4c8ce5b70ec242736e623664dc37ee220f5e9aae
Writing manifest to image destination
cat: /etc/dnf/plugins/versionlock.conf: No such file or directory