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

[BUG] Wrong parameter passed to dnf5 for list upgrades #67743

Open
1 task done
extiop opened this issue Feb 17, 2025 · 5 comments
Open
1 task done

[BUG] Wrong parameter passed to dnf5 for list upgrades #67743

extiop opened this issue Feb 17, 2025 · 5 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior info-needed waiting for more info

Comments

@extiop
Copy link

extiop commented Feb 17, 2025

Description
dnf5 since fedora-41 is linked to /usr/bin/dnf (cf. this issue and it introduces breaking changes, notably for listing upgrades. Latest salt implementation (STS, i.e. 3007.x) uses exactly the same parameters for it in order to do the same things as done with /usr/bin/dnf4, but it does not work well.

Setup

  • VM (Virtualbox, KVM, etc. please specify)
    • Qubes OS with Xen with salt 3007.1 and Fedora-41

Steps to Reproduce the behavior

  1. Install Fedora 41
  2. Use testing repositories for Qubes OS to get salt 3007.1
  3. Try with qubesctl wrapper (explained below) or directly with dnf to list upgrades:
sudo qubesctl --show-output --skip-dom0 --templates --targets=fedora-41 state.sls update.qubes-vm

Essentially it is a wrapper to salt-ssh which passes notably list upgrades parameters to dnf on fedora:

[user@fedora-41 ~]$ /usr/bin/dnf list upgrades
Updating and loading repositories:
Repositories loaded.
No matching packages to list
[user@fedora-41 ~]$ /usr/bin/dnf4 list upgrades
Last metadata expiration check: 0:00:20 ago on Sun Feb 16 18:49:57 2025.
Available Upgrades
c-ares.x86_64                                              1.34.4-3.fc41                                      updates
double-conversion.x86_64                                   3.3.1-1.fc41                                       updates
libaom.x86_64                                              3.11.0-1.fc41                                      updates
tcl.x86_64                                                 1:8.6.14-5.fc41                                    updates

Expected behavior
list upgrades command should list upgrades available via dnf5 on fedora-41.

Versions Report

salt-call --local test.versions (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
local:
    Salt Version:
              Salt: 3007.1
     
    Python Version:
            Python: 3.11.6 (main, Oct  3 2023, 00:00:00) [GCC 12.3.1 20230508 (Red Hat 12.3.1-1)]
     
    Dependency Versions:
              cffi: 1.15.1
          cherrypy: 18.8.0
          dateutil: 2.8.2
         docker-py: Not Installed
             gitdb: Not Installed
         gitpython: Not Installed
            Jinja2: 3.0.3
           libgit2: Not Installed
      looseversion: 1.2.0
          M2Crypto: Not Installed
              Mako: Not Installed
           msgpack: 1.0.4
      msgpack-pure: Not Installed
      mysql-python: Not Installed
         packaging: 21.3
         pycparser: 2.20
          pycrypto: Not Installed
      pycryptodome: 3.19.0
            pygit2: Not Installed
      python-gnupg: 0.5.0
            PyYAML: 6.0
             PyZMQ: 23.2.0
            relenv: Not Installed
             smmap: Not Installed
           timelib: Not Installed
           Tornado: 6.2
               ZMQ: 4.3.4
     
    Salt Package Information:
      Package Type: Not Installed
     
    System Versions:
              dist: qubes 4.2.4 R4.2
            locale: utf-8
           machine: x86_64
           release: 6.12.11-1.qubes.fc37.x86_64
            system: Linux
           version: Qubes OS 4.2.4 R4.2

Additional context

qubesctl is a binary used in Qubes OS and is masterless usage of salt and testing repositories uses salt 3007.1 (cf. this comment).

Hence updates with latest salt versions (cf. this comment) is not working fine with fedora-41, notably with Qubes OS latest fedora templates. This is due to this commit from this PR and this line exactly shipped since salt 3007.1.

The fix is to use --upgrades instead of upgrades on above quoted line:

[user@fedora-41 ~]$ /usr/bin/dnf list --upgrades
Updating and loading repositories:
Repositories loaded.
Available upgrades
c-ares.x86_64            1.34.4-3.fc41   updates
double-conversion.x86_64 3.3.1-1.fc41    updates
libaom.x86_64            3.11.0-1.fc41   updates
tcl.x86_64               1:8.6.14-5.fc41 updates
@extiop extiop added Bug broken, incorrect, or confusing behavior needs-triage labels Feb 17, 2025
Copy link

welcome bot commented Feb 17, 2025

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@dmurphy18
Copy link
Contributor

@extiop Sorry but from the versions report, using Python 3.11.6, this was installed from PyPI or from a Fedora package and not the supported Salt onedir architecture packages. Can you retry with the supported Salt released package.

Not saying there isn't a problem, and needing to --upgrades adjustment, just want to make sure on a supported package.

@dmurphy18 dmurphy18 added the info-needed waiting for more info label Feb 25, 2025
@dmurphy18
Copy link
Contributor

@extiop Well, just checked on Fedora 41 and looks like upgrade is back as a mainline argument, right up their with list, install and remove. And the original support for dnf5 added for Fedora 39+ is no longer valid, even though what was implemented was verified by the Fedora Salt maintainer at the time, see #64532 (comment), and PR #64675.

Looks like things got added back since upgrades is there on Fedora 40.
Will adjust to allow for the current implementation of dnf5 in Fedora 41, since most people on Fedora use the latest.
Issues being RedHat and their yum link into what flavor of dnf, that needs careful checking, so quick to change code, slow to test all the implications and platforms.

@dmurphy18
Copy link
Contributor

dmurphy18 commented Feb 25, 2025

@extiop Can you try all of this without using Qubes, that is, just using Salt and dnf|dnf5. On a Fedora 40 system with dnf and dnf5, I don't see any problems using Salt 3006.9

[root@david-XPS-15-9570 /]# dnf5 list --upgrades
Updating and loading repositories:
 Fedora 40 - x86_64                                                                                                                                                                                        100% |   4.5 MiB/s |  20.8 MiB |  00m05s
 Fedora 40 - x86_64 - Updates                                                                                                                                                                              100% |   8.8 MiB/s |  13.0 MiB |  00m01s
 Fedora 40 openh264 (From Cisco) - x86_64                                                                                                                                                                  100% |   6.9 KiB/s |   6.0 KiB |  00m01s
 Salt Repo for Salt v3006 LTS                                                                                                                                                                              100% |  23.2 KiB/s |  27.1 KiB |  00m01s
Repositories loaded.
[root@david-XPS-15-9570 /]# salt-call --local test.version
local:
    3006.9
[root@david-XPS-15-9570 /]# salt-call --local pkg.list_upgrades
local:
    ----------
[root@david-XPS-15-9570 /]# 

Note saying there isn't an issue, esp. going through ssh which has some fixes which have not yet been released, fixing some last minute pyOpenSSL deprecations, but releases for Salt 3006 and 3007 branches are coming soon.

@dmurphy18
Copy link
Contributor

And with Salt 3007.1

[root@david-XPS-15-9570 /]# salt-call --local pkg.list_upgrades
local:
    ----------
    -:
        x86_
    00m00s:
        Fedora
    00m01s:
        Fedora
    15.9:
        KiB
    31.5:
        KiB
    38.6:
        KiB/s
    52.8:
        KiB/s
    Fedora:
        40
    Repo:
        for
    Updates:
        100%
    openh264:
        (From
    v3007:
        STS
    x86_64:
        100%
    |:
        27.1
[root@david-XPS-15-9570 /]# 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior info-needed waiting for more info
Projects
None yet
Development

No branches or pull requests

2 participants