Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When raising ZMQError: Permission denied it would be helpful if context were given #1287

bowlofeggs opened this issue May 7, 2019 · 2 comments


Copy link


I recently received this traceback:

Traceback (most recent call last):                                                                  
  File "/usr/lib/python3.7/site-packages/moksha/hub/", line 455, in __init_producers 
    producer_obj = producer_class(self)                                                             
  File "/usr/lib/python3.7/site-packages/moksha/hub/", line 47, in __init__            
  File "zmq/backend/cython/socket.pyx", line 547, in zmq.backend.cython.socket.Socket.bind 
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc 
zmq.error.ZMQError: Permission denied

It turned out that it was unable to create /var/run/fedmsg/monitoring-fedmsg-hub.socket, but it would have made debugging easier for me if it had told me that along with the ZMQError.

Could we make it so that the error includes info about what it was getting permission denied on? Something like this would have been helpful:

zmq.error.ZMQError: Permission denied: Unable to bind to /var/run/fedmsg/monitoring-fedmsg-hub.socket


Copy link

minrk commented May 8, 2019

That would indeed be great! It might be difficult, though, because we don't have path information in the underlying error. All we have is that it was EPERM.

To do this, I think we'd need to special-case error handing in bind/connect and re-raise a new error:

# pseudo-ish code
except ZMError as e:
    if EPERM and url.startswith('ipc://'):
        raise ZMQError(EPERM, message=message_with_url)

Copy link

minrk commented Jul 9, 2019

#1301 does this with ENOENT, EPERM could be added as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants