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

Plugins not working due to pyln.proto ShortChannelId import bug in gossmap.py #4848

Closed
robotparty opened this issue Oct 7, 2021 · 2 comments · Fixed by #4852
Closed

Plugins not working due to pyln.proto ShortChannelId import bug in gossmap.py #4848

robotparty opened this issue Oct 7, 2021 · 2 comments · Fixed by #4852

Comments

@robotparty
Copy link

Issue and Steps to Reproduce

Error below is produced by all plugins.

Add any plugin to this setup:
lightningd version: v0.10.1-193-gbb307fa
pyln-client: 0.10.1
pyln-proto: 0.10.1

I fixed it on my own install by changing line 5 in /usr/local/lib/python3.8/dist-packages/pyln/client/gossmap.py to read:
from pyln.proto.primitives import ShortChannelId, PublicKey

Error message:

Traceback (most recent call last):
  File "/home/lightningd/.lightning/plugins/rebalance/rebalance.py", line 2, in <module>
    from pyln.client import Plugin, Millisatoshi, RpcError
  File "/usr/local/lib/python3.8/dist-packages/pyln/client/__init__.py", line 3, in <module>
    from .gossmap import Gossmap, GossmapNode, GossmapChannel, GossmapNodeId
  File "/usr/local/lib/python3.8/dist-packages/pyln/client/gossmap.py", line 5, in <module>
    from pyln.proto import ShortChannelId, PublicKey
ImportError: cannot import name 'ShortChannelId' from 'pyln.proto' (/home/lightningd/.local/lib/python3.8/site-packages/pyln/proto/__init__.py)

getinfo output

$ lc getinfo
{
   "id": "02daf5b7181aaf6eb4533b4b050944e949fc5f274c564341f14ef5748ed090fcd3",
   "alias": "satsori-earth",
   "color": "dc42f4",
   "num_peers": 6,
   "num_pending_channels": 0,
   "num_active_channels": 6,
   "num_inactive_channels": 0,
   "address": [
      {
         "type": "torv3",
         "address": "w7tgyghtsbwcoodnqqwooubboptl7uvh3f32jmbyzk344kgnxlmnjsid.onion",
         "port": 9735
      }
   ],
   "binding": [
      {
         "type": "ipv4",
         "address": "127.0.0.1",
         "port": 9735
      },
      {
         "type": "ipv4",
         "address": "10.88.88.68",
         "port": 9735
      }
   ],
   "version": "v0.10.1-193-gbb307fa",
   "blockheight": 703998,
   "network": "bitcoin",
   "msatoshi_fees_collected": 0,
   "fees_collected_msat": "0msat",
   "lightning-dir": "/home/lightningd/.lightning/bitcoin"
}
@vincenzopalazzo
Copy link
Contributor

Hi @robotparty,

Unable to reproduce your stack trace with the latest version of master.

With the lightning version v0.10.1-193-gbb307fa I'm assuming that you are compiling from the source, and maybe you can try to follow the following procedure that works on my machine and share the error and also what command will fail to better understanding what happens.

  1. cd lightning && ./configure
  2. pip3 install --use-feature=in-tree-build -r requirements.txt
  3. make -j$(nproc) && sudo make install
  4. clightning plugin start /home/vincent/bitcoin/ln_plugins/plugins/rebalance/rebalance.py

Thanks!

@cdecker
Copy link
Member

cdecker commented Oct 8, 2021

Seems like there is a missing requirements.txt entry in pyln-client to pyln-proto should be fixed in the next release.

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

Successfully merging a pull request may close this issue.

3 participants