saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.19k stars 5.48k forks source link

[BUG][REGRESSION] external_auth over REST not working in 3007 #66451

Open Foorack opened 6 months ago

Foorack commented 6 months ago

Description The external REST auth stopped working after upgrade to 3007.

Worked in 3006.6. Broken in 3007.

Setup

Steps to Reproduce the behavior /etc/salt/master

external_auth:
  rest:
    ^url: http://localhost:8000/api/token

Expected behavior A clear and concise description of what you expected to happen.

Screenshots Running for trace purposes:

salt-master -l trace & salt-api -l trace

[INFO    ] [api_acl] Authentication not checked for user admin from IP 127.0.0.1
[DEBUG   ] Using selector: EpollSelector
[TRACE   ] ReqChannel send clear load={'eauth': 'rest', 'username': 'admin', 'password': 'password', 'cmd': 'mk_token'}
[TRACE   ] Clear payload received with command mk_token
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: master
[DEBUG   ] Requesting URL http://localhost:8000/api/token using POST method
[DEBUG   ] Using backend: tornado
[TRACE   ] Request POST Data: {'password': 'password', 'username': 'admin'}
[DEBUG   ] Using selector: EpollSelector
[DEBUG   ] Authentication module threw Cannot run the event loop while another loop is running
[WARNING ] Authentication failure of type "eauth" occurred.
[WARNING ] Authentication failure of type "eauth" occurred.
[DEBUG   ] Closing AsyncReqChannel instance

Versions Report

salt --versions-report ```yaml Salt Version: Salt: 3007.0 Python Version: Python: 3.10.13 (main, Feb 19 2024, 03:31:20) [GCC 11.2.0] Dependency Versions: cffi: 1.16.0 cherrypy: unknown dateutil: 2.8.2 docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed Jinja2: 3.1.3 libgit2: Not Installed looseversion: 1.3.0 M2Crypto: Not Installed Mako: Not Installed msgpack: 1.0.7 msgpack-pure: Not Installed mysql-python: Not Installed packaging: 23.1 pycparser: 2.21 pycrypto: Not Installed pycryptodome: 3.19.1 pygit2: Not Installed python-gnupg: 0.5.2 PyYAML: 6.0.1 PyZMQ: 25.1.2 relenv: 0.15.1 smmap: Not Installed timelib: 0.3.0 Tornado: 6.3.3 ZMQ: 4.3.4 Salt Package Information: Package Type: onedir System Versions: dist: ubuntu 22.04.4 jammy locale: utf-8 machine: x86_64 release: 6.5.0-27-generic system: Linux version: Ubuntu 22.04.4 jammy ```
Foorack commented 6 months ago

Possibly related to https://github.com/saltstack/salt/issues/66194 due to shared error message:

Cannot run the event loop while another loop is running

Akm0d commented 3 months ago

@Foorack I am unable to replicate the issue. Could you add details about the setup and commands to run for me to be able to reliably replicate the issue?