salt: minion does not return chocolatey.list

Description of Issue

Trying to execute salt module chocolatey to list installed packages on Windows minions.

salt -G 'os:Windows' chocolatey.list local_only=True

Minions never return anything, I just get [No Reponse] on master.

If I run

salt-call --local chocolatey.list local_only=True

on the minion itself, I get expected output, which is the list of chocolatey packages currently installed on the minion.

Setup

There is nothing particular about my setup. I have a master running on Ubuntu 18.04 (Py3) and two Windows minions, Server 2016 and Server 2019.

Steps to Reproduce Issue

As per above

salt -G 'os:Windows' chocolatey.list local_only=True

Versions Report

Master and minions both running latest 2019.2.1

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Tricksy.

We have some efforts to unify the way we’re wrapping msgpack, so it should be possible for us to put a try/except around there to confirm that we’re properly passing serializable types to msgpack. Which we’re clearly not doing here disappointed

Don’t forget json.dumps too as it’s used by the mysql returner and likely others.

That’ll do it - it looks like msgpack 0.5.6 dumped a repr, where 0.6.1 will do something like this:

>>> msgpack.dumps(d)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/msgpack/__init__.py", line 46, in packb
    return Packer(**kwargs).pack(o)
  File "msgpack/_packer.pyx", line 282, in msgpack._cmsgpack.Packer.pack
  File "msgpack/_packer.pyx", line 288, in msgpack._cmsgpack.Packer.pack
  File "msgpack/_packer.pyx", line 285, in msgpack._cmsgpack.Packer.pack
  File "msgpack/_packer.pyx", line 279, in msgpack._cmsgpack.Packer._pack
TypeError: can not serialize 'CaseInsensitiveDict' object

Tricksy.

We have some efforts to unify the way we’re wrapping msgpack, so it should be possible for us to put a try/except around there to confirm that we’re properly passing serializable types to msgpack. Which we’re clearly not doing here 😞

This issue still occurs with MsgPack v0.5.6 and it was explained with code references why it would have issues. The requirements as listed in salt still reference v0.5.6, until this is updated or the issue I pointed out is fixed, this doesn’t deserve to be closed.