ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.83k stars 896 forks source link

Cannot install prerequisite for clnrest plugin #7453

Closed teemie1 closed 2 months ago

teemie1 commented 3 months ago

Issue and Steps to Reproduce

My environment OS: Ubuntu 24.04 CLN Version : 24.05 Cannot install prerequisite for clnrest plugin

root@yoga500:~# pip3 install --user flask-cors flask-restx pyln-client flask-socketio gevent gevent-websocket
Requirement already satisfied: flask-cors in ./.local/lib/python3.12/site-packages (4.0.1)
Requirement already satisfied: flask-restx in ./.local/lib/python3.12/site-packages (1.3.0)
Collecting pyln-client
  Using cached pyln_client-24.5-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: flask-socketio in ./.local/lib/python3.12/site-packages (5.3.6)
Requirement already satisfied: gevent in ./.local/lib/python3.12/site-packages (24.2.1)
Requirement already satisfied: gevent-websocket in ./.local/lib/python3.12/site-packages (0.10.1)
Requirement already satisfied: Flask>=0.9 in /usr/lib/python3/dist-packages (from flask-cors) (3.0.2)
Requirement already satisfied: aniso8601>=0.82 in ./.local/lib/python3.12/site-packages (from flask-restx) (9.0.1)
Requirement already satisfied: jsonschema in /usr/lib/python3/dist-packages (from flask-restx) (4.10.3)
Requirement already satisfied: werkzeug!=2.0.0 in /usr/lib/python3/dist-packages (from flask-restx) (3.0.1)
Requirement already satisfied: pytz in /usr/lib/python3/dist-packages (from flask-restx) (2024.1)
Requirement already satisfied: importlib-resources in ./.local/lib/python3.12/site-packages (from flask-restx) (6.4.0)
Collecting pyln-bolt7>=1.0 (from pyln-client)
  Using cached pyln_bolt7-1.0.246-py3-none-any.whl.metadata (436 bytes)
Collecting pyln-proto>=23 (from pyln-client)
  Using cached pyln_proto-24.5-py3-none-any.whl.metadata (2.0 kB)
Requirement already satisfied: python-socketio>=5.0.2 in ./.local/lib/python3.12/site-packages (from flask-socketio) (5.11.3)
Requirement already satisfied: zope.event in ./.local/lib/python3.12/site-packages (from gevent) (5.0)
Requirement already satisfied: zope.interface in /usr/lib/python3/dist-packages (from gevent) (6.1)
Requirement already satisfied: greenlet>=3.0rc3 in ./.local/lib/python3.12/site-packages (from gevent) (3.0.3)
Requirement already satisfied: Jinja2>=3.1.2 in /usr/lib/python3/dist-packages (from Flask>=0.9->flask-cors) (3.1.2)
Requirement already satisfied: itsdangerous>=2.1.2 in /usr/lib/python3/dist-packages (from Flask>=0.9->flask-cors) (2.1.2)
Requirement already satisfied: click>=8.1.3 in /usr/lib/python3/dist-packages (from Flask>=0.9->flask-cors) (8.1.6)
Requirement already satisfied: blinker>=1.6.2 in /usr/lib/python3/dist-packages (from Flask>=0.9->flask-cors) (1.7.0)
Collecting PySocks<2,>=1 (from pyln-proto>=23->pyln-client)
  Using cached PySocks-1.7.1-py3-none-any.whl.metadata (13 kB)
Collecting base58<3.0.0,>=2.1.1 (from pyln-proto>=23->pyln-client)
  Using cached base58-2.1.1-py3-none-any.whl.metadata (3.1 kB)
Collecting bitstring<5.0.0,>=4.1.0 (from pyln-proto>=23->pyln-client)
  Using cached bitstring-4.2.3-py3-none-any.whl.metadata (5.0 kB)
Collecting coincurve<19,>=18 (from pyln-proto>=23->pyln-client)
  Using cached coincurve-18.0.0.tar.gz (2.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [51 lines of output]
      running dist_info
      creating /tmp/pip-modern-metadata-81bbotcs/coincurve.egg-info
      writing /tmp/pip-modern-metadata-81bbotcs/coincurve.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-modern-metadata-81bbotcs/coincurve.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-modern-metadata-81bbotcs/coincurve.egg-info/requires.txt
      writing top-level names to /tmp/pip-modern-metadata-81bbotcs/coincurve.egg-info/top_level.txt
      writing manifest file '/tmp/pip-modern-metadata-81bbotcs/coincurve.egg-info/SOURCES.txt'
      reading manifest file '/tmp/pip-modern-metadata-81bbotcs/coincurve.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      writing manifest file '/tmp/pip-modern-metadata-81bbotcs/coincurve.egg-info/SOURCES.txt'
      creating '/tmp/pip-modern-metadata-81bbotcs/coincurve-18.0.0.dist-info'
      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/build_meta.py", line 368, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 266, in <module>
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/_distutils/core.py", line 184, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/_distutils/core.py", line 200, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/_distutils/dist.py", line 970, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/dist.py", line 974, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/_distutils/dist.py", line 989, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/command/dist_info.py", line 97, in run
          bdist_wheel = self.get_finalized_command('bdist_wheel')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/_distutils/cmd.py", line 302, in get_finalized_command
          cmd_obj = self.distribution.get_command_obj(command, create)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3hwsa6lt/overlay/local/lib/python3.12/dist-packages/setuptools/_distutils/dist.py", line 863, in get_command_obj
          cmd_obj = self.command_obj[command] = klass(self)
                                                ^^^^^^^^^^^
      TypeError: 'NoneType' object is not callable
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

When I start core lighting, there is error about start the plugin.

2024-07-07T10:46:50.609Z INFO lightningd: v24.05 2024-07-07T10:46:50.674Z DEBUG lightningd: Opened log file /data/lightningd/cln.log 2024-07-07T10:46:50.680Z DEBUG plugin-manager: started(89245) /usr/libexec/c-lightning/plugins/autoclean 2024-07-07T10:46:50.684Z DEBUG plugin-manager: started(89246) /usr/libexec/c-lightning/plugins/chanbackup 2024-07-07T10:46:50.688Z DEBUG plugin-manager: started(89247) /usr/libexec/c-lightning/plugins/bcli 2024-07-07T10:46:50.692Z DEBUG plugin-manager: started(89248) /usr/libexec/c-lightning/plugins/commando 2024-07-07T10:46:50.695Z DEBUG plugin-manager: started(89249) /usr/libexec/c-lightning/plugins/fetchinvoice 2024-07-07T10:46:50.699Z DEBUG plugin-manager: started(89250) /usr/libexec/c-lightning/plugins/funder 2024-07-07T10:46:50.703Z DEBUG plugin-manager: started(89251) /usr/libexec/c-lightning/plugins/topology 2024-07-07T10:46:50.707Z DEBUG plugin-manager: started(89252) /usr/libexec/c-lightning/plugins/keysend 2024-07-07T10:46:50.710Z DEBUG plugin-manager: started(89253) /usr/libexec/c-lightning/plugins/offers 2024-07-07T10:46:50.714Z DEBUG plugin-manager: started(89254) /usr/libexec/c-lightning/plugins/pay 2024-07-07T10:46:50.718Z DEBUG plugin-manager: started(89255) /usr/libexec/c-lightning/plugins/recover 2024-07-07T10:46:50.722Z DEBUG plugin-manager: started(89256) /usr/libexec/c-lightning/plugins/txprepare 2024-07-07T10:46:50.725Z DEBUG plugin-manager: started(89257) /usr/libexec/c-lightning/plugins/cln-renepay 2024-07-07T10:46:50.729Z DEBUG plugin-manager: started(89258) /usr/libexec/c-lightning/plugins/spenderp 2024-07-07T10:46:50.733Z DEBUG plugin-manager: started(89259) /usr/libexec/c-lightning/plugins/sql 2024-07-07T10:46:50.737Z DEBUG plugin-manager: started(89260) /usr/libexec/c-lightning/plugins/cln-grpc 2024-07-07T10:46:50.741Z DEBUG plugin-manager: started(89262) /usr/libexec/c-lightning/plugins/bookkeeper 2024-07-07T10:46:50.746Z DEBUG plugin-manager: started(89263) /usr/libexec/c-lightning/plugins/clnrest/clnrest 2024-07-07T10:46:50.750Z DEBUG plugin-manager: started(89264) /usr/libexec/c-lightning/plugins/wss-proxy/wss-proxy 2024-07-07T10:46:50.896Z INFO plugin-wss-proxy: Killing plugin: disabled itself: No module named 'pyln' 2024-07-07T10:46:51.348Z INFO plugin-clnrest: Killing plugin: disabled itself: No module named 'pyln' 2024-07-07T10:46:51.348Z DEBUG lightningd: io_break: check_plugins_manifests 2024-07-07T10:46:51.348Z DEBUG lightningd: io_loop_with_timers: plugins_init 2024-07-07T10:46:51.349Z DEBUG lightningd: testing /usr/libexec/c-lightning/lightning_channeld 2024-07-07T10:46:51.350Z DEBUG lightningd: testing /usr/libexec/c-lightning/lightning_closingd 2024-07-07T10:46:51.352Z DEBUG lightningd: testing /usr/libexec/c-lightning/lightning_connectd 2024-07-07T10:46:51.353Z DEBUG lightningd: testing /usr/libexec/c-lightning/lightning_gossipd 2024-07-07T10:46:51.355Z DEBUG lightningd: testing /usr/libexec/c-lightning/lightning_hsmd 2024-07-07T10:46:51.356Z DEBUG lightningd: testing /usr/libexec/c-lightning/lightning_onchaind 2024-07-07T10:46:51.357Z DEBUG lightningd: testing /usr/libexec/c-lightning/lightning_openingd 2024-07-07T10:46:51.359Z DEBUG hsmd: pid 89273, msgfd 53 2024-07-07T10:46:51.360Z DEBUG hsmd: capability +WIRE_HSMD_CHECK_PUBKEY 2024-07-07T10:46:51.360Z DEBUG hsmd: capability +WIRE_HSMD_SIGN_ANY_DELAYED_PAYMENT_TO_US 2024-07-07T10:46:51.360Z DEBUG hsmd: capability +WIRE_HSMD_SIGN_ANCHORSPEND 2024-07-07T10:46:51.360Z DEBUG hsmd: capability +WIRE_HSMD_SIGN_HTLC_TX_MINGLE 2024-07-07T10:46:51.360Z DEBUG hsmd: capability +WIRE_HSMD_SIGN_SPLICE_TX 2024-07-07T10:46:51.360Z DEBUG hsmd: capability +WIRE_HSMD_CHECK_OUTPOINT

getinfo output

lightningd@yoga500:~$ lightning-cli getinfo { "id": "024c944b289031a00fb64fb8fda65aa2f079d6b943046964e5c3c0b097ad83e21a", "alias": "teemie-cln ", "color": "ffa500", "num_peers": 0, "num_pending_channels": 0, "num_active_channels": 0, "num_inactive_channels": 0, "address": [ { "type": "torv3", "address": "7jbg7gwc7xuep3kx44pnsn6gdxlxjrsjmwi2v6hxg5mta7oa74g4l6ad.onion", "port": 9735 } ], "binding": [ { "type": "ipv4", "address": "0.0.0.0", "port": 9735 } ], "version": "v24.05", "blockheight": 1238478, "network": "signet", "fees_collected_msat": 0, "lightning-dir": "/home/lightningd/.lightning/signet", "our_features": { "init": "080000000000000000000000000008a0882a8a59a1", "node": "080000000000000000000000000088a0882a8a59a1", "channel": "", "invoice": "02000002024100" } }

daywalker90 commented 3 months ago

this is likely because you are using python 3.12. There was a change that makes all released versions of pyln-client incompatible with python 3.12 because of an older dependency called coincurve. You can either downgrade python to 3.11 or build pyln-client from master where coincurve was updated or update coincurve manually in an older pyln-client version, see here: https://github.com/ElementsProject/lightning/pull/7416

teemie1 commented 3 months ago

I've build pyln-client from master and it's work. Problem solved. Thank you for your help.