salt icon indicating copy to clipboard operation
salt copied to clipboard

Salt minion hangs when attempting to connect to master

Open dlindquist opened this issue 13 years ago • 11 comments

Other minions are connecting fine, but this particular minion hangs when trying to connect to the master. Any ideas on how to debug further? Grabbed a traceback from a ctrl+c by removing the normal exception catching for the salt-call CLI.

salt-minion --versions-report

       Salt: 0.13.1
     Python: 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)
     Jinja2: 2.2.1
   M2Crypto: 0.20.2

msgpack-python: 0.1.9.final msgpack-pure: not installed pycrypto: 2.0.1 PyYAML: 3.10 PyZMQ: 2.2.0.1

cat /etc/issue

CentOS release 6.4 (Final) Kernel \r on an \m

salt-call -l debug test.ping

[INFO ] Loaded configuration file: /etc/salt/minion [DEBUG ] loading grain in ['/var/cache/salt/minion/extmods/grains', '/usr/lib/python2.6/site-packages/salt/grains'] [DEBUG ] Skipping /var/cache/salt/minion/extmods/grains, it is not a directory [DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem Traceback (most recent call last): File "/usr/bin/salt-call", line 11, in salt_call() File "/usr/lib/python2.6/site-packages/salt/scripts.py", line 75, in salt_call client.run() File "/usr/lib/python2.6/site-packages/salt/cli/init.py", line 241, in run caller = salt.cli.caller.Caller(self.config) File "/usr/lib/python2.6/site-packages/salt/cli/caller.py", line 43, in init self.minion = salt.minion.SMinion(opts) File "/usr/lib/python2.6/site-packages/salt/minion.py", line 158, in init self.gen_modules() File "/usr/lib/python2.6/site-packages/salt/minion.py", line 168, in gen_modules self.opts['environment'], File "/usr/lib/python2.6/site-packages/salt/pillar/init.py", line 28, in get_pillar }.get(opts['file_client'], Pillar)(opts, grains, id_, env) File "/usr/lib/python2.6/site-packages/salt/pillar/init.py", line 42, in init self.auth = salt.crypt.SAuth(opts) File "/usr/lib/python2.6/site-packages/salt/crypt.py", line 369, in init self.crypticle = self.authenticate() File "/usr/lib/python2.6/site-packages/salt/crypt.py", line 379, in __authenticate creds = self.sign_in() File "/usr/lib/python2.6/site-packages/salt/crypt.py", line 228, in sign_in payload = sreq.send_auto(self.minion_sign_in_payload()) File "/usr/lib/python2.6/site-packages/salt/payload.py", line 171, in send_auto return self.send(enc, load) File "/usr/lib/python2.6/site-packages/salt/payload.py", line 153, in send polled = self.poller.poll(timeout * 1000) File "/usr/lib64/python2.6/site-packages/zmq/core/poll.py", line 107, in poll return _poll(list(self.sockets.items()), timeout=timeout) File "_poll.pyx", line 100, in zmq.core._poll._poll (zmq/core/_poll.c:1330) File "error.pyx", line 99, in zmq.core.error.ZMQError.__init (zmq/core/error.c:1081) KeyboardInterrupt

dlindquist avatar Mar 22 '13 08:03 dlindquist

Can you telnet to the master's TCP port from that minion's machine ?

minaguib avatar Apr 01 '13 20:04 minaguib

We had a patch in 0.13.1 in the zmq ipv6 support that broke some connections in very obscure places, upgrading might fix it

thatch45 avatar Apr 02 '13 15:04 thatch45

Yes, I've verified that the minion can telnet to the master's TCP ports.

I also experienced an issue where a bunch of minions were unable to connect. Restarting the master restored connectivity. Same traceback through salt:

[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[INFO    ] Waiting for minion key to be accepted by the master.
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[INFO    ] Waiting for minion key to be accepted by the master.
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
^CTraceback (most recent call last):
  File "/usr/bin/salt-minion", line 14, in <module>
    salt_minion()
  File "/usr/lib/pymodules/python2.7/salt/scripts.py", line 29, in salt_minion
    minion.start()
  File "/usr/lib/pymodules/python2.7/salt/__init__.py", line 186, in start
    self.prepare()
  File "/usr/lib/pymodules/python2.7/salt/__init__.py", line 173, in prepare
    self.minion = salt.minion.Minion(self.config)
  File "/usr/lib/pymodules/python2.7/salt/minion.py", line 234, in __init__
    self.authenticate()
  File "/usr/lib/pymodules/python2.7/salt/minion.py", line 603, in authenticate
    creds = auth.sign_in()
  File "/usr/lib/pymodules/python2.7/salt/crypt.py", line 228, in sign_in
    payload = sreq.send_auto(self.minion_sign_in_payload())
  File "/usr/lib/pymodules/python2.7/salt/payload.py", line 171, in send_auto
    return self.send(enc, load)
  File "/usr/lib/pymodules/python2.7/salt/payload.py", line 153, in send
    polled = self.poller.poll(timeout * 1000)  File "poll.pyx", line 189, in zmq.core.poll.Poller.poll (zmq/core/poll.c:2189)
  File "poll.pyx", line 101, in zmq.core.poll._poll (zmq/core/poll.c:1440)
  File "error.pyx", line 92, in zmq.core.error.ZMQError.__init__ (zmq/core/error.c:936)

Planning on upgrading to 0.15 when it arrives...

dlindquist avatar Apr 03 '13 22:04 dlindquist

Yes, this looks VERY much like the zeromq ipv6 issues we saw in 0.13, I will have 0.14.1 out soon which fixes the few major bugs in 0.14.0, 0.14.0 should solve this problem (It has in every case we could reproduce this)

thatch45 avatar Apr 03 '13 22:04 thatch45

Excellent, thanks!

dlindquist avatar Apr 03 '13 22:04 dlindquist

This is still happening as of 0.15.3. Just happened to me. The only way I could recover is restarting the Salt master.

ManuelAmadorAditazz avatar Aug 01 '13 21:08 ManuelAmadorAditazz

@ManuelAmadorAditazz are you using IPv6? And what version of ZeroMQ?

basepi avatar Aug 05 '13 22:08 basepi

No IPv6. I will get back to you on the IPv6 version, but just basically the Salt PPA for 1204. On Aug 5, 2013 6:08 PM, "Colton Myers" [email protected] wrote:

@ManuelAmadorAditazz https://github.com/ManuelAmadorAditazz are you using IPv6? And what version of ZeroMQ?

— Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/4199#issuecomment-22144744 .

ManuelAmadorAditazz avatar Aug 05 '13 22:08 ManuelAmadorAditazz

Use salt --versions-report on the master and salt-call --versions-report on the minion. You can just paste all the version info.

basepi avatar Aug 05 '13 22:08 basepi

This is still happening on stock Ubuntu 12.04, a 1 minute cron job from master that pings all the minions makes everything rock solid for me:

       Salt: 0.17.5
     Python: 2.7.3 (default, Sep 26 2013, 20:03:06)
     Jinja2: 2.6
   M2Crypto: 0.21.1

msgpack-python: 0.1.10 msgpack-pure: Not Installed pycrypto: 2.4.1 PyYAML: 3.10 PyZMQ: 13.0.0 ZMQ: 3.2.2

namliz avatar Mar 02 '14 16:03 namliz

I met the problem too. many minions works well, only one hangs, and minion hog cpu to 100%

After starting the salt minion, it auto scheduled mine.update, and the cpu went 100% I can avoid this by tuning multiprocessing to false, and everything works fine.

I straced minion, it was busy epoll_wait, which returned 1. " SaltReqTimeoutError: Waited 60 seconds" was logged, I thought it was throwed from sign_in

Tried publish command from the master, minion did excute the job, but nothing returned to master. tcpdump the 4506 port returns nothing

master and minion has the same version: Salt: 0.17.5 Python: 2.7.2 (default, Dec 26 2013, 13:19:58) Jinja2: 2.7.2 M2Crypto: 0.22 msgpack-python: 0.4.0 msgpack-pure: Not Installed pycrypto: 2.6.1 PyYAML: 3.10 PyZMQ: 14.0.1 ZMQ: 4.0.3

ultraice avatar Mar 14 '14 07:03 ultraice