[BUG] salt-api 401 Unauthorized #65593
Labels
Bug
broken, incorrect, or confusing behavior
needs-triage
Regression
The issue is a bug that breaks functionality known to work in previous releases.
Salt-API
Description
Since upgrading two of our Saltstack environments we seem to face a bug of the salt-api that refuses any requests.
The problem occurs on both systems, although I am only giving details of one environment so far. But both are pretty similar.
The API worked like expected before.
As you can see I am running the OneDir version 3006.4 as root. Previously we were running version 3006.3 and had a lot of problems with the NonceVerificationError
The login function works well and returns a token and also shows the right permissions.
curl -k http://salt:8080/login -H "Accept:application/json" -H "Content-type:application/json" -d '{"username":"tux", "password":"areallystrongpassword", "eauth":"pam"}' {"return": [{"token": "areallysecuretoken", "expire": 1700522599.8706264, "start": 1700479399.8706262, "user": "tux", "eauth": "pam", "perms": [".*", "@jobs", "@runner", "@wheel"]}]}
But the following request fails.
curl -k http://salt:8080/ -H "Content-type:application/json" -H "X-Auth-Token:areallysecuretoken" -d '[{"client":"wheel","fun":"key.list"}]'
No matter what fun and client I use and also when using "eauth=pam" with the same credentials. The result is always the same:
Here's what's in the log:
Seems to me like somehow the master is the problem here that refuses the login.
On the CLI the user is able to run the commands:
Hopefully I am not wasting your time with a pretty stupid layer 8 problem.
Thanks a lot!
ADDITION:
I am still looking for a solution and found out a few additional things:
curl -sS http://$SALTAPI/hook/$CI_PROJECT_NAME/commit -H "Content-type:application/json" -H "X-Auth-Token:$TOKEN" -d '{"user-mail":"$GITLAB_USER_EMAIL", "user-name":"$GITLAB_USER_NAME"}' | grep success
curl http://salt02:8080/run -H 'Accept: application/x-yaml' -d username=tux -d password=securepassword -d eauth=pam -d client=local -d tgt='*' -d fun=test.ping
So, right now it looks to me like there is a problem with all the requests on the root path of the webserver.
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.
salt-api config:
Master Config:
Here are some more logs of the master on'debug' level:
Steps to Reproduce the behavior
Expected behavior
Please just do what I want :)
Screenshots
Versions Report
salt --versions-report
Salt Version: Salt: 3006.4Python Version:
Python: 3.10.13 (main, Oct 4 2023, 21:54:22) [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: 1.7.1
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: 1.13.1
python-gnupg: 0.4.8
PyYAML: 6.0.1
PyZMQ: 23.2.0
relenv: 0.13.12
smmap: Not Installed
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: ubuntu 22.04.3 jammy
locale: utf-8
machine: x86_64
release: 5.15.0-88-generic
system: Linux
version: Ubuntu 22.04.3 jammy
Additional context
The text was updated successfully, but these errors were encountered: