saltstack / saltstack/salt

[BUG] Conflict between minion and syndic configuration

Open
#65,658 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Hi. I wonder if there's existing a conflict between Minion config and Syndic config.

We use a multi-MoM with a multi-syndic configuration, to ensure high availability, under 3006.3 salt version. Our syndic servers, also have a minion on them.

To do so, I parametered two MoMs in the "syndic_master" directive of the syndic config file and two masters in the "master" directive of the minion config file. Minion is allowed to use random_master to split load accross the two syndics.

I wonder why I'm getting this warning in salt-syndic log file :

[salt.minion :780 ][WARNING ][295318] random_master is True but there is only one master specified".

The process who raise this warning is salt-minion. I guess this is because "A Syndic node can be thought of as a special passthrough Minion node" regarding the doc. There is no such warning in the minion logfile.

Why salt-syndic seems to use my minion "random_master" configuration ? Thanks a lot.

Setup


~]# cat /etc/salt/master.d/syndic.conf
syndic_master:
  - saltmaster1.it.fr
  - saltmaster2.it.fr

random_master: False                                          # I guess this one is not even used by syndic
syndic_log_file: /var/log/salt/syndic
syndic_pidfile: /var/run/salt-syndic.pid

gitfs_global_lock: False
git_pillar_global_lock: False
top_file_merging_strategy: same

tcp_keepalive: True
tcp_keepalive_intvl: 150
tcp_keepalive_idle: 150

log_level: warning
file_recv: True

worker_threads: 5
~]# cat /etc/salt/minion.d/minion.conf
master:
  - saltsyndic1.it.fr
  - saltsyndic2.it.fr

master_type: failover
master_failback: True
master_failback_interval: 120
random_master: True                                       # This one is used for the minion on the syndic server, not for the syndic itself
master_alive_interval: 60
master_tries: -1
retry_dns: 0

log_level: warning
pillarenv_from_saltenv: True
saltenv: horsprod
state_verbose: False

# Keep connexion on port 4505 alive
tcp_keepalive: True
tcp_keepalive_intvl: 150
tcp_keepalive_idle: 150

# Keep connexion on port 4506 alive
ping_interval: 10

# dispatch logins
random_startup_delay: 30
random_reauth_delay: 60
acceptance_wait_time: 10
auth_timeout: 40

use_superseded:
  - module.run

# Optional
# recon_default: 300000
# recon_max: 350000
# recon_randomize: True

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM on vmware
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior
Use previous config, restart salt-syndic service and take a look at syndic's logfile that will displays :

2023-12-01 11:01:25,042 [salt.minion :780 ][WARNING ][295318] random_master is True but there is only one master specified. Ignoring.

Expected behavior
This warning is not supposed to appear because syndic should not take a look at random_master config option. Syndic have to initiate a connection with it's hot MoM to ensure high availability. Isn't it ?

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3006.3

Python Version:
        Python: 3.10.13 (main, Sep  6 2023, 02:11:27) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: 1.7.1
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: 1.13.0
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.13.10
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: ubuntu 20.04.2 focal
        locale: utf-8
       machine: x86_64
       release: 5.4.0-167-generic
        system: Linux
       version: Ubuntu 20.04.2 focal

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported setup with /etc/salt/master.d/syndic.conf and /etc/salt/minion.d/minion.conf on Salt 3006.3, then compare the salt-syndic and salt-minion logs around the random_master warning. Trace which configuration is loaded by the syndic process and verify that the completed fix prevents the warning while preserving the configured multi-MoM and multi-master behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.