Skip to content

2017 and 2018 grains.items not able to output with --out=yaml #49269

Closed

Description

@whytewolf

Description of Issue/Question

Using 2017.7.x and 2018.3.x I'm unable to output with --out=yaml using salt

Setup

Install salt and try to output the grains in yaml and run the command salt-call grains.items --out=yaml

Steps to Reproduce Issue

Install salt and try to output the grains in yaml and run the command salt-call grains.items --out=yaml

Trace logs included in the attached file.

grains.items.yaml.2017.7.7.txt

Versions Report

Salt Version:
           Salt: 2017.7.7

Dependency Versions:
           cffi: 1.6.0
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: 0.26.3
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.26.4
         Python: 2.7.5 (default, Jul 13 2018, 13:06:57)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.5.1804 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-862.11.6.el7.x86_64
         system: Linux
        version: CentOS Linux 7.5.1804 Core
Salt Version:
           Salt: 2018.3.2

Dependency Versions:
           cffi: 1.6.0
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: 0.26.3
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.26.4
         Python: 2.7.5 (default, Jul 13 2018, 13:06:57)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.5.1804 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-862.11.6.el7.x86_64
         system: Linux
        version: CentOS Linux 7.5.1804 Core

Activity

  1. added
    ZD
    on Aug 22, 2018
  2. whytewolf commented on Aug 22, 2018

    @whytewolf
    CollaboratorAuthor

    ZD-2794

  3. added
    bug
    Core
    P3
    on Aug 23, 2018
  4. added this to the Approved milestone on Aug 23, 2018
  5. gtmanfred commented on Aug 23, 2018

    @gtmanfred
    Contributor

    Seems like this is a bug in the yaml outputter.

  6. added
    Confirmed
    on Aug 23, 2018
  7. gtmanfred commented on Aug 23, 2018

    @gtmanfred
    Contributor
    [root@minion1 /]# salt-call -l debug grains.items --out=yaml
    [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   ] Configuration file path: /etc/salt/minion
    # [WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
    # [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   ] Please install 'virt-what' to improve results of the 'virtual' grain.
    # [DEBUG   ] Connecting to master. Attempt 1 of 1
    # [DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'minion1', 'tcp://172.29.0.4:4506')
    # [DEBUG   ] Generated random reconnect delay between '1000ms' and '11000ms' (3098)
    # [DEBUG   ] Setting zmq_reconnect_ivl to '3098ms'
    # [DEBUG   ] Setting zmq_reconnect_ivl_max to '11000ms'
    # [DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'minion1', 'tcp://172.29.0.4:4506', 'clear')
    # [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
    # [DEBUG   ] Determining pillar cache
    # [DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'minion1', 'tcp://172.29.0.4:4506', 'aes')
    # [DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'minion1', 'tcp://172.29.0.4:4506')
    # [DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
    # [DEBUG   ] LazyLoaded jinja.render
    # [DEBUG   ] LazyLoaded yaml.render
    # [DEBUG   ] LazyLoaded grains.items
    # [DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'minion1', 'tcp://172.29.0.4:4506', 'aes')
    # [DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'minion1', 'tcp://172.29.0.4:4506')
    # [DEBUG   ] LazyLoaded yaml.output
    # [ERROR   ] Exception cannot represent an object: {'kernel': 'Linux', 'domain': '', 'osrelease': '7.5.1804', 'uid': 0, 'zmqversion': '4.1.4', 'kernelrelease': '4.9.93-linuxkit-aufs', 'pythonpath': ['/usr/bin', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib/python2.7/site-packages'], 'saltversioninfo': [2017, 7, 7, 0], 'pid': 470, 'ip_interfaces': {}, 'groupname': 'root', 'systemd': {'version': '219', 'features': '+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN'}, 'mem_total': 1998, 'gpus': [], 'SSDs': ['nbd3', 'nbd15', 'nbd1', 'nbd13', 'nbd8', 'nbd11', 'nbd6', 'nbd4', 'nbd2', 'nbd14', 'nbd0', 'nbd9', 'nbd12', 'nbd7', 'nbd10', 'nbd5'], 'id': 'minion1', 'osmajorrelease': 7, 'ps': 'ps -efHww', 'server_id': 341203228, 'ip6_interfaces': {}, 'num_cpus': 4, 'hwaddr_interfaces': {}, 'init': 'systemd', 'ip4_interfaces': {}, 'virtual_subtype': 'Docker', 'osfullname': 'CentOS Linux', 'gid': 0, 'master': 'salt', 'ipv4': [], 'dns': {'domain': '', 'sortlist': [], 'nameservers': ['127.0.0.11'], 'ip4_nameservers': ['127.0.0.11'], 'search': [], 'ip6_nameservers': [], 'options': ['ndots:0']}, 'ipv6': [], 'shell': '/bin/sh', 'cpu_flags': ['fpu', 'vme', 'de', 'pse', 'tsc', 'msr', 'pae', 'mce', 'cx8', 'apic', 'sep', 'mtrr', 'pge', 'mca', 'cmov', 'pat', 'pse36', 'clflush', 'mmx', 'fxsr', 'sse', 'sse2', 'ss', 'ht', 'pbe', 'syscall', 'nx', 'pdpe1gb', 'lm', 'constant_tsc', 'rep_good', 'nopl', 'xtopology', 'nonstop_tsc', 'eagerfpu', 'pni', 'pclmulqdq', 'dtes64', 'ds_cpl', 'ssse3', 'sdbg', 'fma', 'cx16', 'xtpr', 'pcid', 'sse4_1', 'sse4_2', 'movbe', 'popcnt', 'aes', 'xsave', 'avx', 'f16c', 'rdrand', 'hypervisor', 'lahf_lm', 'abm', 'kaiser', 'fsgsbase', 'bmi1', 'avx2', 'bmi2', 'erms', 'xsaveopt', 'arat'], 'localhost': 'minion1', 'lsb_distrib_id': 'CentOS Linux', 'username': 'root', 'fqdn_ip4': [], 'saltpath': '/usr/lib/python2.7/site-packages/salt', 'fqdn_ip6': [], 'nodename': 'minion1', 'saltversion': '2017.7.7', 'locale_info': {'detectedencoding': 'ANSI_X3.4-1968', 'defaultlanguage': None, 'defaultencoding': None}, 'cpu_model': 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz', 'host': 'minion1', 'os_family': 'RedHat', 'oscodename': 'CentOS Linux 7 (Core)', 'osfinger': 'CentOS Linux-7', 'pythonversion': [2, 7, 5, 'final', 0], 'num_gpus': 0, 'virtual': 'bhyve', 'disks': ['loop1', 'loop6', 'loop4', 'sr0', 'loop2', 'loop0', 'sda', 'loop7', 'loop5', 'sr1', 'loop3'], 'fqdn': 'minion1', 'pythonexecutable': '/usr/bin/python', 'osarch': 'x86_64', 'cpuarch': 'x86_64', 'lsb_distrib_codename': 'CentOS Linux 7 (Core)', 'osrelease_info': (7, 5, 1804), 'path': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'machine_id': '6be12951007641bdb226b3a00abaa092', 'os': 'CentOS'} encountered when trying to serialize {'local': {'kernel': 'Linux', 'domain': '', 'osrelease': '7.5.1804', 'uid': 0, 'zmqversion': '4.1.4', 'kernelrelease': '4.9.93-linuxkit-aufs', 'pythonpath': ['/usr/bin', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib/python2.7/site-packages'], 'saltversioninfo': [2017, 7, 7, 0], 'pid': 470, 'ip_interfaces': {}, 'groupname': 'root', 'systemd': {'version': '219', 'features': '+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN'}, 'mem_total': 1998, 'gpus': [], 'SSDs': ['nbd3', 'nbd15', 'nbd1', 'nbd13', 'nbd8', 'nbd11', 'nbd6', 'nbd4', 'nbd2', 'nbd14', 'nbd0', 'nbd9', 'nbd12', 'nbd7', 'nbd10', 'nbd5'], 'id': 'minion1', 'osmajorrelease': 7, 'ps': 'ps -efHww', 'server_id': 341203228, 'ip6_interfaces': {}, 'num_cpus': 4, 'hwaddr_interfaces': {}, 'init': 'systemd', 'ip4_interfaces': {}, 'virtual_subtype': 'Docker', 'osfullname': 'CentOS Linux', 'gid': 0, 'master': 'salt', 'ipv4': [], 'dns': {'domain': '', 'sortlist': [], 'nameservers': ['127.0.0.11'], 'ip4_nameservers': ['127.0.0.11'], 'search': [], 'ip6_nameservers': [], 'options': ['ndots:0']}, 'ipv6': [], 'shell': '/bin/sh', 'cpu_flags': ['fpu', 'vme', 'de', 'pse', 'tsc', 'msr', 'pae', 'mce', 'cx8', 'apic', 'sep', 'mtrr', 'pge', 'mca', 'cmov', 'pat', 'pse36', 'clflush', 'mmx', 'fxsr', 'sse', 'sse2', 'ss', 'ht', 'pbe', 'syscall', 'nx', 'pdpe1gb', 'lm', 'constant_tsc', 'rep_good', 'nopl', 'xtopology', 'nonstop_tsc', 'eagerfpu', 'pni', 'pclmulqdq', 'dtes64', 'ds_cpl', 'ssse3', 'sdbg', 'fma', 'cx16', 'xtpr', 'pcid', 'sse4_1', 'sse4_2', 'movbe', 'popcnt', 'aes', 'xsave', 'avx', 'f16c', 'rdrand', 'hypervisor', 'lahf_lm', 'abm', 'kaiser', 'fsgsbase', 'bmi1', 'avx2', 'bmi2', 'erms', 'xsaveopt', 'arat'], 'localhost': 'minion1', 'lsb_distrib_id': 'CentOS Linux', 'username': 'root', 'fqdn_ip4': [], 'saltpath': '/usr/lib/python2.7/site-packages/salt', 'fqdn_ip6': [], 'nodename': 'minion1', 'saltversion': '2017.7.7', 'locale_info': {'detectedencoding': 'ANSI_X3.4-1968', 'defaultlanguage': None, 'defaultencoding': None}, 'cpu_model': 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz', 'host': 'minion1', 'os_family': 'RedHat', 'oscodename': 'CentOS Linux 7 (Core)', 'osfinger': 'CentOS Linux-7', 'pythonversion': [2, 7, 5, 'final', 0], 'num_gpus': 0, 'virtual': 'bhyve', 'disks': ['loop1', 'loop6', 'loop4', 'sr0', 'loop2', 'loop0', 'sda', 'loop7', 'loop5', 'sr1', 'loop3'], 'fqdn': 'minion1', 'pythonexecutable': '/usr/bin/python', 'osarch': 'x86_64', 'cpuarch': 'x86_64', 'lsb_distrib_codename': 'CentOS Linux 7 (Core)', 'osrelease_info': (7, 5, 1804), 'path': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'machine_id': '6be12951007641bdb226b3a00abaa092', 'os': 'CentOS'}}
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/salt/output/yaml_out.py", line 56, in output
        return yaml.dump(data, **params)
      File "/usr/lib64/python2.7/site-packages/yaml/__init__.py", line 202, in dump
        return dump_all([data], stream, Dumper=Dumper, **kwds)
      File "/usr/lib64/python2.7/site-packages/yaml/__init__.py", line 190, in dump_all
        dumper.represent(data)
      File "/usr/lib64/python2.7/site-packages/yaml/representer.py", line 28, in represent
        node = self.represent_data(data)
      File "/usr/lib64/python2.7/site-packages/yaml/representer.py", line 57, in represent_data
        node = self.yaml_representers[data_types[0]](self, data)
      File "/usr/lib64/python2.7/site-packages/yaml/representer.py", line 223, in represent_dict
        return self.represent_mapping(u'tag:yaml.org,2002:map', data)
      File "/usr/lib64/python2.7/site-packages/yaml/representer.py", line 123, in represent_mapping
        node_value = self.represent_data(item_value)
      File "/usr/lib64/python2.7/site-packages/yaml/representer.py", line 67, in represent_data
        node = self.yaml_representers[None](self, data)
      File "/usr/lib64/python2.7/site-packages/yaml/representer.py", line 247, in represent_undefined
        raise RepresenterError("cannot represent an object: %s" % data)
    RepresenterError: cannot represent an object: {'kernel': 'Linux', 'domain': '', 'osrelease': '7.5.1804', 'uid': 0, 'zmqversion': '4.1.4', 'kernelrelease': '4.9.93-linuxkit-aufs', 'pythonpath': ['/usr/bin', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib/python2.7/site-packages'], 'saltversioninfo': [2017, 7, 7, 0], 'pid': 470, 'ip_interfaces': {}, 'groupname': 'root', 'systemd': {'version': '219', 'features': '+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN'}, 'mem_total': 1998, 'gpus': [], 'SSDs': ['nbd3', 'nbd15', 'nbd1', 'nbd13', 'nbd8', 'nbd11', 'nbd6', 'nbd4', 'nbd2', 'nbd14', 'nbd0', 'nbd9', 'nbd12', 'nbd7', 'nbd10', 'nbd5'], 'id': 'minion1', 'osmajorrelease': 7, 'ps': 'ps -efHww', 'server_id': 341203228, 'ip6_interfaces': {}, 'num_cpus': 4, 'hwaddr_interfaces': {}, 'init': 'systemd', 'ip4_interfaces': {}, 'virtual_subtype': 'Docker', 'osfullname': 'CentOS Linux', 'gid': 0, 'master': 'salt', 'ipv4': [], 'dns': {'domain': '', 'sortlist': [], 'nameservers': ['127.0.0.11'], 'ip4_nameservers': ['127.0.0.11'], 'search': [], 'ip6_nameservers': [], 'options': ['ndots:0']}, 'ipv6': [], 'shell': '/bin/sh', 'cpu_flags': ['fpu', 'vme', 'de', 'pse', 'tsc', 'msr', 'pae', 'mce', 'cx8', 'apic', 'sep', 'mtrr', 'pge', 'mca', 'cmov', 'pat', 'pse36', 'clflush', 'mmx', 'fxsr', 'sse', 'sse2', 'ss', 'ht', 'pbe', 'syscall', 'nx', 'pdpe1gb', 'lm', 'constant_tsc', 'rep_good', 'nopl', 'xtopology', 'nonstop_tsc', 'eagerfpu', 'pni', 'pclmulqdq', 'dtes64', 'ds_cpl', 'ssse3', 'sdbg', 'fma', 'cx16', 'xtpr', 'pcid', 'sse4_1', 'sse4_2', 'movbe', 'popcnt', 'aes', 'xsave', 'avx', 'f16c', 'rdrand', 'hypervisor', 'lahf_lm', 'abm', 'kaiser', 'fsgsbase', 'bmi1', 'avx2', 'bmi2', 'erms', 'xsaveopt', 'arat'], 'localhost': 'minion1', 'lsb_distrib_id': 'CentOS Linux', 'username': 'root', 'fqdn_ip4': [], 'saltpath': '/usr/lib/python2.7/site-packages/salt', 'fqdn_ip6': [], 'nodename': 'minion1', 'saltversion': '2017.7.7', 'locale_info': {'detectedencoding': 'ANSI_X3.4-1968', 'defaultlanguage': None, 'defaultencoding': None}, 'cpu_model': 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz', 'host': 'minion1', 'os_family': 'RedHat', 'oscodename': 'CentOS Linux 7 (Core)', 'osfinger': 'CentOS Linux-7', 'pythonversion': [2, 7, 5, 'final', 0], 'num_gpus': 0, 'virtual': 'bhyve', 'disks': ['loop1', 'loop6', 'loop4', 'sr0', 'loop2', 'loop0', 'sda', 'loop7', 'loop5', 'sr1', 'loop3'], 'fqdn': 'minion1', 'pythonexecutable': '/usr/bin/python', 'osarch': 'x86_64', 'cpuarch': 'x86_64', 'lsb_distrib_codename': 'CentOS Linux 7 (Core)', 'osrelease_info': (7, 5, 1804), 'path': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'machine_id': '6be12951007641bdb226b3a00abaa092', 'os': 'CentOS'}
    [root@minion1 /]#
    
  8. rallytime commented on Aug 28, 2018

    @rallytime
    Contributor

    @terminalmage Can you take a look at this one when you get a moment?

  9. terminalmage commented on Aug 29, 2018

    @terminalmage
    Contributor

    Fixed in #49408

  10. added
    fixed-pls-verify
    on Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ConfirmedCoreP3ZDbugfixed-pls-verify

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions