Salt: [BUG] pkgrepo.managed keeps applying changes

Created on 25 Oct 2020  路  6Comments  路  Source: saltstack/salt

Description
When a trailing slash is added to a repo's name, Salt keeps triggering a change.

OK: deb http://ftp.ch.debian.org/debian bullseye main non-free contrib
NOK: deb http://ftp.ch.debian.org/debian/ bullseye main non-free contrib

Setup

debian:
  pkgrepo.managed:
    - humanname: debian
    - name: deb http://ftp.ch.debian.org/{{ grains['os_family'].lower() }}/ bullseye main non-free contrib
    - file: /etc/apt/sources.list
    - gpgcheck: 1

Steps to Reproduce the behavior
run state.apply

Expected behavior
Once applied, it shouldn't be applied again upon next state.apply.

Screenshots
OK

local:

Summary for local
-------------
Succeeded: 62
Failed:     0
-------------
Total states run:     62
Total run time:    2.908 s

NOK:

local:
----------
          ID: debian
    Function: pkgrepo.managed
        Name: deb http://ftp.ch.debian.org/debian/ bullseye main non-free contrib
      Result: True
     Comment: Configured package repo 'deb http://ftp.ch.debian.org/debian/ bullseye main non-free contrib'
     Started: 12:34:11.800862
    Duration: 2483.958 ms
     Changes:
              ----------
              repo:
                  deb http://ftp.ch.debian.org/debian bullseye main non-free contrib

Versions Report

Salt Version:
           Salt: 3002

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.8.1
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
         Jinja2: 2.11.2
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.2
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: Not Installed
   pycryptodome: 3.9.7
         pygit2: Not Installed
         Python: 3.8.6 (default, Sep 25 2020, 09:36:53)
   python-gnupg: Not Installed
         PyYAML: 5.3.1
          PyZMQ: 19.0.2
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.3

System Versions:
           dist: debian testing bullseye
         locale: utf-8
        machine: x86_64
        release: 5.8.0-2-amd64
         system: Linux
        version: Debian GNU/Linux testing bullseye

Additional context
This was witnessed on both Bullseye and Buster.

Bug severity-medium

All 6 comments

Seems to be the same problem of #58781

It is! Tried looking for this specific problem but did not find it for some reasons.

@dynek Do you still experience this problem with v3002.2? #58781 was purportedly fixed but pkgrepo.managed still shows changes on every run for me so I suspect that #58781 was about a different problem.

@xuhcc I removed the trailing slash since then, but I tried adding it back and it does show changes on every run.

Confirming this is still an issue on Debian Buster using the 3002.2+ds-1 packages from Salt's repo.

Might need a similar fix from https://github.com/saltstack/salt/pull/57806 applied to the apt pkg module.

Was this page helpful?
0 / 5 - 0 ratings