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] pkgrepo.managed deletes comment lines from sources.list, rather than adding new repo to sources.list.d #64451

Closed
2 of 9 tasks
dehnert opened this issue Jun 12, 2023 · 3 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior debian affects this operating system package-repo Regression The issue is a bug that breaks functionality known to work in previous releases.

Comments

@dehnert
Copy link
Contributor

dehnert commented Jun 12, 2023

Description
When I run pkgrepo.managed, rather than adding my new repo to my file in sources.list.d, it seems to move the first comment line from sources.list into my new file.

Setup

install salt master packages:
  pkgrepo.managed:
    - humanname: SaltStack repo
    - name: https://repo.saltproject.io/salt/py3/ubuntu/{{grains['osrelease']}}/{{grains['osarch']}}/latest {{grains['oscodename']}} main
    - file: /etc/apt/sources.list.d/saltstack.list
    - key_url: salt://salt/repo-key.pub

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
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior

Run state.apply

Observe:

root@bochnia:~# cat /etc/apt/sources.list.d/saltstack.list
## Note, this file is written by cloud-init on first boot of an instance
root@bochnia:~# diff -u /etc/apt/sources.list{.old,}
--- /etc/apt/sources.list.old   2023-06-12 04:58:41.596798732 +0000
+++ /etc/apt/sources.list       2023-06-12 04:59:46.081329774 +0000
@@ -1,4 +1,3 @@ 
-## Note, this file is written by cloud-init on first boot of an instance
 ## modifications made here will not survive a re-bundle.
 ## if you wish to make changes you can:
 ## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg

Expected behavior

/etc/apt/sources.list.d/saltstack.list should contain a line like deb https://repo.saltproject.io/salt/py3/ubuntu/22.04/amd64/latest jammy main and sources.list should be unchanged.

Versions Report

Minion salt --versions-report (Provided by running salt-call --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3006.1
 
Python Version:
        Python: 3.10.11 (main, May  5 2023, 02:31:54) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 5.4.1
         PyZMQ: 23.2.0
        relenv: 0.12.3
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: ubuntu 22.04.2 jammy
        locale: iso8859-1
       machine: x86_64
       release: 5.15.0-71-generic
        system: Linux
       version: Ubuntu 22.04.2 jammy
Master salt --versions-report
salt --versions-report
Salt Version:
          Salt: 3005.1
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.6.1
     docker-py: Not Installed
         gitdb: 2.0.3
     gitpython: 2.1.8
        Jinja2: 2.10
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.5.6
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: 2.6.1
  pycryptodome: 3.4.7
        pygit2: Not Installed
        Python: 3.6.9 (default, Mar 10 2023, 16:46:00)
  python-gnupg: 0.4.1
        PyYAML: 3.12
         PyZMQ: 17.1.2
         smmap: 2.0.3
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.2.5
 
System Versions:
          dist: ubuntu 18.04 Bionic Beaver
        locale: ISO-8859-1
       machine: x86_64
       release: 4.15.0-211-generic
        system: Linux
       version: Ubuntu 18.04 Bionic Beaver

Additional context

As far as I can tell, every time I apply the state the first "normal" comment line (not a commented out deb line) gets deleted from sources.list and moved into saltstack.list.

@dehnert dehnert added Bug broken, incorrect, or confusing behavior needs-triage labels Jun 12, 2023
@dehnert
Copy link
Contributor Author

dehnert commented Jun 12, 2023

After downgrading the minion to 3004.1, this started working. (More specifically, after downgrading, I got an error about having gotten the name wrong; once I prepended deb it started working.)

I realize that a newer minion than master is not supported, but I'm not sure if this sort of extremely confusing behavior is the expected outcome of that discrepancy, or there's a regression between 3004 and 3006.

@OrangeDog
Copy link
Contributor

@dehnert the master is not involved. This runs entirely on the minion.

@OrangeDog OrangeDog added Regression The issue is a bug that breaks functionality known to work in previous releases. package-repo debian affects this operating system labels Jun 12, 2023
@garethgreenaway garethgreenaway added this to the Sulfur v3006.2 milestone Jun 12, 2023
@dwoz dwoz removed the needs-triage label Jul 11, 2023
@Ch3LL
Copy link
Contributor

Ch3LL commented Aug 25, 2023

Closed by #65049

@Ch3LL Ch3LL closed this as completed Aug 25, 2023
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 debian affects this operating system package-repo Regression The issue is a bug that breaks functionality known to work in previous releases.
Projects
None yet
Development

No branches or pull requests

6 participants