salt icon indicating copy to clipboard operation
salt copied to clipboard

14.04 / salt '*' test.ping Failed to authenticate, is this user permitted to execute commands?

Open kiorky opened this issue 12 years ago • 135 comments

Since my upgrade to 14.04 and sync of @makinacorpus fork to last develop, something is weird.

I get intermittent total unfunctionnality of the saltmaster , on a period of 1 at 2 minutes, i cant ping any minion, and the next 2 minutes ping is working, and 2 minutes after this does not work.

 mastersalt '*' test.ping
Failed to authenticate, is this user permitted to execute commands?

I rebuilded all the eggs locally installed to be sure of the linking, but this seems not to be sufficient.

Ill check tomorow to double check if this is one of our maintainance crons, but i would suspect yet another regression.

kiorky avatar Apr 24 '14 00:04 kiorky

This morning everything is operating correctly, i prefer to let this bug open at the moment, but for now, it seems more of an installation temporary problem as during this upgrade:

  • DNS changed
  • IP changed
  • OS changed
  • Salt was upgraded

I so also suspect a dns propagation / ip routing propragation problem...

So this may be just a false positive bug and more a big PEBCAK :)

/cc @regilero

kiorky avatar Apr 24 '14 07:04 kiorky

Please tell us again if have new ideas what might caused your problems. I also discovered your described behaviour in my setup (Debian 7, Packages from Salt-Repo), but sometimes it works a whole week without any problems

phaf avatar Apr 24 '14 08:04 phaf

#12246

excavador avatar Apr 24 '14 08:04 excavador

We'll leave this open for now, but if it doesn't pop up, let's close it in a few days.

basepi avatar Apr 24 '14 22:04 basepi

Also, unless I'm missing something 14.04 is not a valid salt version. Or it's very very old if it's from the 0.14 release. Did you mean 2014.1.3?

basepi avatar Apr 24 '14 22:04 basepi

@basepi, ubuntu 14.04 ;)

kiorky avatar Apr 24 '14 23:04 kiorky

i mentionned that i used last salt/develop tip yesterday... so f43dfd54780da7401cc8da19e40abe4a45d4f440

kiorky avatar Apr 24 '14 23:04 kiorky

@kiorky Wow, that makes wayyyyy more sense. Thanks.

basepi avatar Apr 25 '14 16:04 basepi

@kiorky We were going to wait and see if you saw this again. Is this safe to close now?

cachedout avatar Jun 04 '14 20:06 cachedout

@cachedout I'm seeing this on Trusty 14.04 with Salt 2014.1.4 as well.

Everything works fine on the first box (using VirtualBox), but when I test the box I have packaged from this VM, I see the same error after running salt '*' state.clear_cache; salt-call -l debug state.highstate;. What is interesting is that if I try the highstate command a couple minutes later I do not see the error.

Let me know if there is any information that I can provide to help debug this.

ifnull avatar Jun 09 '14 22:06 ifnull

@ifnull Thanks for letting us know. We'll keep this open and try to figure out what's going on here.

cachedout avatar Jun 09 '14 22:06 cachedout

Possibly related: https://groups.google.com/forum/#!topic/salt-users/G4PSRZZSwBM

ifnull avatar Jun 09 '14 22:06 ifnull

I am having the same problem mentioned here.

danielfrg avatar Jun 16 '14 15:06 danielfrg

Looks like it is failing here: https://github.com/saltstack/salt/blob/develop/salt/client/init.py#L212

There was a recent commit that mentions that there are other reasons for failure here besides authentication: https://github.com/saltstack/salt/commit/4ba20946ae4ad061e6851d2868ddf734ef94e45c

I was able to reduce the problem to the following command.

import salt.client
client = salt.client.LocalClient()
client.cmd(tgt='*', fun='state.highstate', arg=[], timeout=5, expr_form='glob', ret='')

In this example, pub_data returns nothing.

root@vagrant:/var/www# salt --versions-report
           Salt: 2014.1.4
         Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
 msgpack-python: 0.3.0
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.10
          PyZMQ: 14.0.1
            ZMQ: 4.0.4

ifnull avatar Jun 16 '14 22:06 ifnull

@cachedout @basepi From what I can tell, the problem occurs in the following lines of code. payload appears to be set to an empty string which causes pub() to return an empty string and subsequently fail the _check_pub_data check.

https://github.com/saltstack/salt/blob/develop/salt/client/init.py#L1366-L1371

Payload is unpredictably being set to an empty string:

(Pdb++) payload = sreq.send(payload_kwargs)  
(Pdb++) print payload

(Pdb++) payload = sreq.send(payload_kwargs)  
(Pdb++) payload = sreq.send(payload_kwargs)
(Pdb++) print payload
{'load': {'jid': '20140617011356196301', 'minions': ['minion']}, 'enc': 'clear'}
(Pdb++) payload = sreq.send(payload_kwargs)
(Pdb++) print payload
{'load': {'jid': '20140617011421541371', 'minions': ['minion']}, 'enc': 'clear'}
(Pdb++) payload = sreq.send(payload_kwargs)
(Pdb++) print payload
{'load': {'jid': '20140617011424300494', 'minions': ['minion']}, 'enc': 'clear'}
(Pdb++) payload = sreq.send(payload_kwargs)
(Pdb++) print payload

(Pdb++) payload = sreq.send(payload_kwargs)
(Pdb++) print payload
{'load': {'jid': '20140617011433539494', 'minions': ['minion']}, 'enc': 'clear'}
(Pdb++) payload = sreq.send(payload_kwargs)
(Pdb++) print payload
{'load': {'jid': '20140617011437036333', 'minions': ['minion']}, 'enc': 'clear'}
(Pdb++) payload = sreq.send(payload_kwargs)
(Pdb++) print payload
{'load': {'jid': '20140617011441100207', 'minions': ['minion']}, 'enc': 'clear'}
(Pdb++) payload = sreq.send(payload_kwargs)
(Pdb++) print payload

(Pdb++) 

ifnull avatar Jun 17 '14 00:06 ifnull

Very strange, thanks for the updates!

basepi avatar Jun 17 '14 19:06 basepi

I no longer believe this is related to ZeroMQ 4. I downgraded to ZeroMQ 3 and had the same result.

Uninstall ZMQ

cd /tmp
apt-get remove libzmq3 libzmq3-dev -y
pip uninstall pyzmq -y

Install ZMQ 3

wget http://download.zeromq.org/zeromq-3.2.4.tar.gz
tar xvzf zeromq-3.2.4.tar.gz
cd ./zeromq-3.2.4
./configure
make
make install
ldconfig
pip install pyzmq --install-option="--zmq=/usr/local/"
cd ../
rm -fR ./zeromq-3*

Confirm

salt --versions-report
           Salt: 2014.1.4
         Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
 msgpack-python: 0.3.0
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.10
          PyZMQ: 14.3.1
            ZMQ: 3.2.4

Notes

  • libzmq3 installed via apt is actually ZMQ 4.0.4
  • If you do not build ZMQ from source, pyzmq will try to build ZMQ itself.
  • easy_install will use the egg which does not contain ZMQ 3

References

  • https://github.com/zeromq/pyzmq/wiki/Building-and-Installing-PyZMQ
  • https://github.com/zeromq/pyzmq/issues/193
  • http://zeromq.org/bindings:python
  • https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh
  • http://zeromq.org/intro:get-the-software
  • https://github.com/zeromq/libzmq
  • https://github.com/saltstack/salt/blob/develop/salt/master.py
  • https://github.com/saltstack/salt/blob/develop/salt/transport/init.py
  • https://github.com/saltstack/salt/blob/develop/salt/crypt.py
  • https://github.com/saltstack/salt/blob/develop/salt/client/init.py#L1366-L1371

ifnull avatar Jun 18 '14 00:06 ifnull

I am not encountering this error on the following Ubuntu 14.04 configuration inside an LXC:

           Salt: 2014.1.3
         Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
 msgpack-python: 0.3.0
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.10
          PyZMQ: 14.0.1
            ZMQ: 4.0.4

gravyboat avatar Jun 18 '14 00:06 gravyboat

Just tried with 2014.1.3 and I'm still seeing the issue. It may be worth noting that I am using GitFS. I'm going to run a couple tests with GitFS excluded.

ifnull avatar Jun 18 '14 17:06 ifnull

@thatch45 made a commit (4ba20946ae4ad061e6851d2868ddf734ef94e45c) that indicates this may be related to inode usage. Maybe he could shed some light here.

ifnull avatar Jun 18 '14 19:06 ifnull