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

Monkeypatch affecting MQTT connections #30

Closed
natashell666 opened this issue Sep 19, 2022 · 0 comments · Fixed by #31
Closed

Monkeypatch affecting MQTT connections #30

natashell666 opened this issue Sep 19, 2022 · 0 comments · Fixed by #31

Comments

@natashell666
Copy link

natashell666 commented Sep 19, 2022

After monkeypatching for doing a ziti connection using paho.mqtt.client (or any MQTT library), the connection fails with the following error:

Traceback (most recent call last):
  File "DemoMTTQ.py", line 466, in <module>
    listen_for_messages()
  File "DemoMTTQ.py", line 264, in listen_for_messages
    client = get_client()
  File "DemoMTTQ.py", line 147, in get_client
    client = mqtt.Client(client_id=client_id)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 519, in __init__
    self._sockpairR, self._sockpairW = _socketpair_compat()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 244, in _socketpair_compat
    listensock.bind(("127.0.0.1", 0))
  File "/usr/local/lib/python3.9/site-packages/openziti/zitisock.py", line 58, in bind
    bindings = self._ziti_opts['bindings']
KeyError: 'bindings'
Exception ignored in: <function Client.__del__ at 0x7f2e696ac790>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 603, in __del__
    self._reset_sockets()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 649, in _reset_sockets
    if self._sockpairR:
AttributeError: 'Client' object has no attribute '_sockpairR'

Edit: reformatted traceback block -ekoby

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

Successfully merging a pull request may close this issue.

2 participants