sat.client.Caller: Exception AttributeError: MinionEvent' object has no attribute 'cpub'"
I'm testing the salt.client API with a custom minion configuration file (file_client to "local"), and I have this: Exception AttributeError: "'MinionEvent' object has no attribute 'cpub'" in > ignored
No issue with "salt-call --local -c configfile"
Will you please paste the full traceback?
root@SPV:/opt/nova/current/nova# ./bin/salt-call --local -l debug -c parts/salt/minion saltutil.sync_modules
WARNING: 'parts/salt/minion' directory does not exist.
[DEBUG ] Missing configuration file: /opt/nova/docker-r1-internal/nova/parts/salt/minion/minion
[INFO ] Using cached minion ID from /etc/salt/minion_id: SPV.probe.securactive.ext
[DEBUG ] Failed to import log_handlers logstash_mod, this is most likely NOT a problem:
Traceback (most recent call last):
File "/opt/nova/docker-r1-internal/nova/eggs/salt-2014.1.0-py2.7.egg/salt/loader.py", line 700, in gen_functions
), fn_, path, desc
File "/opt/nova/docker-r1-internal/nova/eggs/salt-2014.1.0-py2.7.egg/salt/log/handlers/logstash_mod.py", line 114, in <module>
import zmq
File "/opt/nova/docker-r1-internal/nova/eggs/pyzmq-14.0.1-py2.7-linux-x86_64.egg/zmq/__init__.py", line 54, in <module>
raise ImportError("%s\nAre you trying to `import zmq` from the pyzmq source dir?" % e)
ImportError: libzmq.so.3: cannot open shared object file: No such file or directory
Are you trying to `import zmq` from the pyzmq source dir?
[DEBUG ] Configuration file path: /etc/salt/minion
[DEBUG ] Missing configuration file: /etc/salt/minion
[DEBUG ] Loaded localemod as virtual locale
[DEBUG ] Loaded groupadd as virtual group
[DEBUG ] Loaded linux_sysctl as virtual sysctl
[DEBUG ] Loaded debian_ip as virtual ip
[DEBUG ] Loaded parted as virtual partition
[DEBUG ] Loaded aptpkg as virtual pkg
[DEBUG ] Loaded sysmod as virtual sys
[DEBUG ] Loaded zcbuildout as virtual buildout
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded debian_service as virtual service
[DEBUG ] Loaded useradd as virtual user
[DEBUG ] Loaded dpkg as virtual lowpkg
[DEBUG ] Loaded grub_legacy as virtual grub
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG ] Loaded cmdmod as virtual cmd
[DEBUG ] Loaded localemod as virtual locale
[DEBUG ] Loaded groupadd as virtual group
[DEBUG ] Loaded linux_sysctl as virtual sysctl
[DEBUG ] Loaded debian_ip as virtual ip
[DEBUG ] Loaded parted as virtual partition
[DEBUG ] Loaded aptpkg as virtual pkg
[DEBUG ] Loaded sysmod as virtual sys
[DEBUG ] Loaded zcbuildout as virtual buildout
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded debian_service as virtual service
[DEBUG ] Loaded useradd as virtual user
[DEBUG ] Loaded dpkg as virtual lowpkg
[DEBUG ] Loaded grub_legacy as virtual grub
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG ] Loaded cmdmod as virtual cmd
[DEBUG ] Loaded couchdb_return as virtual couchdb
[DEBUG ] Loaded syslog_return as virtual syslog
[DEBUG ] Loaded carbon_return as virtual carbon
[DEBUG ] Loaded sqlite3_return as virtual sqlite3
[DEBUG ] Loaded saltmod as virtual salt
[DEBUG ] Loaded zcbuildout as virtual buildout
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG ] Missing configuration file: /etc/salt/minion
[DEBUG ] Loaded localemod as virtual locale
[DEBUG ] Loaded groupadd as virtual group
[DEBUG ] Loaded linux_sysctl as virtual sysctl
[DEBUG ] Loaded debian_ip as virtual ip
[DEBUG ] Loaded parted as virtual partition
[DEBUG ] Loaded aptpkg as virtual pkg
[DEBUG ] Loaded sysmod as virtual sys
[DEBUG ] Loaded zcbuildout as virtual buildout
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded debian_service as virtual service
[DEBUG ] Loaded useradd as virtual user
[DEBUG ] Loaded dpkg as virtual lowpkg
[DEBUG ] Loaded grub_legacy as virtual grub
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG ] Loaded cmdmod as virtual cmd
[INFO ] Loading fresh modules for state activity
[DEBUG ] Loaded localemod as virtual locale
[DEBUG ] Loaded groupadd as virtual group
[DEBUG ] Loaded linux_sysctl as virtual sysctl
[DEBUG ] Loaded debian_ip as virtual ip
[DEBUG ] Loaded parted as virtual partition
[DEBUG ] Loaded aptpkg as virtual pkg
[DEBUG ] Loaded sysmod as virtual sys
[DEBUG ] Loaded zcbuildout as virtual buildout
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded debian_service as virtual service
[DEBUG ] Loaded useradd as virtual user
[DEBUG ] Loaded dpkg as virtual lowpkg
[DEBUG ] Loaded grub_legacy as virtual grub
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG ] Loaded cmdmod as virtual cmd
[DEBUG ] Loaded saltmod as virtual salt
[DEBUG ] Loaded zcbuildout as virtual buildout
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG ] Loaded localemod as virtual locale
[DEBUG ] Loaded groupadd as virtual group
[DEBUG ] Loaded linux_sysctl as virtual sysctl
[DEBUG ] Loaded debian_ip as virtual ip
[DEBUG ] Loaded parted as virtual partition
[DEBUG ] Loaded aptpkg as virtual pkg
[DEBUG ] Loaded sysmod as virtual sys
[DEBUG ] Loaded zcbuildout as virtual buildout
[DEBUG ] Loaded djangomod as virtual django
[DEBUG ] Loaded debian_service as virtual service
[DEBUG ] Loaded useradd as virtual user
[DEBUG ] Loaded dpkg as virtual lowpkg
[DEBUG ] Loaded grub_legacy as virtual grub
[DEBUG ] Loaded debconfmod as virtual debconf
[DEBUG ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG ] Loaded cmdmod as virtual cmd
[INFO ] Creating module dir '/var/cache/salt/minion/extmods/modules'
[INFO ] Syncing modules for environment 'base'
[INFO ] Loading cache from salt://_modules, for base)
[INFO ] Caching directory '_modules/' for environment 'base'
[DEBUG ] Local cache dir: '/var/cache/salt/minion/files/base/_modules'
Exception AttributeError: "'MinionEvent' object has no attribute 'cpub'" in <bound method MinionEvent.__del__ of <salt.utils.event.MinionEvent object at 0x37f9190>> ignored
[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:
Interesting. Odd that this does work with the -c option but not mopts. I'm under the impression the event system doesn't need ZeroMQ in local mode at all -- do you have it installed though?
Will you please also paste the dictionary you're passing to mopts and the exact Salt version you're on? I'll plug both those things in here and try to recreate the error.
Closing issue due to inactivity for several months. If this issue still persists in the latest version, please reopen with updated information or log a new bug. Thanks.
I'm having the same error using a very simple module. It is also related to #2918 which came from http://docs.saltstack.com/en/latest/topics/event/index.html documentation :
salt-call frima_saltutil.refresh_pillar
Exception AttributeError: "'MinionEvent' object has no attribute 'cpub'" in <bound method MinionEvent.__del__ of <salt.utils.event.MinionEvent object at 0x4838c10>> ignored
Passed invalid arguments: __init__() got an unexpected keyword argument 'ioflo_realtime'
frima_saltutil.py
import salt.utils.event
def refresh_pillar():
minion_event = salt.utils.event.MinionEvent(**__opts__)
__salt__['saltutil.refresh_pillar']()
for job_event in minion_event.iter_events(tag='salt/job'):
if job_event["data"]["func"] == "saltutil.refresh_pillar":
return job_event["data"]["success"] or False
return False
salt version :
Salt: 2014.7.1
Python: 2.6.9 (unknown, Sep 13 2014, 00:25:11)
Jinja2: 2.7.3
M2Crypto: 0.20.2
msgpack-python: 0.4.5
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.10
ioflo: Not Installed
PyZMQ: 14.5.0
RAET: Not Installed
ZMQ: 3.2.4
Mako: Not Installed
Ok I was able to be hook into the minion event, at least. The documentation lagged behind the code : MinionEvent constructor no longer expect kwargs but a dict instance. I added missing documentation in #2918.
Minion event hooking must be written that way :
import salt.utils.event
minion_event = salt.utils.event.MinionEvent(__opts__)
So I'm supposed to receive minion events but that's not the case. I perform a lot of jobs and auths during that time but nothing is trapped (get_event or iter_events).
MinionEvent PUB socket URI: ipc:///var/run/salt/minion/minion_event_618c579e87_pub.ipc
[DEBUG ] MinionEvent PULL socket URI: ipc:///var/run/salt/minion/minion_event_618c579e87_pull.ipc
[DEBUG ] SaltEvent PUB socket URI: ipc:///var/run/salt/minion/minion_event_618c579e87_pub.ipc
[DEBUG ] SaltEvent PULL socket URI: ipc:///var/run/salt/minion/minion_event_618c579e87_pull.ipc
... nothing receive even with 60 sec timeout
Docs updated with the current best usage in #20641.