You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trailing slashes in the repo URI. This is because the pkgrepo states strip the trailing slash from apt repos (a fix added semi-recently to resolve bugs in pkgrepo.managed), but pkg.get_repo and pkg.del_repo (from aptpkg.py) do not normalize for trailing slashes.
An architecture is present in the repo definition, but the existing repo matching the URI either does not contain an architecture, or contains a different architecture. This is because pkg.get_repo does not consider architecture when matching a repo definition (causing it to be identified as a match erroneously), and then pkg.del_repo (which does consider architecture) does not find a match and fails to delete, causing a CommandExecutionError to be raised.
Setup
/etc/apt/sources.list.d/google-chrome.list
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
/srv/salt/test/init.sls
include:
- .remove
- .add
/srv/salt/test/remove.sls
chrome-repo-remove:
pkgrepo.absent:
- name: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
/srv/salt/test/add.sls
chrome-repo-add:
pkgrepo.managed:
- name: deb http://dl.google.com/linux/chrome/deb stable main
- dist: stable
- file: /etc/apt/sources.list.d/added-chrome-repo.list
- key_url: https://dl-ssl.google.com/linux/linux_signing_key.pub
Running a state.apply test with this configuration will fail on 3006.1 (bug number 1 above). You can get the removal to work if you edit the repo file in /etc/apt/sources.list.d/ and remove the trailing slash, but a second run will fail because the repo added in add.sls will incorrectly be identified as a match for the pkgrepo.absent state (bug number 2 above).
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
(Include debug logs if possible and relevant)
Expected behavior
A clear and concise description of what you expected to happen.
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.)
PASTE HERE
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
terminalmage
changed the title
[BUG] [3006.1] pkgrepo.absent fails in 2 specific cases
[BUG] [3006.1] pkgrepo.absent fails in 2 specific cases for apt-based distros
May 16, 2023
Description
pkgrepo
states strip the trailing slash from apt repos (a fix added semi-recently to resolve bugs inpkgrepo.managed
), butpkg.get_repo
andpkg.del_repo
(from aptpkg.py) do not normalize for trailing slashes.pkg.get_repo
does not consider architecture when matching a repo definition (causing it to be identified as a match erroneously), and thenpkg.del_repo
(which does consider architecture) does not find a match and fails to delete, causing aCommandExecutionError
to be raised.Setup
/etc/apt/sources.list.d/google-chrome.list
/srv/salt/test/init.sls
/srv/salt/test/remove.sls
/srv/salt/test/add.sls
Running a
state.apply test
with this configuration will fail on 3006.1 (bug number 1 above). You can get the removal to work if you edit the repo file in/etc/apt/sources.list.d/
and remove the trailing slash, but a second run will fail because the repo added inadd.sls
will incorrectly be identified as a match for thepkgrepo.absent
state (bug number 2 above).Steps to Reproduce the behavior
(Include debug logs if possible and relevant)
Expected behavior
A clear and concise description of what you expected to happen.
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.)PASTE HERE
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: