salt icon indicating copy to clipboard operation
salt copied to clipboard

minion fails to connect to master

Open netllama opened this issue 13 years ago • 108 comments

I have a RHEL6 minion running 0.15.3, which used to work fine, but at some point seems to have stopped responding to the master (which is also running 0.15). Any command (test.ping) that I attempt to run against this minion eventually fails with "Minion failed to return".

I tried starting up the minion in debug mode, but that didn't explain much to me:

#############
# /usr/bin/python /usr/bin/salt-minion -d -c /etc/salt -l debug
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Guessing ID. The id can be explicitly in set /etc/salt/minion
[INFO    ] Found minion id from getfqdn(): cuda-linux-gputest10
[INFO    ] Configuration file path: /etc/salt/minion
# tail -f /var/log/salt/minion
2013-06-17 15:47:26,440 [salt             ][INFO    ] Setting up the
Salt Minion "cuda-linux-gputest10"
2013-06-17 15:47:26,445 [salt.utils.process    ][DEBUG   ] Created
pidfile: /var/run/salt-minion.pid
2013-06-17 15:47:26,446 [salt.utils.process    ][DEBUG   ] Chowned
pidfile: /var/run/salt-minion.pid to user: root
2013-06-17 15:47:26,446 [salt.config           ][DEBUG   ] Reading
configuration from /etc/salt/minion
2013-06-17 15:47:26,493 [salt.loader           ][DEBUG   ] loading
grain in ['/var/cache/salt/minion/extmods/grains',
'/usr/lib/python2.6/site-packages/salt/grains']
2013-06-17 15:47:26,493 [salt.loader           ][DEBUG   ] Skipping
/var/cache/salt/minion/extmods/grains, it is not a directory
2013-06-17 15:47:26,551 [salt.minion           ][DEBUG   ] Attempting
to authenticate with the Salt Master at 10.31.96.152
2013-06-17 15:47:26,553 [salt.crypt            ][DEBUG   ] Loaded
minion key: /etc/salt/pki/minion/minion.pem
############

The only uncommented line in /etc/salt/minion is:

master: cuda-fs1

which is the correct hostname of the master, and the same as a few hundred other minions.

I looked at the master's salt log, but it has no references to this minion at all.

On the master,

salt --versions-report:
           Salt: 0.15.1
         Python: 2.7.3 (default, Jul 24 2012, 10:05:38)
         Jinja2: 2.6
       M2Crypto: 0.21.1
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.6
         PyYAML: 3.10
          PyZMQ: 2.2.0.1
            ZMQ: 3.2.2

On the minion:

salt-call --versions-report
           Salt: 0.15.3
         Python: 2.6.6 (r266:84292, Oct 12 2012, 14:36:13)
         Jinja2: unknown
       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
            ZMQ: 3.2.2

netllama avatar Jun 17 '13 23:06 netllama

Thanks for the report! Does the minion reconnect to the master on restart?

basepi avatar Jun 18 '13 15:06 basepi

Are you asking me to restart the master or the minion? I've already tried restarting the minion, without any change. There are several other new minions (in the past 18 hours) which are able to connect to the master.

netllama avatar Jun 18 '13 15:06 netllama

I was referring to the minion. Very odd that it won't reconnect on a restart. I assume you haven't changed any firewall rules recently on either host? Though it shouldn't matter on the minion, and since other minions can still connect, firewall on the master is probably not the problem....

I'm stumped. Is the minion log output you quoted all the output there was?

basepi avatar Jun 18 '13 16:06 basepi

No firewall changes anywhere recently (last change was over 6 months ago). Plus, I have hundreds of other minions on the same subnet as the system that won't connect. However, I've now found several other minions with the same problem as the first one. I have hundreds that work fine, and then a dozen that silently refuse to connect.

I ended up restarting the master, and that seems to have fixed the problem, or at least worked around it for the time being. However, this raises the question of what is going wrong on the master that it silently stops accepting connections from some minions?

netllama avatar Jun 18 '13 17:06 netllama

I have changed this to High Severity -- this bug is no good! The problem is that we have very little to go on. When @thatch45 is back in office later today or tomorrow, we'll look into it.

basepi avatar Jun 18 '13 18:06 basepi

That's fine. I've got a workaround for the time being. I'll be happy to provide any log verbosity info or whatever you need to investigate. thanks for your help thus far.

netllama avatar Jun 18 '13 19:06 netllama

What is your workaround?

basepi avatar Jun 18 '13 20:06 basepi

Restarting the master :)

However, I've only needed to do it once. If i have to do it often, then it wouldn't be a good workaround though.

netllama avatar Jun 18 '13 20:06 netllama

So have you seen it happen again since you restarted the master? I doubt we will be able to reproduce this.....only thing we can think of to do is a TCP dump, when it's not connecting.

basepi avatar Jun 18 '13 20:06 basepi

Actually, I'm seeing the same problem happening with a few Windows minions as well, since restarting the master. I tried restarting the minion with '-l debug', but none of the output seemed to suggest what was causing the problem: ######## C:\Documents and Settings\cuda0>c:\salt\salt-minion.exe -l debug -c c:\salt\conf

[DEBUG ] Reading configuration from c:\salt\conf\minion [INFO ] Configuration file path: c:\salt\conf\minion [INFO ] Setting up the Salt Minion "cuda-win-gputest0.nvidia.com" [DEBUG ] Created pidfile: c:\salt\var\run\salt-minion.pid [DEBUG ] Reading configuration from c:\salt\conf\minion [DEBUG ] loading grain in ['c:\salt\var\cache\salt\minion\extmods\grains', 'c:\salt\salt-0.15.3.win32\salt-0.15.3-py2.7.egg\salt\grains'] [DEBUG ] Skipping empty.txt, it does not end with an expected extension [DEBUG ] Attempting to authenticate with the Salt Master at 10.31.96.152 [DEBUG ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem [DEBUG ] Decrypting the current master AES key [DEBUG ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem [INFO ] Authentication with master successful! [DEBUG ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem [DEBUG ] Decrypting the current master AES key [DEBUG ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem [DEBUG ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem [DEBUG ] Reading configuration from c:\salt\conf\minion [DEBUG ] loading grain in ['c:\salt\var\cache\salt\minion\extmods\grains', 'c:\salt\salt-0.15.3.win32\salt-0.15.3-py2.7.egg\salt\grains'] [DEBUG ] Skipping empty.txt, it does not end with an expected extension [DEBUG ] loading module in ['c:\salt\var\cache\salt\minion\extmods\modules', 'c:\salt\salt-0.15.3.win32\salt-0.15.3-py2.7.egg\salt\modules'] [DEBUG ] Skipping c:\salt\var\cache\salt\minion\extmods\modules, it is not a directory [DEBUG ] Failed to import module postgres, this is most likely NOT a problem: Traceback (most recent call last): File "salt/loader.py", line 600, in gen_functions File "salt/modules/postgres.py", line 22, in ImportError: No module named pipes [DEBUG ] Failed to import module git, this is most likely NOT a problem: Traceback (most recent call last): File "salt/loader.py", line 600, in gen_functions File "salt/modules/git.py", line 8, in ImportError: No module named pipes [DEBUG ] Failed to import module kvm_hyper, this is most likely NOT a problem:

Traceback (most recent call last): File "salt/loader.py", line 600, in gen_functions File "salt/modules/kvm_hyper.py", line 18, in ImportError: No module named dom [DEBUG ] Failed to import module virt, this is most likely NOT a problem: Traceback (most recent call last): File "salt/loader.py", line 600, in gen_functions File "salt/modules/virt.py", line 14, in ImportError: No module named dom [DEBUG ] Loaded win_shadow as virtual shadow [DEBUG ] Loaded win_disk as virtual disk [DEBUG ] Loaded win_status as virtual status [DEBUG ] Loaded win_network as virtual network [DEBUG ] Loaded sysmod as virtual sys [DEBUG ] Loaded win_pkg as virtual pkg [DEBUG ] Loaded cmdmod as virtual cmd [DEBUG ] Loaded win_file as virtual file [DEBUG ] Loaded djangomod as virtual django [DEBUG ] Loaded win_service as virtual service [DEBUG ] Loaded win_useradd as virtual user [DEBUG ] Loaded win_groupadd as virtual group [DEBUG ] loading returner in ['c:\salt\var\cache\salt\minion\extmods\returners', 'c:\salt\salt-0.15.3.win32\salt-0.15.3-py2.7.egg\salt\returners']

[DEBUG ] Skipping c:\salt\var\cache\salt\minion\extmods\returners, it is not a directory [DEBUG ] Loaded carbon_return as virtual carbon [INFO ] Minion is starting as user 'cuda0' [DEBUG ] Minion "cuda-win-gputest0.nvidia.com" trying to tune in [DEBUG ] Minion PUB socket URI: tcp://127.0.0.1:4510 [DEBUG ] Minion PULL socket URI: tcp://127.0.0.1:4511 [DEBUG ] Running scheduled job: __mine_interval [DEBUG ] loading module in ['c:\salt\var\cache\salt\minion\extmods\modules', 'c:\salt\salt-0.15.3.win32\salt-0.15.3-py2.7.egg\salt\modules'] [DEBUG ] Skipping c:\salt\var\cache\salt\minion\extmods\modules, it is not a directory [DEBUG ] Failed to import module postgres, this is most likely NOT a problem: Traceback (most recent call last): File "salt/loader.py", line 600, in gen_functions File "salt/modules/postgres.py", line 22, in ImportError: No module named pipes [DEBUG ] Failed to import module git, this is most likely NOT a problem: Traceback (most recent call last): File "salt/loader.py", line 600, in gen_functions File "salt/modules/git.py", line 8, in ImportError: No module named pipes [DEBUG ] Failed to import module kvm_hyper, this is most likely NOT a problem:

Traceback (most recent call last): File "salt/loader.py", line 600, in gen_functions File "salt/modules/kvm_hyper.py", line 18, in ImportError: No module named dom [DEBUG ] Failed to import module virt, this is most likely NOT a problem: Traceback (most recent call last): File "salt/loader.py", line 600, in gen_functions File "salt/modules/virt.py", line 14, in ImportError: No module named dom [DEBUG ] Loaded win_shadow as virtual shadow [DEBUG ] Loaded win_disk as virtual disk [DEBUG ] Loaded win_status as virtual status [DEBUG ] Loaded win_network as virtual network [DEBUG ] Loaded sysmod as virtual sys [DEBUG ] Loaded win_pkg as virtual pkg [DEBUG ] Loaded cmdmod as virtual cmd [DEBUG ] Loaded win_file as virtual file [DEBUG ] Loaded djangomod as virtual django [DEBUG ] Loaded win_service as virtual service [DEBUG ] Loaded win_useradd as virtual user [DEBUG ] Loaded win_groupadd as virtual group [DEBUG ] loading returner in ['c:\salt\var\cache\salt\minion\extmods\returners', 'c:\salt\salt-0.15.3.win32\salt-0.15.3-py2.7.egg\salt\returners']

[DEBUG ] Skipping c:\salt\var\cache\salt\minion\extmods\returners, it is not a directory [DEBUG ] Loaded carbon_return as virtual carbon [DEBUG ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem [DEBUG ] Decrypting the current master AES key [DEBUG ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem ########

netllama avatar Jun 18 '13 21:06 netllama

But it's not limited to Windows minions, correct? Have there been any patterns OS-wise in the failures?

basepi avatar Jun 19 '13 16:06 basepi

No patterns that I've noticed. I've seen it happen to Linux & Windows minions at this point. And as of this morning, its happened again to a completely different Linux minion (cuda-linux64-test29). Before I attempt to fix it, is there any specific diagnostic or debugging steps you would like me to perform?

netllama avatar Jun 19 '13 16:06 netllama

Summary for this morning, out of 527 minions, 4 are currently unresponsive to commands for no apparent reason (Minion did not return). Of those 4, 1 is Linux (RHEL6-x86_64), the remaining 3 are assorted different versions of Windows (WINXP32, WIN7-x86_64, WIN8-x86_64, etc).

netllama avatar Jun 19 '13 16:06 netllama

Well, I think we're going to have to get @thatch45 in on this, see if we can diagnose it in some way. Still no entries in the master log for those minions?

basepi avatar Jun 19 '13 20:06 basepi

Nope, nothing logged anywhere with respect to salt.

netllama avatar Jun 19 '13 20:06 netllama

@netllama, are you using any ipv6?

thatch45 avatar Jun 20 '13 17:06 thatch45

nope, all ipv4

netllama avatar Jun 20 '13 17:06 netllama

meh.... I am thinking of more ways in which this has been seen, but there are not many

thatch45 avatar Jun 20 '13 17:06 thatch45

I can run tcpdump to capture what is (or is not) being transmitted, if you can provide me with the exact tcpdump command that will capture the data you need.

netllama avatar Jun 20 '13 17:06 netllama

I would say tcpdump the port (tcpdump -n -i interface -p port -w out.pcap)

On Thu, Jun 20, 2013 at 12:08 PM, Lonni J Friedman <[email protected]

wrote:

I can run tcpdump to capture what is (or is not) being transmitted, if you can provide me with the exact tcpdump command that will capture the data you need.

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

chjohnst avatar Jun 20 '13 17:06 chjohnst