Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

puppet agent not working with dnf5 #9506

Open
xxjack12xx opened this issue Oct 23, 2024 · 7 comments · May be fixed by #9520
Open

puppet agent not working with dnf5 #9506

xxjack12xx opened this issue Oct 23, 2024 · 7 comments · May be fixed by #9520
Labels
accepted Valid issue that we intend to work on when we have the bandwidth bug Something isn't working

Comments

@xxjack12xx
Copy link

puppet agent does not support dnf5 which is the current package manager in Fedora 41.

When having puppet install a package, the following error occurs:
Package[rsync-daemon]/ensure: change from 'purged' to 'present' failed: Execution of '/bin/dnf -d 0 -e 1 -y install rsync-daemon' returned 2: Unknown argument "-d" for command "dnf5". Add "--help" for more information about the arguments. (corrective)

@xxjack12xx xxjack12xx added the bug Something isn't working label Oct 23, 2024
@MasinAD
Copy link

MasinAD commented Oct 29, 2024

I stumbled upon this, too. My workaround at the moment is

ln -s /usr/local/bin/dnf /usr/bin/dnf4

But that's not something I want to apply to a whole fleet of managed machines, especially as dnf5 and dnf4 seem to be using different databases to keep track of packages, and dnf5 has other improvements we are missing out (smaller downloads, faster operation).

@AriaXLi AriaXLi added the accepted Valid issue that we intend to work on when we have the bandwidth label Oct 29, 2024
@AriaXLi
Copy link
Contributor

AriaXLi commented Oct 30, 2024

Hi @xxjack12xx, thank you for reporting this issue! While we agree this is likely a bug, we do not anticipate addressing this any time soon due to other issues demanding precedence. However, this is on the team's radar.

@vchepkov
Copy link
Contributor

vchepkov commented Nov 3, 2024

FYI, -d and -e switches were deprecated in dnf4 already

@bbkz
Copy link

bbkz commented Nov 6, 2024

The switches can be found in ruby/vendor_ruby/puppet/provider/package/dnfmodule.rb . Currently it is blocking the use of the puppet agent on Fedora 41 for me as i have many modules using packages.

@bbkz bbkz mentioned this issue Nov 6, 2024
@Stricken1670
Copy link

Here is some example code that triggers the problem:

  package{'gnome-tweaks':
    ensure   => present,
  }

And the error:

Error: Execution of '/usr/bin/dnf -d 0 -e 1 -y install gnome-tweaks' returned 2: Unknown argument "-d" for command "dnf5". Add "--help" for more information about the arguments.
Error: /Stage[main]/Desktop_fedora::Gnome/Package[gnome-tweaks]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install gnome-tweaks' returned 2: Unknown argument "-d" for command "dnf5". Add "--help" for more information about the arguments.

@Stricken1670
Copy link

The switches can be found in ruby/vendor_ruby/puppet/provider/package/dnfmodule.rb . Currently it is blocking the use of the puppet agent on Fedora 41 for me as i have many modules using packages.

This is for the dnf module command, so although this code will absolutely have the same problem and will also need fixing, it is not the cause for our problems.

@Stricken1670
Copy link

Found the real culprit: puppet/lib/ruby/vendor_ruby/puppet/provider/package/yum.rb

    # Yum on el-4 and el-5 returns exit status 0 when trying to install a package it doesn't recognize;                                                                       
    # ensure we capture output to check for errors.                                                                                                                           
    no_debug = Puppet.runtime[:facter].value('os.release.major').to_i > 5 ? ["-d", "0"] : []
    command = [command(:cmd)] + no_debug + ["-e", error_level, "-y", install_options, operation, wanted].compact
    output = execute(command)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Valid issue that we intend to work on when we have the bandwidth bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants