stateconf -o appears broken in 0.15.0 and 0.15.1 (last working in 0.14.0)
Command line on Ubuntu 12.04:
$ salt-minion --versions-report
Salt: 0.15.1
Python: 2.7.3 (default, Aug 1 2012, 05:14:39)
Jinja2: 2.6
M2Crypto: 0.21.1
msgpack-python: 0.1.10
msgpack-pure: Not Installed
pycrypto: 2.4.1
PyYAML: 3.10
PyZMQ: 2.1.11
ZMQ: 2.1.11
$ sudo salt-call state.sls foo
[INFO ] Configuration file path: /etc/salt/minion
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[INFO ] Executing command 'ps -efH' in directory '/home/david.lindquist'
[INFO ] Loading fresh modules for state activity
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[INFO ] Fetching file 'salt://foo.sls'
[INFO ] Executing state pkg.installed for ntp
[INFO ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version}\n' -W" in directory '/home/david.lindquist'
[INFO ] No changes made for ntp
[INFO ] Executing state stateconf.set for foo::goal
[INFO ] No changes made for foo::goal
Traceback (most recent call last):
File "/usr/bin/salt-call", line 11, in <module>
salt_call()
File "/usr/lib/pymodules/python2.7/salt/scripts.py", line 76, in salt_call
client.run()
File "/usr/lib/pymodules/python2.7/salt/cli/__init__.py", line 257, in run
caller.run()
File "/usr/lib/pymodules/python2.7/salt/cli/caller.py", line 163, in run
ret = self.call()
File "/usr/lib/pymodules/python2.7/salt/cli/caller.py", line 76, in call
ret['return'] = func(*args, **kwargs)
File "/usr/lib/pymodules/python2.7/salt/modules/state.py", line 323, in sls
serial.dump(high, fp_)
File "/usr/lib/pymodules/python2.7/salt/payload.py", line 115, in dump
fn_.write(self.dumps(msg))
File "/usr/lib/pymodules/python2.7/salt/payload.py", line 109, in dumps
return msgpack.dumps(msg)
File "_msgpack.pyx", line 169, in msgpack._msgpack.packb (msgpack/_msgpack.c:2384)
File "_msgpack.pyx", line 153, in msgpack._msgpack.Packer.pack (msgpack/_msgpack.c:2020)
File "_msgpack.pyx", line 136, in msgpack._msgpack.Packer._pack (msgpack/_msgpack.c:1761)
File "_msgpack.pyx", line 130, in msgpack._msgpack.Packer._pack (msgpack/_msgpack.c:1611)
TypeError: Expected dict, got OrderedDict
$ sudo apt-get install salt-minion=0.15.0-1precise salt-common=0.15.0-1precise
...
$ sudo salt-call state.sls foo
[INFO ] Configuration file path: /etc/salt/minion
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[INFO ] Executing command 'ps -efH' in directory '/home/david.lindquist'
[INFO ] Loading fresh modules for state activity
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[INFO ] Fetching file 'salt://foo.sls'
[INFO ] Executing state pkg.installed for ntp
[INFO ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version}\n' -W" in directory '/home/david.lindquist'
[INFO ] No changes made for ntp
[INFO ] Executing state stateconf.set for foo::goal
[INFO ] No changes made for foo::goal
Traceback (most recent call last):
File "/usr/bin/salt-call", line 11, in <module>
salt_call()
File "/usr/lib/pymodules/python2.7/salt/scripts.py", line 76, in salt_call
client.run()
File "/usr/lib/pymodules/python2.7/salt/cli/__init__.py", line 257, in run
caller.run()
File "/usr/lib/pymodules/python2.7/salt/cli/caller.py", line 162, in run
ret = self.call()
File "/usr/lib/pymodules/python2.7/salt/cli/caller.py", line 75, in call
ret['return'] = func(*args, **kwargs)
File "/usr/lib/pymodules/python2.7/salt/modules/state.py", line 323, in sls
serial.dump(high, fp_)
File "/usr/lib/pymodules/python2.7/salt/payload.py", line 115, in dump
fn_.write(self.dumps(msg))
File "/usr/lib/pymodules/python2.7/salt/payload.py", line 109, in dumps
return msgpack.dumps(msg)
File "_msgpack.pyx", line 169, in msgpack._msgpack.packb (msgpack/_msgpack.c:2384)
File "_msgpack.pyx", line 153, in msgpack._msgpack.Packer.pack (msgpack/_msgpack.c:2020)
File "_msgpack.pyx", line 136, in msgpack._msgpack.Packer._pack (msgpack/_msgpack.c:1761)
File "_msgpack.pyx", line 130, in msgpack._msgpack.Packer._pack (msgpack/_msgpack.c:1611)
TypeError: Expected dict, got OrderedDict
$ sudo apt-get install salt-minion=0.14.0-1precise salt-common=0.14.0-1precise
...
$ sudo salt-call state.sls foo
[INFO ] Loaded configuration file: /etc/salt/minion
[INFO ] Executing command 'ps -efH' in directory '/home/david.lindquist'
[INFO ] Loading fresh modules for state activity
[INFO ] Fetching file 'salt://foo.sls'
ntp
[INFO ] Executing state pkg.installed for ntp
[INFO ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version}\n' -W" in directory '/home/david.lindquist'
[INFO ] Executing command 'aptitude search "?name(^.+$) ?virtual ?reverse-provides(?installed)"' in directory '/home/david.lindquist'
[INFO ] No changes made for ntp
[INFO ] Executing state stateconf.set for foo::goal
[INFO ] No changes made for foo::goal
local:
----------
State: - pkg
Name: ntp
Function: installed
Result: True
Comment: Package ntp is already installed
Changes:
----------
State: - stateconf
Name: foo::goal
Function: set
Result: True
Comment:
Changes:
$
Master version was kept at 0.15.1.
foo.sls:
#!stateconf -o
ntp:
pkg:
- installed
@s0undt3ch, you were the last one in here, Ithink the only committo touch this in 0.15.0 was the odict stuff. I will look into this when I have a chance, but we should getthis fixed soon so it is fixed in 0.15.2
Ouch! I'll see what I've missed.
I'm unable to reproduce this issue using the v0.15.1 or v0.15.0 git tag :\
Some of the logging output and versions report.
[INFO ] Package debconf-utils is not installed.
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded cmdmod as virtual cmd
[DEBUG ] loading states in ['/var/cache/salt/minion/extmods/states', '/home/buildbot/saltstack-buildbot/ext/salt/salt/states']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/states, it is not a directory
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] loading render in ['/var/cache/salt/minion/extmods/renderers', '/home/buildbot/saltstack-buildbot/ext/salt/salt/renderers']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/renderers, it is not a directory
[INFO ] Executing state stateconf.set for foo::goal
[INFO ] No changes made for foo::goal
[DEBUG ] loading output in ['/var/cache/salt/minion/extmods/output', '/home/buildbot/saltstack-buildbot/ext/salt/salt/output']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/output, it is not a directory
[DEBUG ] Loaded no_out as virtual quiet
[DEBUG ] Loaded json_out as virtual json
[DEBUG ] Loaded yaml_out as virtual yaml
[DEBUG ] Loaded pprint_out as virtual pprint
local:
----------
State: - pkg
Name: ntp
Function: installed
Result: True
Comment: The following package(s) were installed/updated: ntp.
Changes: libcap2: { new : 1:2.22-1ubuntu3
old :
}
ntp: { new : 1:4.2.6.p3+dfsg-1ubuntu3.1
old :
}
libopts25: { new : 1:5.12-0.1ubuntu1
old :
}
----------
State: - stateconf
Name: foo::goal
Function: set
Result: True
Comment:
Changes:
$ sudo -E /home/buildbot/.virtualenv-sandbox/bin/salt-call --versions-report
Salt: 0.15.1
Python: 2.7.3 (default, Aug 1 2012, 05:14:39)
Jinja2: 2.6
M2Crypto: 0.20.1
msgpack-python: 0.3.0
msgpack-pure: Not Installed
pycrypto: 2.6
PyYAML: 3.10
PyZMQ: 13.1.0
ZMQ: 3.2.2
$ sudo -E /home/buildbot/.virtualenv-sandbox/bin/salt-call state.sls foo
[INFO ] Configuration file path: /etc/salt/minion
[DEBUG ] Missing configuration file: /etc/salt/minion
[DEBUG ] Including configuration from /etc/salt/minion.d/00-minion.conf
[DEBUG ] Reading configuration from /etc/salt/minion.d/00-minion.conf
[DEBUG ] Including configuration from /etc/salt/minion.d/99-local-overrides.conf
[DEBUG ] Reading configuration from /etc/salt/minion.d/99-local-overrides.conf
[DEBUG ] loading grain in ['/var/cache/salt/minion/extmods/grains', '/home/buildbot/saltstack-buildbot/ext/salt/salt/grains']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/grains, it is not a directory
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[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 ] loading module in ['/var/cache/salt/minion/extmods/modules', '/home/buildbot/saltstack-buildbot/ext/salt/salt/modules']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/modules, it is not a directory
[DEBUG ] Skipping cytest.pyx, it does not end with an expected extension
[DEBUG ] Loaded localemod as virtual locale
[DEBUG ] Loaded groupadd as virtual group
[DEBUG ] Loaded linux_sysctl as virtual sysctl
[DEBUG ] Loaded parted as virtual partition
[DEBUG ] Loaded sysmod as virtual sys
[ERROR ] Unable to import "sourceslist" from "aptsources" module: No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[ERROR ] Unable to import "sourceslist" from "aptsources" module: No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[DEBUG ] Loaded apt as virtual pkg
[DEBUG ] Loaded upstart as virtual service
[DEBUG ] Loaded useradd as virtual user
[DEBUG ] Loaded dpkg as virtual lowpkg
[DEBUG ] Loaded grub_legacy as virtual grub
[INFO ] Package debconf-utils is not installed.
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded cmdmod as virtual cmd
[DEBUG ] loading returner in ['/var/cache/salt/minion/extmods/returners', '/home/buildbot/saltstack-buildbot/ext/salt/salt/returners']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/returners, it is not a directory
[DEBUG ] Loaded syslog_return as virtual syslog
[DEBUG ] Loaded carbon_return as virtual carbon
[DEBUG ] loading states in ['/var/cache/salt/minion/extmods/states', '/home/buildbot/saltstack-buildbot/ext/salt/salt/states']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/states, it is not a directory
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] loading render in ['/var/cache/salt/minion/extmods/renderers', '/home/buildbot/saltstack-buildbot/ext/salt/salt/renderers']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/renderers, it is not a directory
[INFO ] Executing command 'ps -efH' in directory '/home/buildbot'
[DEBUG ] output: UID PID PPID C STIME TTY TIME CMD
root 2 0 0 Jan30 ? 00:00:01 [kthreadd]
....
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] Decrypting the current master AES key
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] Missing configuration file: /etc/salt/minion
[DEBUG ] Including configuration from /etc/salt/minion.d/00-minion.conf
[DEBUG ] Reading configuration from /etc/salt/minion.d/00-minion.conf
[DEBUG ] Including configuration from /etc/salt/minion.d/99-local-overrides.conf
[DEBUG ] Reading configuration from /etc/salt/minion.d/99-local-overrides.conf
[DEBUG ] loading grain in ['/var/cache/salt/minion/extmods/grains', '/home/buildbot/saltstack-buildbot/ext/salt/salt/grains']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/grains, it is not a directory
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[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
[INFO ] Loading fresh modules for state activity
[DEBUG ] loading module in ['/var/cache/salt/minion/extmods/modules', '/home/buildbot/saltstack-buildbot/ext/salt/salt/modules']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/modules, it is not a directory
[DEBUG ] Skipping cytest.pyx, it does not end with an expected extension
[DEBUG ] Loaded localemod as virtual locale
[DEBUG ] Loaded groupadd as virtual group
[DEBUG ] Loaded linux_sysctl as virtual sysctl
[DEBUG ] Loaded parted as virtual partition
[DEBUG ] Loaded sysmod as virtual sys
[ERROR ] Unable to import "sourceslist" from "aptsources" module: No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[ERROR ] Unable to import "sourceslist" from "aptsources" module: No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[DEBUG ] Loaded apt as virtual pkg
[DEBUG ] Loaded upstart as virtual service
[DEBUG ] Loaded useradd as virtual user
[DEBUG ] Loaded dpkg as virtual lowpkg
[DEBUG ] Loaded grub_legacy as virtual grub
[INFO ] Package debconf-utils is not installed.
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded cmdmod as virtual cmd
[DEBUG ] loading states in ['/var/cache/salt/minion/extmods/states', '/home/buildbot/saltstack-buildbot/ext/salt/salt/states']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/states, it is not a directory
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] loading render in ['/var/cache/salt/minion/extmods/renderers', '/home/buildbot/saltstack-buildbot/ext/salt/salt/renderers']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/renderers, it is not a directory
[DEBUG ] loading module in ['/var/cache/salt/minion/extmods/modules', '/home/buildbot/saltstack-buildbot/ext/salt/salt/modules']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/modules, it is not a directory
[DEBUG ] Skipping cytest.pyx, it does not end with an expected extension
[DEBUG ] Loaded localemod as virtual locale
[DEBUG ] Loaded groupadd as virtual group
[DEBUG ] Loaded linux_sysctl as virtual sysctl
[DEBUG ] Loaded parted as virtual partition
[DEBUG ] Loaded sysmod as virtual sys
[ERROR ] Unable to import "sourceslist" from "aptsources" module: No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[ERROR ] Unable to import "sourceslist" from "aptsources" module: No module named softwareproperties.ppa
[WARNING ] Unable to import "softwareproperties.ppa": No module named softwareproperties.ppa
[DEBUG ] Loaded apt as virtual pkg
[DEBUG ] Loaded upstart as virtual service
[DEBUG ] Loaded useradd as virtual user
[DEBUG ] Loaded dpkg as virtual lowpkg
[DEBUG ] Loaded grub_legacy as virtual grub
[INFO ] Package debconf-utils is not installed.
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded cmdmod as virtual cmd
[INFO ] Fetching file 'salt://foo.sls'
[DEBUG ] Jinja search path: '['/var/cache/salt/minion/files/base']'
[DEBUG ] Rendered sls: OrderedDict([('ntp', OrderedDict([('pkg', ['installed'])])), ('foo::goal', {'stateconf.set': [{'require': [{'pkg': 'ntp'}]}]})])
[INFO ] Executing state pkg.installed for ntp
[INFO ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version}\n' -W" in directory '/home/buildbot'
[DEBUG ] stdout: install ok installed acpid 1:2.0.10-1ubuntu3
install ok installed adduser 3.113ubuntu2
.......
install ok installed zlib1g-dev 1:1.2.3.4.dfsg-3ubuntu4
[INFO ] No changes made for ntp
[INFO ] Executing state stateconf.set for foo::goal
[INFO ] No changes made for foo::goal
[DEBUG ] loading output in ['/var/cache/salt/minion/extmods/output', '/home/buildbot/saltstack-buildbot/ext/salt/salt/output']
[DEBUG ] Skipping /var/cache/salt/minion/extmods/output, it is not a directory
[DEBUG ] Loaded no_out as virtual quiet
[DEBUG ] Loaded json_out as virtual json
[DEBUG ] Loaded yaml_out as virtual yaml
[DEBUG ] Loaded pprint_out as virtual pprint
local:
----------
State: - pkg
Name: ntp
Function: installed
Result: True
Comment: Package ntp is already installed
Changes:
----------
State: - stateconf
Name: foo::goal
Function: set
Result: True
Comment:
Changes:
$ sudo -E /home/buildbot/.virtualenv-sandbox/bin/salt-call --versions-report
Salt: 0.15.0
Python: 2.7.3 (default, Aug 1 2012, 05:14:39)
Jinja2: 2.6
M2Crypto: 0.20.1
msgpack-python: 0.3.0
msgpack-pure: Not Installed
pycrypto: 2.6
PyYAML: 3.10
PyZMQ: 13.1.0
ZMQ: 3.2.2
Thanks for looking into this @s0undt3ch! Seems like the issue is with the version of msgpack-python. I was using 0.1.10 (pulled from Ubuntu 12.04 repo). The issue goes away if I install msgpack to 0.3.0 via pip. However, this won't be an installation option for me since I need to install on some machines that don't have a toolchain installed.
$ apt-cache show msgpack-python
Package: msgpack-python
Priority: optional
Section: universe/python
Installed-Size: 119
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Robert S. Edmonds <[email protected]>
Architecture: amd64
Version: 0.1.10-1
Depends: libc6 (>= 2.4), python (<< 2.8), python (>= 2.7), python-support (>= 0.90.0)
Filename: pool/universe/m/msgpack-python/msgpack-python_0.1.10-1_amd64.deb
Size: 29000
MD5sum: b6cdb27afbc97dca2ad9b9793d7ecab8
SHA1: 881439dea77625db6a9f326548b892635b3b3192
SHA256: bef1e46cf4313868843996c6adc26f514614cf41ff0bcf210efb3e9e2b1272ae
Description-en: Python implementation of MessagePack format
MessagePack is a binary-based efficient object serialization format.
It enables the exchange of structured objects between many languages
like JSON. But unlike JSON, it is very fast and small.
.
This package contains a Python extension module implementing the
MessagePack format.
Homepage: http://pypi.python.org/pypi/msgpack-python/
Python-Version: 2.7
Description-md5: ed3266dfffb208c8edaaf1a7148c5c6e
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Ahh! Missed that information.
I'll investigate what we can do to overcome this issue.
Thanks for your input.
Pedro Algarvio @ phone
----- Reply message ----- De: "David Lindquist" [email protected] Para: "saltstack/salt" [email protected] Cc: "Pedro Algarvio" [email protected] Assunto: [salt] stateconf -o appears broken in 0.15.0 and 0.15.1 (last working in 0.14.0) (#5017) Data: qua, Mai 15, 2013 17:19 Thanks for looking into this @s0undt3ch! Seems like the issue is with the version of msgpack-python. I was using 0.1.10 (pulled from Ubuntu 12.04 repo). The issue goes away if I install msgpack to 0.3.0 via pip. However, this won't be an installation option for me since I need to install on some machines that don't have a toolchain installed.
$ apt-cache show msgpack-python Package: msgpack-python Priority: optional Section: universe/python Installed-Size: 119 Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Robert S. Edmonds [email protected] Architecture: amd64 Version: 0.1.10-1 Depends: libc6 (>= 2.4), python (<< 2.8), python (>= 2.7), python-support (>= 0.90.0) Filename: pool/universe/m/msgpack-python/msgpack-python_0.1.10-1_amd64.deb Size: 29000 MD5sum: b6cdb27afbc97dca2ad9b9793d7ecab8 SHA1: 881439dea77625db6a9f326548b892635b3b3192 SHA256: bef1e46cf4313868843996c6adc26f514614cf41ff0bcf210efb3e9e2b1272ae Description-en: Python implementation of MessagePack format MessagePack is a binary-based efficient object serialization format. It enables the exchange of structured objects between many languages like JSON. But unlike JSON, it is very fast and small. . This package contains a Python extension module implementing the MessagePack format. Homepage: http://pypi.python.org/pypi/msgpack-python/ Python-Version: 2.7 Description-md5: ed3266dfffb208c8edaaf1a7148c5c6e Bugs: https://bugs.launchpad.net/ubuntu/+filebug Origin: Ubuntu
— Reply to this email directly or view it on GitHub.
Triggered the TypeError.