saltstack / saltstack/salt

[BUG] Inconsistent behaviour of dist_upgrade for pkg.upgrade (module), pkg.uptodate(state) and pkg.list_upgrades(module)

Open
#61,776 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug debian severity-low
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
A clear and concise description of what the bug is.
Running pkg.uptodate state or pkg.upgrade module on Ubuntu (apt) does not update the packages.
Tested on both Ubuntu 20.04 LTS and Ubuntu 18.04 LTS, both have the same result.

Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
sls:

update-packages:
  pkg.uptodate:
    - refresh: True

output:

----------
          ID: update-packages
    Function: pkg.uptodate
      Result: True
     Comment: Upgrade ran successfully
     Started: 13:35:21.008346
    Duration: 8186.694 ms
     Changes:
Listing... Done
fwupd-signed/focal-updates 1.27.1ubuntu5+1.5.11-0ubuntu1~20.04.2 amd64 [upgradable from: 1.27.1ubuntu2+1.3.11-1~focal1]
fwupd/focal-updates 1.5.11-0ubuntu1~20.04.2 amd64 [upgradable from: 1.3.11-1~focal1]

Same for doing pkg.upgrade, listing them goes well. Upgrading does not.
salt-call pkg.list_upgrade:

local:
    ----------
    fwupd:
        1.5.11-0ubuntu1~20.04.2
    fwupd-signed:
        1.27.1ubuntu5+1.5.11-0ubuntu1~20.04.2

salt-call pkg.upgrade:

local:
    ----------

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD

Steps to Reproduce the behavior

Expected behavior
A clear and concise description of what you expected to happen.
I would like to see all pending packages (seen with apt list --upgradable) be installed.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3004

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.7.3
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10.1
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.6.1
        pygit2: Not Installed
        Python: 3.8.10 (default, Nov 26 2021, 20:14:08)
  python-gnupg: 0.4.5
        PyYAML: 5.3.1
         PyZMQ: 18.1.1
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.2

System Versions:
          dist: ubuntu 20.04 focal
        locale: utf-8
       machine: x86_64
       release: 5.11.0-1021-azure
        system: Linux
       version: Ubuntu 20.04 focal

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pkg.uptodate, pkg.upgrade, and pkg.list_upgrade entry points and reproduce the behavior on Ubuntu 20.04 or 18.04 with the supplied SLS and package list. Compare the packages reported by apt list --upgradable with the upgrade result, and confirm that the pending packages are installed without leaving the upgrade result empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, ubuntu
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.