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] got multiple values for keyword argument 'saltenv' #64118

Closed
9 tasks
nvmdd opened this issue Apr 20, 2023 · 8 comments · Fixed by #64179
Closed
9 tasks

[BUG] got multiple values for keyword argument 'saltenv' #64118

nvmdd opened this issue Apr 20, 2023 · 8 comments · Fixed by #64179
Assignees
Labels
Bug broken, incorrect, or confusing behavior Loader needs-triage Regression The issue is a bug that breaks functionality known to work in previous releases.

Comments

@nvmdd
Copy link

nvmdd commented Apr 20, 2023

Description
Getting error TypeError: salt.loaded.int.module.cp.cache_file() got multiple values for keyword argument 'saltenv'
when trying to install an rpm from an outside source using pkgs.installed state.

Setup
master and minion both are Rocky 9 on 3006.0

SLS:

pg_repository:
  pkg.installed:
    - sources:
      - pgdg-redhat-repo: https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Getting error:

      ID: pg_repository
Function: pkg.installed
  Result: False
 Comment: An exception occurred in this state: Traceback (most recent call last):
            File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/state.py", line 2385, in call
              ret = self.states[cdata["full"]](
            File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 149, in __call__
              return self.loader.run(run_func, *args, **kwargs)
            File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1232, in run
              return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
            File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1247, in _run_as
              return _func_or_method(*args, **kwargs)
            File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1280, in wrapper
              return f(*args, **kwargs)
            File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pkg.py", line 1701, in installed
              result = _find_install_targets(
            File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pkg.py", line 762, in _find_install_targets
              cached_path = __salt__["cp.cache_file"](
          TypeError: salt.loaded.int.module.cp.cache_file() got multiple values for keyword argument 'saltenv'

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
Try to install package from outside source.

Versions Report
Salt Version:
Salt: 3006.0

Python Version:
Python: 3.10.11 (main, Apr 14 2023, 05:57:16) [GCC 11.2.0]

Dependency Versions:
cffi: 1.14.6
cherrypy: unknown
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.11.2
smmap: Not Installed
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.4

System Versions:
dist: rocky 9.1 Blue Onyx
locale: utf-8
machine: x86_64
release: 5.14.0-162.23.1.el9_1.x86_64
system: Linux
version: Rocky Linux 9.1 Blue Onyx

Additional context
I also get the same issue with local files like:

pgdg-redhat-repo:
  pkg.installed:
    - enable: True
    - sources:
      - pgdg-redhat-repo: salt:///test/pgdg-redhat-repo-latest.noarch.rpm
@nvmdd nvmdd added Bug broken, incorrect, or confusing behavior needs-triage labels Apr 20, 2023
@welcome
Copy link

welcome bot commented Apr 20, 2023

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@OrangeDog
Copy link
Contributor

OrangeDog commented Apr 20, 2023

Is this an upgrade from an older salt version? Did it work previously?
Have you got any custom modules configured or synced?

@OrangeDog OrangeDog added Loader info-needed waiting for more info labels Apr 20, 2023
@nvmdd
Copy link
Author

nvmdd commented Apr 20, 2023

I was on salt 3005.1 previously and it worked fine before the upgrade to 3006.
I do have custom modules also. I removed the modules but it didn't change the result.

@OrangeDog OrangeDog added Regression The issue is a bug that breaks functionality known to work in previous releases. and removed info-needed waiting for more info labels Apr 20, 2023
@OrangeDog OrangeDog added this to the Sulfur v3006.1 milestone Apr 20, 2023
@nvmdd
Copy link
Author

nvmdd commented Apr 20, 2023

Likely related to this?
#64110

@vps-eric
Copy link
Contributor

Same issue. Almalinux 8.7 on 3006.0, clean install, was working on 3004.2 and 3005.1 classic, Python3.7. Tested with Vagrant + QEMU.

@DaAwesomeP
Copy link
Contributor

Accidentally opened duplicate #64157.

Same issue on Debian 11 amd64 with the following config:

mystate:
  pkg.installed:
    - sources:
      - libmypkg1: 'salt:/path/to/libmypkg1_0.1.0-1_amd64.deb'
      - mypkg: 'salt://path/to/mypkg_0.1.0-1_amd64.deb'

@dwoz dwoz self-assigned this Apr 25, 2023
@anilsil anilsil assigned s0undt3ch and unassigned dwoz Apr 26, 2023
s0undt3ch added a commit to s0undt3ch/salt that referenced this issue Apr 27, 2023
@s0undt3ch s0undt3ch linked a pull request Apr 27, 2023 that will close this issue
s0undt3ch added a commit to s0undt3ch/salt that referenced this issue Apr 27, 2023
garethgreenaway pushed a commit that referenced this issue Apr 28, 2023
Signed-off-by: Pedro Algarvio <[email protected]>
@Adam-Zvolanek
Copy link

Adam-Zvolanek commented Apr 28, 2023

Same issue running Amazon Linux 2, determined this is a minion issue. Salt-master running 3005.1 and minion 3006 and still shows issue.

# Install of DrawIO

install_drawio:
  pkg.installed:
     - name: draw.io
     - sources:
       - draw.io: <Location>*.rpm
     - user: ...
     - group: ...

@s0undt3ch
Copy link
Collaborator

Fixed in #64179

meaksh pushed a commit to openSUSE/salt that referenced this issue Jul 18, 2023
meaksh added a commit to openSUSE/salt that referenced this issue Aug 3, 2023
…212844) (#590)

* fix passing wrong keyword arguments to cp.cache_file in pkg.installed with sources

* Drop `**kwargs` usage and be explicit about the supported keyword arguments.

Signed-off-by: Pedro Algarvio <[email protected]>

* Add regression test for saltstack/salt#64118

Signed-off-by: Pedro Algarvio <[email protected]>

* Add changelog file

Signed-off-by: Pedro Algarvio <[email protected]>

---------

Signed-off-by: Pedro Algarvio <[email protected]>
Co-authored-by: Massimiliano Torromeo <[email protected]>
Co-authored-by: Pedro Algarvio <[email protected]>
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 Loader needs-triage Regression The issue is a bug that breaks functionality known to work in previous releases.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants