saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.11k stars 5.47k forks source link

[BUG] KeyError: 'transactional_update.apply' #64717

Open matwey opened 1 year ago

matwey commented 1 year ago

Description

I am running openSUSE microOS 20230725 with

salt-minion-3006.0-1.4.aarch64
salt-transactional-update-3006.0-1.4.aarch64

When I do (as I learned from the documentation)

salt-call --file-root /root/my-salt --module-executors='[transactional_update]' --local state.apply

I see the following issue

/usr/lib/python3.11/site-packages/salt/utils/http.py:8: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  import cgi
/usr/lib/python3.11/site-packages/salt/utils/jinja.py:9: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
  import pipes
/usr/lib/python3.11/site-packages/salt/grains/core.py:2711: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
  ) = locale.getdefaultlocale()
/usr/lib/python3.11/site-packages/salt/utils/pycrypto.py:26: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
  import crypt
/usr/lib/python3.11/site-packages/salt/modules/linux_shadow.py:21: DeprecationWarning: 'spwd' is deprecated and slated for removal in Python 3.13
  import spwd
[ERROR   ] An un-handled exception was caught by Salt's global exception handler:
KeyError: 'transactional_update.apply'
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 10, in <module>
    salt_call()
  File "/usr/lib/python3.11/site-packages/salt/scripts.py", line 444, in salt_call
    client.run()
  File "/usr/lib/python3.11/site-packages/salt/cli/call.py", line 50, in run
    caller.run()
  File "/usr/lib/python3.11/site-packages/salt/cli/caller.py", line 95, in run
    ret = self.call()
          ^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/cli/caller.py", line 202, in call
    ret["return"] = self.minion.executors[fname](
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/lazy.py", line 1234, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/lazy.py", line 1249, in _run_as
    return _func_or_method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/executors/transactional_update.py", line 123, in execute
    opts, data, __salt__[DELEGATION_MAP[fun]], args, kwargs
                ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/context.py", line 78, in __getitem__
    return self.value()[item]
           ~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/lazy.py", line 336, in __getitem__
    super().__getitem__(item)  # try to get the item from the dictionary
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/utils/lazy.py", line 105, in __getitem__
    raise KeyError(key)
KeyError: 'transactional_update.apply'
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 10, in <module>
    salt_call()
  File "/usr/lib/python3.11/site-packages/salt/scripts.py", line 444, in salt_call
    client.run()
  File "/usr/lib/python3.11/site-packages/salt/cli/call.py", line 50, in run
    caller.run()
  File "/usr/lib/python3.11/site-packages/salt/cli/caller.py", line 95, in run
    ret = self.call()
          ^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/cli/caller.py", line 202, in call
    ret["return"] = self.minion.executors[fname](
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/lazy.py", line 1234, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/lazy.py", line 1249, in _run_as
    return _func_or_method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/executors/transactional_update.py", line 123, in execute
    opts, data, __salt__[DELEGATION_MAP[fun]], args, kwargs
                ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/context.py", line 78, in __getitem__
    return self.value()[item]
           ~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/loader/lazy.py", line 336, in __getitem__
    super().__getitem__(item)  # try to get the item from the dictionary
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/utils/lazy.py", line 105, in __getitem__
    raise KeyError(key)
KeyError: 'transactional_update.apply'

Setup (Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)

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

Steps to Reproduce the behavior Install openSUSE MicroOS and run the following command:

salt-call --file-root /root/my-salt --module-executors='[transactional_update]' --local state.apply

Expected behavior salt-call will apply the state

Versions Report

Salt Version:
          Salt: 3006.0

Python Version:
        Python: 3.11.4 (main, Jun 28 2023, 19:51:46) [GCC]

Dependency Versions:
          cffi: 1.15.1
      cherrypy: Not Installed
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.1.2
      M2Crypto: 0.39.0
          Mako: Not Installed
       msgpack: 1.0.5
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.1
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: Not Installed
  python-gnupg: Not Installed
        PyYAML: 6.0
         PyZMQ: 25.0.2
        relenv: Not Installed
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: opensuse-microos 20230725
        locale: utf-8
       machine: aarch64
       release: 6.4.4-1-default
        system: Linux
       version: openSUSE MicroOS 20230725
matwey commented 1 year ago

64369 can possibly be related to this issue

OrangeDog commented 1 year ago

Executors indeed don't have an apply function, they have an execute function. Not sure what's going on there.