Skip to content

multi master failover successful but execute command ‘salt * test.ping’ on second master return ‘Minion did not return. [No response]’ #29567

Closed

Description

@freebsdly

Hi,everyone!I setup a salt test environment follow this link https://docs.saltstack.com/en/latest/topics/tutorials/multimaster_pki.html:

server:

master:
   master-1:192.168.57.187
   master-2:192.168.57.190
minion:
   minion-1: 192.168.57.188

salt version:

[root@at-saltmaster-1 ~]# salt --versions-report
Salt Version:
           Salt: 2015.8.3
Dependency Versions:
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
           Mako: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.7.0
         Python: 2.7.5 (default, Jun 17 2014, 18:11:42)
           RAET: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5
           cffi: Not Installed
       cherrypy: 3.2.2
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
        libnacl: Not Installed
   msgpack-pure: Not Installed
msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
   python-gnupg: Not Installed
          smmap: Not Installed
        timelib: Not Installed
System Versions:
           dist: centos 7.1.1503 Core
        machine: x86_64
        release: 3.10.0-229.el7.x86_64
         system: CentOS Linux 7.1.1503 Core

salt-master configuration:

interface: 192.168.57.187
master_sign_pubkey: True
master_use_pubkey_signature: True
master_pubkey_signature: at-saltmaster-1
reactor:
 - 'salt/auth':
  - /srv/salt/reactor/autosign.sls

salt-minion configuration:

default_include: minion.d/*.conf
master:
 - 192.168.57.187
 - 192.168.57.190
random_master: False
master_type: failover
master_alive_interval: 15
verify_master_pubkey_sign: True
always_verify_signature: True
ipv6: False
retry_dns: 0
master_port: 4506
user: root
color: True
rejected_retry: True
random_reauth_delay: 15
auth_timeout: 15
auth_tries: 1
auth_safemode: False
recon_default: 1000
recon_max: 5000
recon_randomize: Tru

autosign.sls:

#!py

import logging
import sqlite3

log = logging.getLogger(__name__)

def check_autosign(minion_id):
con = sqlite3.connect('/srv/salt/reactor/cmdb')
cur = con.cursor()
cur.execute("select device_name from device where device_name = '%s'" % minion_id)
result = cur.fetchall()
if len(result) >= 1 :
return True
return False

def run():
'''
Autosign demo by reactor
'''
minion_id = data['id']
if data.get('act') == 'pend' and check_autosign(minion_id):
log.info('I will accept {0} key by reactor'.format(minion_id))
return {
'minion_add': {
'wheel.key.accept': [{
'match': minion_id}]
}
}
return {}

when i start all of them, minion-1 connect to master-1 successful:

[INFO    ] Got list of available master addresses: ['192.168.57.187', '192.168.57.190', '192.168.57.195', '192.168.57.196']
[DEBUG   ] Initializing new SAuth for ('/etc/salt/pki/minion', 'minion-1', 'tcp://192.168.57.187:4506')
[DEBUG   ] Generated random reconnect delay between '1000ms' and '6000ms' (3694)
[DEBUG   ] Setting zmq_reconnect_ivl to '3694ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '6000ms'
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'minion-1', 'tcp://192.168.57.187:4506', 'clear')
[ERROR   ] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
[INFO    ] Waiting 10 seconds before retry.
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'minion-1', 'tcp://192.168.57.187:4506', 'clear')
[DEBUG   ] salt.crypt.verify_signature: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Verifying signature
[DEBUG   ] Successfully verified signature of master public key with verification public key master_sign.pub
[INFO    ] Received signed and verified master pubkey from master 192.168.57.187
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem

and executed command on master-1 :

# salt "*" test.ping

it looks worked successful.

[root@at-saltmaster-2 master.d]# salt "*" test.ping
minion-1:
    True

when i stop master-1,it looks minion-1 connected to master-2 successful.

[INFO    ] Connection to master 192.168.57.187 lost
[INFO    ] Trying to tune in to next master from master-list
[INFO    ] Removing possibly failed master 192.168.57.187 from list of masters
[WARNING ] Master ip address changed from 192.168.57.187 to 192.168.57.190
[DEBUG   ] Initializing new SAuth for ('/etc/salt/pki/minion', 'minion-1', 'tcp://192.168.57.190:4506')
[DEBUG   ] Generated random reconnect delay between '1000ms' and '6000ms' (4724)
[DEBUG   ] Setting zmq_reconnect_ivl to '4724ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '6000ms'
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'minion-1', 'tcp://192.168.57.190:4506', 'clear')
val\x85\xa8function\xabmine.update\xabjid_include\xc3\xa7minutes<\xaamaxrunning\x02\xa4name\xaf__mine_interval'
[ERROR   ] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
[INFO    ] Waiting 10 seconds before retry.
[INFO    ] Running scheduled job: __master_alive
[DEBUG   ] schedule: This job was scheduled with jid_include, adding to cache (jid_include defaults to True)
[DEBUG   ] schedule: This job was scheduled with a max number of 2
chedule': '__master_alive'}
[DEBUG   ] schedule.handle_func: Incrementing jobcount, now 1, maxrunning is 2
'schedule': '__master_alive'}
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'minion-1', 'tcp://192.168.57.190:4506', 'aes')
[DEBUG   ] Initializing new SAuth for ('/etc/salt/pki/minion', 'minion-1', 'tcp://192.168.57.190:4506')
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'minion-1', 'tcp://192.168.57.190:4506', 'clear')
[DEBUG   ] salt.crypt.verify_signature: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Verifying signature
[DEBUG   ] Successfully verified signature of master public key with verification public key master_sign.pub
[INFO    ] Received signed and verified master pubkey from master <tornado.concurrent.Future object at 0x202c750>
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] schedule.handle_func: Removing /var/cache/salt/minion/proc/20151209173723541822
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'minion-1', 'tcp://192.168.57.190:4506', 'clear')
[DEBUG   ] salt.crypt.verify_signature: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Verifying signature
[DEBUG   ] Successfully verified signature of master public key with verification public key master_sign.pub
[INFO    ] Received signed and verified master pubkey from master <tornado.concurrent.Future object at 0x202c750>
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem

but when i executed command on master-2:

# salt "*" test.ping

it returned "Minion did not return. [No response]".

[root@at-saltmaster-2 master.d]# salt "*" test.ping
minion-1:
Minion did not return. [No response]

search the minion's debug log and found when minion connected to master-2, there a re something diffrent with minion-1 connect to master-1:

minion-1 connected to master-1:

[INFO    ] Received signed and verified master pubkey from master 192.168.57.187

minion-1 connected to master-2:

[INFO    ] Received signed and verified master pubkey from master <tornado.concurrent.Future object at 0x202c750>

is it a bug ?

Activity

  1. freebsdly commented on Dec 9, 2015

    @freebsdly
    Author
  2. Ch3LL commented on Dec 9, 2015

    @Ch3LL
    Contributor

    @freebsdly thanks for this report! There are other issues opened that are similar to yours including: #28875 #27152

    Whats peculiar in your scenario is I wouldn't expect the minion to attempt to authenticate with the second master due to other issues reported about similar scenarios. I tested your scenario without the PKI settings and found i could replicate your behavior when i change the setting master_alive_interval: from 30 to 15 : The minion authenticates with the second master, but I cannot run commands against the minion. Thank you very much for this report. We definitely have fixing multi-master failover on our radar.

    For clarification here is my configuration settings:

    master:
      - masterA
      - masterB
    master_type: failover
    master_alive_interval: 15
    retry_dns: 0
    

    ping @basepi just pinging you for added clarification to the failover bug overall.

  3. added
    bug
    P3
    Core
    and removed
    bug
    on Dec 9, 2015
  4. added this to the Approved milestone on Dec 9, 2015
  5. added
    severity-medium
    Confirmed
    on Dec 9, 2015
  6. freebsdly commented on Dec 10, 2015

    @freebsdly
    Author

    i'm going to this issue when i change the setting master_type: from failover to str on windows 2008 R2 sp1.
    it's work successful on centos 7

  7. Ch3LL commented on Dec 10, 2015

    @Ch3LL
    Contributor

    @freebsdly thanks for the additional information!Yes the multi-master standard type has been fixed in 2015.8.3 and should be working. This is only a known bug for failover. I am curious as to which version of salt you are using though because there is a known bug with windows and multi master in this issue: #29396

  8. freebsdly commented on Dec 10, 2015

    @freebsdly
    Author

    @Ch3LL
    salt-minion-2015.8.3-amd64-setup.exe
    salt-minion-2015.8.1-amd64-setup.exe

    i will try salt-2015.8.3 again after work

  9. freebsdly commented on Dec 11, 2015

    @freebsdly
    Author

    try again, your are right, thank you very much!

  10. modified the milestones: B 2, Approved on Feb 12, 2016
  11. meggiebot commented on Feb 12, 2016

    @meggiebot

    Need this fixed for March point release

  12. DmitryKuzmenko commented on Feb 25, 2016

    @DmitryKuzmenko
    Contributor

    Confirm this. Moreover minion hangs on develop branch. Working on it.

  13. DmitryKuzmenko commented on Feb 25, 2016

    @DmitryKuzmenko
    Contributor

    This failover issue is fixed by #30796. I've tried to apply it to v2015.8.3, it works ideally.
    But in 2015.8.4 and newer there is some timeout problem: in 2015.8 minion waits about a minute and performs tripple retry before failover, in develop minion hangs in waiting. Checking.

  14. DmitryKuzmenko commented on Feb 26, 2016

    @DmitryKuzmenko
    Contributor

    #31512 together with #30796 fix this.

  15. added
    fixed-pls-verify
    on Feb 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ConfirmedCoreMulti-MasterP3bugfixed-pls-verifyseverity-medium

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions