salt: [BUG] pkgrepo.managed fails to configure ppa on Ubuntu 20.10
Description After upgrade to Ubuntu 20.10, I can’t setup my ppa repositories. Running high.state fails with error:
ID: ppa keepassxc
Function: pkgrepo.managed
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/state.py", line 2153, in call
ret = self.states[cdata["full"]](
File "/usr/lib/python3/dist-packages/salt/loader.py", line 2087, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/states/pkgrepo.py", line 396, in managed
pre = __salt__["pkg.get_repo"](repo=repo, **kwargs)
File "/usr/lib/python3/dist-packages/salt/modules/aptpkg.py", line 1735, in get_repo
repo = softwareproperties.ppa.PPAShortcutHandler(repo).expand(
AttributeError: 'PPAShortcutHandler' object has no attribute 'expand'
Started: 09:03:34.633592
Duration: 1068.175 ms
Looks, like changes in python3-software-properties break salt.
Setup I’m using masterless salt configuration.
sls that fails to run:
ppa keepassxc:
pkgrepo.managed:
- ppa: phoerious/keepassxc
Steps to Reproduce the behavior
- set sls to configure ppa with
pkgrepo.managed - run high.state
Expected behavior ppa is properly configured.
Versions Report
salt --versions-report
Salt Version:
Salt: 3001
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.8.1
docker-py: 4.1.0
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: 2.6.1
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.2
System Versions:
dist: ubuntu 20.10 groovy
locale: utf-8
machine: x86_64
release: 5.8.0-29-lowlatency
system: Linux
version: Ubuntu 20.10 groovy
python3-software-properties version
||/ Name Version
+++-===================================
ii python3-software-properties 0.99.3
Additional context Salt installed from official Ubuntu 20.10 packages. Problem also exists on latest 3002.2 provided from saltstack repositories.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 23 (6 by maintainers)
Still happening with 3004.1 on 22.04 (jammy). I’m not sure whether this is the right fix, but this is the patch I’m using locally, which seems to work and also doesn’t change the PPA repo entry every time it runs:
The bug can be bypassed by switching to a regular type of repository instead of ppa. E.g.:
to
Confirmed this exists in a brand new Ubuntu 22.04.1 LTS (installed on OSX using multipass). FWIW salt was installed using the bash script (not
apt).Note I’ve done
apt-get update && apt-get upgrade && service salt-minion restartbut that didn’t help.The patch in #59065 (comment) fixed it for me and I applied it using a salt state (on my masterless-minion).
Where
patches/files/saltstack_issue_59065.diffis the patch as referenced above.This begs the question (for another thread), should the salt-minion issue an “unsupported os version for salt-minion” warning when running jobs to help incompetent people, like me, to do a proper upgrade? 😃
Confirmed still happening in 3005.1
Ummm… I have to amend the above. I have two ubuntu systems, both started their lives as 20.04LTS and have gone through do-release-upgrade. Both have 3005.1 installed.
However, I got the error on one of the systems but not on the other.
Here’s the diff between them:
Server WITHOUT error:
As you can see, on the server that doesn’t fail, this is a onedir package.
Server WITH error:
As you can see, this is a legacy package for Ubuntu 20 (focal)… not 22 (jammy)
So… I updated my apt-source by following the install guide (https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/ubuntu.html#install-onedir-packages-of-salt-on-ubuntu-22-04-jammy) to update to a onedir package.
After running the following…
… no more error.
Moral of the story… Don’t forget to update third-party apt sources when doing a release upgrade. 😕
Confirmed that this is still a problem on Ubuntu 22.04 + Salt 3004.1. The patch in https://github.com/saltstack/salt/issues/59065#issuecomment-1118112165 fixes it. It would be great if this could be committed.
Seeing it in Ubuntu 22.04 pre-release, salt-minion 3004 (installed from
https://repo.saltproject.io/py3/ubuntu/20.04/amd64/latest focal InRelease:FYI for anyone finding this issue, looks like the problem was merely punted forward into Ubuntu 21.04 which includes Salt 3002.2. So the problem isn’t solved but more like postponed. Installing 3003.3 does not resolve the issue, but since the distribution includes 3002.2 that’s what I’ll list below.