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

rebalance plugin using lightning-cli rebalancereport: 'plugin has no attribute 'mutex' #388

Open
unsettledroell404 opened this issue Aug 29, 2022 · 7 comments

Comments

@unsettledroell404
Copy link

I have no idea what it means, I thought I would report it here.
Running lightning-cli rebalancereport gives;

{
"code": -32600,
"message": "Error while processing rebalancereport: 'Plugin' object has no attribute 'mutex'",
"traceback": "Traceback (most recent call last):\n File "/usr/local/lib/python3.10/dist-packages/pyln/client/plugin.py", line 631, in _dispatch_request\n result = self._exec_func(method.func, request)\n File "/usr/local/lib/python3.10/dist-packages/pyln/client/plugin.py", line 613, in _exec_func\n return func(*ba.args, **ba.kwargs)\n File "/data/cln/plugins-available/rebalance/rebalance.py", line 739, in rebalancereport\n res["rebalanceall_is_running"] = plugin.mutex.locked()\nAttributeError: 'Plugin' object has no attribute 'mutex'\n"
}

@unsettledroell404
Copy link
Author

It seems that the init() is not run on startup.

@unsettledroell404
Copy link
Author

unsettledroell404 commented Sep 10, 2022

error in startup: plugin-rebalance.py: TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

I think this is also fixed with #5574

I can not yet get the fix to work though. When using

cd lightning/contrib/pyln-client
poetry install
as mentioned here

running pip show pyln-client does not return anything and lightningd does not start.
I.e. it is not installed, or installed incorrectly. Not sure how to actually install it.

@unsettledroell404
Copy link
Author

Supposedly it must be done like #5115.
Some more instructions are required. How should requirements.txt be changed and what should be done after that?

@BTCBellyButton
Copy link

BTCBellyButton commented Oct 5, 2022

Same here after updating to CLN v0.12.0f or

lightning-cli rebalance -k outgoing_scid=xxxx incoming_scid=xxxx
{
   "code": -32600,
   "message": "Error while processing rebalance: 'Plugin' object has no attribute 'getroute'",
   "traceback": "Traceback (most recent call last):\n  File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 639, in _dispatch_request\n    result = self._exec_func(method.func, request)\n  File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 619, in _exec_func\n    ret = func(*ba.args, **ba.kwargs)\n  File \"/mnt/md0/C-Lightning/plugins.bak/rebalance/rebalance.py\", line 212, in rebalance\n    getroute = plugin.getroute\nAttributeError: 'Plugin' object has no attribute 'getroute'\n"

@BTCBellyButton
Copy link

Log with rebalance.py plugin dynamic start and subsequent attempted use:

2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py: Traceback (most recent call last):
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:   File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 639, in _dispatch_request
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:     result = self._exec_func(method.func, request)
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:   File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 619, in _exec_func
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:     ret = func(*ba.args, **ba.kwargs)
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:   File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 961, in _init
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:     return self._exec_func(self.child_init, request)
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:   File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 619, in _exec_func
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:     ret = func(*ba.args, **ba.kwargs)
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:   File \"/mnt/md0/C-Lightning/plugins.bak/rebalance/rebalance.py\", line 792, in init
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:     config = plugin.rpc.listconfigs()
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:   File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/lightning.py\", line 911, in listconfigs
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:     return self.call(\"listconfigs\", payload)
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:   File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/lightning.py\", line 354, in call
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:     this_id = self.get_json_id(method, cmdprefix)
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:   File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/lightning.py\", line 338, in get_json_id
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py:     this_id = cmdprefix + '/' + this_id
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py: TypeError: unsupported operand type(s) for +: 'int' and 'str'
2022-10-04T23:59:35.784Z INFO    plugin-rebalance.py: 
2022-10-05T00:01:04.473Z INFO    plugin-rebalance.py: Traceback (most recent call last):
2022-10-05T00:01:04.473Z INFO    plugin-rebalance.py:   File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 639, in _dispatch_request
2022-10-05T00:01:04.473Z INFO    plugin-rebalance.py:     result = self._exec_func(method.func, request)
2022-10-05T00:01:04.473Z INFO    plugin-rebalance.py:   File \"/home/go/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 619, in _exec_func
2022-10-05T00:01:04.473Z INFO    plugin-rebalance.py:     ret = func(*ba.args, **ba.kwargs)
2022-10-05T00:01:04.473Z INFO    plugin-rebalance.py:   File \"/mnt/md0/C-Lightning/plugins.bak/rebalance/rebalance.py\", line 212, in rebalance
2022-10-05T00:01:04.473Z INFO    plugin-rebalance.py:     getroute = plugin.getroute
2022-10-05T00:01:04.473Z INFO    plugin-rebalance.py: AttributeError: 'Plugin' object has no attribute 'getroute'
2022-10-05T00:01:04.473Z INFO    plugin-rebalance.py: 

@sha-265
Copy link

sha-265 commented Nov 22, 2023

I have the same problem with CLN 23.08.1, any suggestions?

@BTCBellyButton
Copy link

BTCBellyButton commented Nov 22, 2023

I have the same problem with CLN 23.08.1, any suggestions?

I switched to the circular plugin. I didn't try this one again after switching.

https://github.com/giovannizotta/circular

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

No branches or pull requests

3 participants