saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
13.98k stars 5.47k forks source link

[3006.x][BUG] modules/ipset.py new_set Syntax error (in 3006.x) #66683

Open jasonborden opened 2 days ago

jasonborden commented 2 days ago

Description The bug #61620 was not fixed in the 3006.x branch. See #61620 comments for more details.

Running salt-call -l debug ipset.new_set name=whitelist set_type="hash:net" comment=True counters=True Gives error: [ERROR ] stdout: ipset v7.11: Syntax error: unknown inet family ['/usr/sbin/ipset', 'create', 'whitelist', 'hash:net', 'counters', 'family', [...], 'inet', 'comment']

Setup Default setup, no special configuration.

Steps to Reproduce the behavior

# salt-call -l debug ipset.new_set name=whitelist set_type="hash:net"  comment=True counters=True
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: dcsaltmaster1.acedatacenter.com
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Configuration file path: /etc/salt/minion
[DEBUG   ] Grains refresh requested. Refreshing grains.
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] The functions from module 'core' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'disks' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'extra' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'lvm' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'mdadm' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'minion_process' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'opts' are being loaded by dir() on the loaded module
[DEBUG   ] Override  __utils__: <module 'salt.loaded.int.grains.zfs' from '/opt/saltstack/salt/lib/python3.10/site-packages/salt/grains/zfs.py'>
[DEBUG   ] The functions from module 'zfs' are being loaded by dir() on the loaded module
[DEBUG   ] Loading static grains from /etc/salt/grains
[DEBUG   ] The functions from module 'zfs' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded zfs.is_supported
[DEBUG   ] "dcsaltmaster1.acedatacenter.com" Not an IP address? Assuming it is a hostname.
[DEBUG   ] Master URI: tcp://127.0.0.1:4506
[DEBUG   ] Connecting to master. Attempt 1 of 1
[DEBUG   ] "dcsaltmaster1.acedatacenter.com" Not an IP address? Assuming it is a hostname.
[DEBUG   ] Master URI: tcp://127.0.0.1:4506
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'dcsaltmaster1.acedatacenter.com', 'tcp://127.0.0.1:4506')
[DEBUG   ] Generated random reconnect delay between '1000ms' and '11000ms' (2257)
[DEBUG   ] Setting zmq_reconnect_ivl to '2257ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] salt.crypt._get_key_with_evict: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] SaltEvent PUB socket URI: /var/run/salt/minion/minion_event_26aec745cc_pub.ipc
[DEBUG   ] SaltEvent PULL socket URI: /var/run/salt/minion/minion_event_26aec745cc_pull.ipc
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Loading public key
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Verifying signature
[DEBUG   ] <salt.crypt.AsyncAuth object at 0x7f6717178760> Got new master aes key.
[DEBUG   ] Closing AsyncReqChannel instance
[DEBUG   ] Connecting the Minion to the Master publish port, using the URI: tcp://127.0.0.1:4505
[DEBUG   ] <salt.transport.zeromq.PublishClient object at 0x7f67171789a0> connecting to tcp://127.0.0.1:4505
[DEBUG   ] Sending event: tag = __master_connected; data = {'master': 'dcsaltmaster1.acedatacenter.com', '_stamp': '2024-07-02T21:09:57.018940'}
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Closing IPCMessageClient instance
[DEBUG   ] Determining pillar cache
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'dcsaltmaster1.acedatacenter.com', 'tcp://127.0.0.1:4506')
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] salt.crypt.verify_signature: Loading public key
[DEBUG   ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG   ] salt.crypt.verify_signature: Verifying signature
[DEBUG   ] Closing AsyncReqChannel instance
[DEBUG   ] The functions from module 'jinja' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] The functions from module 'yaml' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] The functions from module 'ipset' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded ipset.new_set
[DEBUG   ] The functions from module 'direct_call' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded direct_call.execute
[DEBUG   ] The functions from module 'cmd' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded cmd.run
[INFO    ] Executing command /usr/sbin/ipset in directory '/root'
[ERROR   ] Command '/usr/sbin/ipset' failed with return code: 1
[ERROR   ] stdout: ipset v7.11: Syntax error: unknown inet family ['/usr/sbin/ipset', 'create', 'whitelist', 'hash:net', 'counters', 'family', [...], 'inet', 'comment']
[ERROR   ] retcode: 1
[ERROR   ] Command '/usr/sbin/ipset' failed with return code: 1
[ERROR   ] output: ipset v7.11: Syntax error: unknown inet family ['/usr/sbin/ipset', 'create', 'whitelist', 'hash:net', 'counters', 'family', [...], 'inet', 'comment']
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'dcsaltmaster1.acedatacenter.com', 'tcp://127.0.0.1:4506')
[DEBUG   ] Closing AsyncReqChannel instance
[DEBUG   ] The functions from module 'nested' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded nested.output
local:
    ipset v7.11: Syntax error: unknown inet family ['/usr/sbin/ipset', 'create', 'whitelist', 'hash:net', 'counters', 'family', [...], 'inet', 'comment']

Versions Report

Salt Version:
          Salt: 3006.8

Python Version:
        Python: 3.10.14 (main, Apr  3 2024, 21:30:09) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.3
       libgit2: Not Installed
  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.19.1
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.16.0
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: almalinux 9.4 Seafoam Ocelot
        locale: utf-8
       machine: x86_64
       release: 5.14.0-427.22.1.el9_4.x86_64
        system: Linux
       version: AlmaLinux 9.4 Seafoam Ocelot
welcome[bot] commented 2 days ago

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

dmurphy18 commented 2 days ago

@jasonborden Apologies for missing the 'cmd' when looking at it previously, corrected now and PR https://github.com/saltstack/salt/pull/66684 implementing the fix.

Thanks for the new issue, it made it easier to see it and fix.