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 regression with version 3005 #62566

Closed
doc75 opened this issue Aug 29, 2022 · 11 comments
Closed

[BUG] pkgrepo regression with version 3005 #62566

doc75 opened this issue Aug 29, 2022 · 11 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior debian affects this operating system needs-triage package-repo Phosphorus v3005.0 Release code name and version Regression The issue is a bug that breaks functionality known to work in previous releases.

Comments

@doc75
Copy link

doc75 commented Aug 29, 2022

Description
Since my upgrade to 3005, all my pkgrepo formulas are failing with the following error message:

          ID: docker_repository
    Function: pkgrepo.managed
        Name: deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3/dist-packages/salt/state.py", line 2276, in call
                  ret = self.states[cdata["full"]](
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1228, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1243, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1276, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/states/pkgrepo.py", line 439, in managed
                  pre = __salt__["pkg.get_repo"](repo=repo, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1228, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1243, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/modules/aptpkg.py", line 1975, in get_repo
                  repos = list_repos()
                File "/usr/lib/python3/dist-packages/salt/modules/aptpkg.py", line 1921, in list_repos
                  signedby = _get_opts(line=source.line)["signedby"].get("value", "")
                File "/usr/lib/python3/dist-packages/salt/modules/aptpkg.py", line 1746, in _get_opts
                  ret[other_opt]["value"] = opt.split("=", 1)[1]
              IndexError: list index out of range
     Started: 22:08:54.037166
    Duration: 68.696 ms
     Changes:   

Setup
Formula for the state raising the above error:

docker_repository:
   pkgrepo.managed:
    - name: deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable
    - dist: focal
    - file: /etc/apt/sources.list.d/docker.list
    - key_url: https://download.docker.com/linux/ubuntu/gpg

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

Install on a standard machine (salt-master on a server, salt-minion on a laptop)

Steps to Reproduce the behavior

  • salt-master and salt-minion using version 3005

Expected behavior

pkgrepo.managed should work without error like in version 3004

Screenshots
N/A

Versions Report

salt --versions-report
Salt Version:
          Salt: 3005
 
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, Jun 22 2022, 20:18:18)
  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.4.0-110-generic
        system: Linux
       version: Ubuntu 20.04 focal

Additional context

reverting salt-minion to version 3004 and keeping the salt-master to version 3005 is solving the issue (without any formula modification)

@doc75 doc75 added Bug broken, incorrect, or confusing behavior needs-triage labels Aug 29, 2022
@OrangeDog OrangeDog added Regression The issue is a bug that breaks functionality known to work in previous releases. Phosphorus v3005.0 Release code name and version debian affects this operating system package-repo labels Aug 30, 2022
@Ch3LL
Copy link
Contributor

Ch3LL commented Aug 30, 2022

This is most likely a duplicate of #62474

@doc75
Copy link
Author

doc75 commented Aug 30, 2022

This is most likely a duplicate of #62474

I am not using cdrom pkgrepo, so do you mean that the problem is more generic than just cdrom ?

@doc75
Copy link
Author

doc75 commented Aug 30, 2022

@Ch3LL I confirm that the fix provided in PR #62475 is fixing the issue (just tested it only with the change of regexp at line 1727).
So this PR is fixing more general pkgrepo issues than just cdrom.

@Ch3LL Ch3LL self-assigned this Aug 30, 2022
@Ch3LL Ch3LL added this to the Phosphorus v3005.0 milestone Aug 30, 2022
@s0undt3ch
Copy link
Collaborator

So this PR is fixing more general pkgrepo issues than just cdrom.

Yes, it does fix more than Cdrom

@leventis
Copy link

Example for others needing a reliable way to downgrade a minion:

sudo apt remove salt-minion salt-common --yes
curl -o /tmp/bootstrap-salt.sh -L https://bootstrap.saltproject.io
chmod +x /tmp/bootstrap-salt.sh
/tmp/bootstrap-salt.sh stable 3004.1

See also: https://docs.saltproject.io/salt/install-guide/en/latest/topics/bootstrap.html#install-using-the-bootstrap-script

@Ch3LL
Copy link
Contributor

Ch3LL commented Aug 31, 2022

I added the changes to the freeze branch in this PR #62592 since we are going to get this into the 3005.1 release. I did not include the deprecation commit since we do not want to deprecate anything in a point release.

@jonathanschlue-as
Copy link

I added the changes to the freeze branch in this PR #62592 since we are going to get this into the 3005.1 release. I did not include the deprecation commit since we do not want to deprecate anything in a point release.

@Ch3LL Is there already a planned release date for 3005.1?

@Ch3LL
Copy link
Contributor

Ch3LL commented Sep 2, 2022

yes, we are working on it right now.

EDIT: apologies, i re-read your comment. We do not have a firm date as there are still issues being submitted against 3005 that need to be fixed. But we are targeting late September/early October right now.

@koenr
Copy link

koenr commented Sep 2, 2022

Wow - this is major. We just rolled out 400 laptops and no extra repo's are installed. Please consider to make the point release earlier.

@koenr
Copy link

koenr commented Sep 4, 2022

Since downgrading my devices was not an option, my workaround is the following:

Get the gpg keys for every repo, using something like:

"curl -fsSL -o /usr/share/keyrings/salt-archive-keyring.gpg https://repo.saltproject.io/salt/py3/ubuntu/22.04/amd64/latest/salt-archive-keyring.gpg":
  cmd.run:
    - creates: /usr/share/keyrings/salt-archive-keyring.gpg

Create a key file for every repo, e.g. salt.list containing
deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=amd64] https://repo.saltproject.io/salt/py3/ubuntu/22.04/amd64/latest jammy main
Distribute the list files:

saltstack-repo:
  file.managed:
    - names:
      - /etc/apt/sources.list.d/salt.list:
        - source: salt://software/repos_jammy/salt.list

For organisations that distribute something else then a gpg-file, e.g. Google, I found following command to work to get the key working:

"curl -sS https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/linux_signing_key.gpg":
  cmd.run

In the software installation states I had

- require:
  - pkgrepo: reponame

which I commented out for the time being.

@Ch3LL
Copy link
Contributor

Ch3LL commented Sep 6, 2022

closed by #62592

@Ch3LL Ch3LL closed this as completed Sep 6, 2022
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 needs-triage package-repo Phosphorus v3005.0 Release code name and version Regression The issue is a bug that breaks functionality known to work in previous releases.
Projects
None yet
Development

No branches or pull requests

7 participants