<p>Can anybody tell me if this is an issue when loading the zeromq plugin for Core Lightning?</p>
<pre><code>2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py: Traceback (most recent call last):
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \&quot;/usr/local/lib/python3.11/dist-packages/pyln/client/plugin.py\&quot;&gt;
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     result = self._exec_func(method.func, request)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \&quot;/usr/local/lib/python3.11/dist-packages/pyln/client/plugin.py\&quot;&gt;
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     ret = func(*ba.args, **ba.kwargs)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \&quot;/usr/local/lib/python3.11/dist-packages/pyln/client/plugin.py\&quot;&gt;
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     return self._exec_func(self.child_init, request)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \&quot;/usr/local/lib/python3.11/dist-packages/pyln/client/plugin.py\&quot;&gt;
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     ret = func(*ba.args, **ba.kwargs)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \&quot;/home/main/.lightning/reckless/plugins/plugins/zmq/cl-zmq.py\&quot;,&gt;
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     Setup.check_option_warnings(options, plugin)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \&quot;/home/main/.lightning/reckless/plugins/plugins/zmq/cl-zmq.py\&quot;,&gt;
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     for endpoint in Setup._iter_endpoints_not_ok(options):
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \&quot;/home/main/.lightning/reckless/plugins/plugins/zmq/cl-zmq.py\&quot;,&gt;
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     endpoint = options[endpoint_opt]
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:                ~~~~~~~^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py: KeyError: 'zmq-pub-channel-opened'
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:
</code></pre>
<p>I'm running the example-subscriber.py file and I never see a shutdown event logged. I did add shutdown to the notification list.</p>
<pre><code>python3 example-subscriber.py --zmq-sub-shutdown=tcp://127.0.0.1:5555
</code></pre>
<p>Here's how I'm starting the plugin:</p>
<pre><code>lightningd --regtest --daemon --plugin=/home/main/.lightning/reckless/plugins/plugins/zmq/cl-zmq.py --log-file=/home/main/.lightning/logs.txt --zmq-pub-shutdown=tcp://127.0.0.1:5555
</code></pre>

CC BY-SA 4.0
2024-06-09T19:48:09.943Z
Hi, I updated the formatting in your post, and edited the title to give a sense of what the question is about. Please feel free to further edit the title, if you feel that I didn’t capture the intent of your post.
Murch
CC BY-SA 4.0
2024-06-09T20:04:38.723Z
`KeyError` is a generic python error indicating that a key does not exist in a dict. In this case, there is a dict named `options`, and the code was trying to find a key named `zmq-pub-channel-opened` in `options`, but it does not exist, so Python threw a `KeyError`. This seems like a bug in the ZMQ plugin and I would suggest opening an issue in its github repo.
Ava Chow
CC BY-SA 4.0
2024-06-09T20:09:46.447Z
Will do. Thank you for the response.
user152547
<lightning-network><core-lightning><zeromq>
What does KeyError: 'zmq-pub-channel-opened' mean?
user152547
# What does KeyError: 'zmq-pub-channel-opened' mean?

(Asked by: username_0 on 2024-06-09)

Can anybody tell me if this is an issue when loading the zeromq plugin for Core Lightning?

```
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py: Traceback (most recent call last):
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \"/usr/local/lib/python3.11/dist-packages/pyln/client/plugin.py\">
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     result = self._exec_func(method.func, request)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \"/usr/local/lib/python3.11/dist-packages/pyln/client/plugin.py\">
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     ret = func(*ba.args, **ba.kwargs)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \"/usr/local/lib/python3.11/dist-packages/pyln/client/plugin.py\">
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     return self._exec_func(self.child_init, request)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \"/usr/local/lib/python3.11/dist-packages/pyln/client/plugin.py\">
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     ret = func(*ba.args, **ba.kwargs)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \"/home/main/.lightning/reckless/plugins/plugins/zmq/cl-zmq.py\",>
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     Setup.check_option_warnings(options, plugin)
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \"/home/main/.lightning/reckless/plugins/plugins/zmq/cl-zmq.py\",>
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     for endpoint in Setup._iter_endpoints_not_ok(options):
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:   File \"/home/main/.lightning/reckless/plugins/plugins/zmq/cl-zmq.py\",>
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:     endpoint = options[endpoint_opt]
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:                ~~~~~~~^^^^^^^^^^^^^^
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py: KeyError: 'zmq-pub-channel-opened'
2024-06-09T14:54:53.169Z INFO    plugin-cl-zmq.py:

```

I'm running the example-subscriber.py file and I never see a shutdown event logged. I did add shutdown to the notification list.

```
python3 example-subscriber.py --zmq-sub-shutdown=tcp://127.0.0.1:5555

```

Here's how I'm starting the plugin:

```
lightningd --regtest --daemon --plugin=/home/main/.lightning/reckless/plugins/plugins/zmq/cl-zmq.py --log-file=/home/main/.lightning/logs.txt --zmq-pub-shutdown=tcp://127.0.0.1:5555

```

**Tags:** lightning-network, core-lightning, zeromq

> **Comments:**
> **username_1**: Hi, I updated the formatting in your post, and edited the title to give a sense of what the question is about. Please feel free to further edit the title, if you feel that I didn’t capture the intent of your post.  
> **username_2**: `KeyError` is a generic python error indicating that a key does not exist in a dict. In this case, there is a dict named `options`, and the code was trying to find a key named `zmq-pub-channel-opened` in `options`, but it does not exist, so Python threw a `KeyError`. This seems like a bug in the ZMQ plugin and I would suggest opening an issue in its github repo.  
> **username_0**: Will do. Thank you for the response.  

---

## 0 answers

