FAQ
Hey,
I have a strange issue with salt-api screaming for *401 Unauthorised* constantly
when running any operation after login for the first time, then the second
time (right after) will success with the same token.

Example:
# curl -i -k localhost:8000/login -H "Accept: application/json" -d
username='<user>' -d password='<password>' -d eauth='pam'
*Success!!!*
# curl -i localhost:8000/keys -H "X-Auth-Token:
1ce57dc24fdb817e3caa027d64c43dc47c665df4" -H "Accept: application/json"
...
</head>
     <body>
         <h2>*401 Unauthorized*</h2>
         <p>No permission -- see authorization schemes</p>
         <pre id="traceback">Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670,
in respond
     response.body = self.handler()
   File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line
217, in __call__
     self.body = self.oldhandler(*args, **kwargs)
   File "/usr/lib/python2.7/site-packages/salt/netapi/rest_cherrypy/app.py",
line 352, in hypermedia_handler
     raise cherrypy.HTTPError(401)
HTTPError: (401, None)
...

# curl -i localhost:8000/keys -H "X-Auth-Token:
1ce57dc24fdb817e3caa027d64c43dc47c665df4" -H "Accept: application/json"
*Success!!!*

My external_auth configurations are:
external_auth:
   pam:
     <user>:
       - .*
       - '@wheel'
       - '@runner'
       - '@jobs



Any idea?

Thanks avi,

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Seth House at Jan 31, 2015 at 8:29 pm
    Avi, sorry for the slow reply.

    I would recommend doing a full stop of both the salt-master and
    salt-api, make sure both are actually stopped (takes a second
    sometimes) using `pgrep -l salt` and then start both once again. It
    sounds almost like there's a conflict between two running processes.

    If you still see the behavior after that, what version are you running
    (salt and salt-api). Did you upgrade or is it a fresh install?
    On Fri, Jan 23, 2015 at 5:10 PM, Avi Tal wrote:
    Hey,
    I have a strange issue with salt-api screaming for 401 Unauthorised
    constantly when running any operation after login for the first time, then
    the second time (right after) will success with the same token.

    Example:
    # curl -i -k localhost:8000/login -H "Accept: application/json" -d
    username='<user>' -d password='<password>' -d eauth='pam'
    Success!!!
    # curl -i localhost:8000/keys -H "X-Auth-Token:
    1ce57dc24fdb817e3caa027d64c43dc47c665df4" -H "Accept: application/json"
    ...
    </head>
    <body>
    <h2>401 Unauthorized</h2>
    <p>No permission -- see authorization schemes</p>
    <pre id="traceback">Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670,
    in respond
    response.body = self.handler()
    File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line
    217, in __call__
    self.body = self.oldhandler(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/salt/netapi/rest_cherrypy/app.py",
    line 352, in hypermedia_handler
    raise cherrypy.HTTPError(401)
    HTTPError: (401, None)
    ...

    # curl -i localhost:8000/keys -H "X-Auth-Token:
    1ce57dc24fdb817e3caa027d64c43dc47c665df4" -H "Accept: application/json"
    Success!!!

    My external_auth configurations are:
    external_auth:
    pam:
    <user>:
    - .*
    - '@wheel'
    - '@runner'
    - '@jobs



    Any idea?

    Thanks avi,

    --
    You received this message because you are subscribed to the Google Groups
    "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedJan 24, '15 at 12:10a
activeJan 31, '15 at 8:29p
posts2
users2

2 users in discussion

Avi Tal: 1 post Seth House: 1 post

People

Translate

site design / logo © 2022 Grokbase