saltstack / saltstack/salt

[BUG] wheel client executed from engine is giving Authentication failure when key.delete is used

Open
#61,402 4 comments 1 reaction 1 assignee View on GitHub

@krionbsd is already working on this.

Since Dec 28, 2021.

bug Regression severity-medium
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
I'm using wheel module in an engine to delete old minion keys, I see the keys are not deleted anymore so I decided to follow the documentation to see if I something was changed and I have to fix it, If I follow the description of how to use key.delete from python as shown here:
https://docs.saltproject.io/en/3003/ref/wheel/all/salt.wheel.key.html#module-salt.wheel.key

Every time I use it it looks ok giving me the expecting output

 $: wheel.cmd_async({'fun': 'key.delete', 'match': 'minion1'})
 {'tag': 'salt/wheel/20211228113345521724', 'jid': '20211228113345521724'} 

But the key is not deleted and I see this error message in the logs
salt-master[29647]: [WARNING ] Authentication failure of type "user" occurred.
This is exactly what is happening when the code is executed from the engine

Steps to Reproduce the behavior
from a Python interpreter ("same" code is in the engine)

import salt.wheel
wheel = salt.wheel.WheelClient(__opts__)
wheel.cmd_async({'fun': 'key.delete', 'match': 'minion1'})

Expected behavior
The minion key should be deleted

Versions Report

salt --versions-report
Salt Version:
          Salt: 3003.3
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: Not Installed
      dateutil: 2.6.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10
       libgit2: Not Installed
      M2Crypto: 0.38.0
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.20
      pycrypto: 2.6.1
  pycryptodome: 3.10.1
        pygit2: Not Installed
        Python: 3.8.0 (default, Feb 25 2021, 22:10:10)
  python-gnupg: 0.4.1
        PyYAML: 3.12
         PyZMQ: 22.2.1
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: ubuntu 18.04 bionic
        locale: utf-8
       machine: x86_64
       release: 5.4.0-65-generic
        system: Linux
       version: Ubuntu 18.04 bionic

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.