salt icon indicating copy to clipboard operation
salt copied to clipboard

ZMQError: Operation cannot be accomplished in current state

Open jumping opened this issue 13 years ago • 11 comments

I got the following error messages from the salt-minion:

[INFO    ] Authentication with master successful!
Process Process-10:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/multiprocessing/process.py", line 232, in _bootstrap
    self.run()
  File "/usr/lib64/python2.6/multiprocessing/process.py", line 88, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python2.6/site-packages/salt/minion.py", line 484, in _thread_return
    minion_instance._return_pub(ret)
  File "/usr/lib/python2.6/site-packages/salt/minion.py", line 606, in _return_pub
    ret_val = sreq.send('aes', self.crypticle.dumps(load))
  File "/usr/lib/python2.6/site-packages/salt/payload.py", line 176, in send
    self.socket.send(pkg)
  File "socket.pyx", line 499, in zmq.core.socket.Socket.send (zmq/core/socket.c:5381)
  File "socket.pyx", line 546, in zmq.core.socket.Socket.send (zmq/core/socket.c:5143)
  File "socket.pyx", line 175, in zmq.core.socket._send_copy (zmq/core/socket.c:2139)
ZMQError: Operation cannot be accomplished in current state
 ###environment
rpm -qa |grep salt
salt-0.15.3-1.el6.noarch
salt-minion-0.15.3-1.el6.noarch

jumping avatar Jul 25 '13 05:07 jumping

Is this just a happenstance error or can it be reproduced? I think I know where it is but if you have means to reproduce it this would be much easier to verify

thatch45 avatar Jul 25 '13 05:07 thatch45

I saw it at a client which run as "salt-minion -l debug".

jumping avatar Jul 25 '13 06:07 jumping

Have subsequent runs produced the same error?

basepi avatar Jul 25 '13 18:07 basepi

I only found the msg one time from debug model, now the salt-minion run at daemon. Where can I watch message output from salt-minion ?

jumping avatar Jul 26 '13 00:07 jumping

By default it logs to /var/log/salt/minion

Something like tail -f /var/log/salt/minion will allow you to watch it as it is written, otherwise just use a text editor.

basepi avatar Jul 26 '13 19:07 basepi

I think I know how to fix this one now, basically checking the zeromq socket state and then making a decision based on that data.

thatch45 avatar Oct 17 '13 21:10 thatch45

Hi.

If this could help, we are hitting that bug alot.

salt --async '*' saltutil.sync_all [waiting some time] salt-run jobs.lookup_jid 20131126145230929685 > /tmp/salt.sync

Getting alot of that error message in the log...

Latest in date: 52 ok 180 ZMQError: Operation cannot be accomplished in current state

Running debian on all. Probably wheezy. test.version gives: 8 0.17.0 208 0.17.1 16 0.17.2

If you don't have time to patch it, but have basic hints on where to check/how to fix, I might implement a patch, and do a pull-request.

ze42 avatar Nov 26 '13 14:11 ze42

I managed to work around that problem in my specific config. Not a fix, but it might help understand what caused it, and how to reproduce.

Specific configuration, while it failed:

  • rootfs is git based.
  • /var/cache was over nfs.

With the following two changes, I managed to get it running:

  • Increasing worker from 5 to 10
  • mounting var/cache/salt/master as tmpfs

ze42 avatar Nov 26 '13 17:11 ze42

I attempted to move /var/cache/salt/master to tmpfs and increased workers from 8 to 16 (8 vCPUs on master), issue persists and see the same - 0.17.2 master/minions, CentOS 6 and CentOS 5 minions.

# salt-call --versions-report
           Salt: 0.17.2
         Python: 2.6.6 (r266:84292, Dec  7 2011, 20:48:22)
         Jinja2: unknown
       M2Crypto: 0.20.2
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.0.1
         PyYAML: 3.10
          PyZMQ: 2.2.0.1
            ZMQ: 3.2.2

jalons avatar Jan 08 '14 15:01 jalons

I attempted to move /var/cache/salt/master to tmpfs and increased workers from 8 to 16 (8 vCPUs on master), issue persists and see the same - 0.17.2 master/minions, CentOS 6 and CentOS 5 minions.

# salt-call --versions-report
           Salt: 0.17.2
         Python: 2.6.6 (r266:84292, Dec  7 2011, 20:48:22)
         Jinja2: unknown
       M2Crypto: 0.20.2
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.0.1
         PyYAML: 3.10
          PyZMQ: 2.2.0.1
            ZMQ: 3.2.2

I can produce the result on demand by running state.sls.

jalons avatar Jan 08 '14 15:01 jalons

I have been refactoring these zeromq connections, and have in inbound commit. This is due to a zeromq connection timing out and then leaving the file client in a bad state, this has involved a bit of re-factoring to get right, so a change should be ready soon

thatch45 avatar Jan 08 '14 16:01 thatch45