Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Cannot start watchtower-plugin #302

Open
johnongit opened this issue Nov 27, 2021 · 10 comments
Open

Cannot start watchtower-plugin #302

johnongit opened this issue Nov 27, 2021 · 10 comments
Assignees

Comments

@johnongit
Copy link

I'm looking for some help about watchtower-plugins usage.

Currently, I'm running c-lightning with docker. So, in order to add use watchtower-plugin, I've managed to build a new c-lightning image with python-teos.
it's looks like this
RUN mkdir -p /python-plugin/plugins && \ git clone https://github.com/talaia-labs/python-teos.git && \ cd python-teos && pip3 install . && \ cd watchtower-plugin && pip3 install -r requirements.txt

I'm able to build my customized image but the plugins does not start properly when I use it in the lightning.conf
plugin=/python-teos/watchtower-plugin/watchtower.py

watchtower-plugin fails with the following error

Traceback (most recent call last):
File "/python-teos/watchtower-plugin/watchtower.py", line 19, in
from common.config_loader import ConfigLoader, UnknownConfigParam
ImportError: cannot import name 'UnknownConfigParam' from 'common.config_loader' (/usr/local/lib/python3.9/dist-packages/common/config_loader.py)

I'm not really sure the way to use the plugin

@sr-gi sr-gi self-assigned this Nov 29, 2021
@sr-gi
Copy link
Member

sr-gi commented Nov 29, 2021

Hi @johnongit

Can you provide the steps to reproduce?

Have you simply edited the Dockerfile from c-lightning master and added:

RUN mkdir -p /python-plugin/plugins && \ git clone https://github.com/talaia-labs/python-teos.git && \ cd python-teos && pip3 install . && \ cd watchtower-plugin && pip3 install -r requirements.txt

@johnongit
Copy link
Author

Hello.
You can find my dockerfile here https://github.com/johnongit/lightning-1/blob/install-watchtower/Dockerfile

With this image, I configure a c-lightning on signet by adding the following line in my config file

plugin=/python-teos/watchtower-plugin/watchtower.py

The error are displayed during lightningd boot time.

@sr-gi
Copy link
Member

sr-gi commented Dec 1, 2021

Got it, I was able to reproduce.

The issue you're facing comes from a version error so to speak. You're pulling from master which has an updated version of teos-common but the watchtower-plugin is installing teos-common version 1.1, which is the stable version.

You should be able to fix the issue by running pip install . from the teos-common folder. That will update the teos-common code to match master. You could also pull from v1.1 instead but you'll be missing from some of the latest improvements both from the tower and the plugin.

I'll be documenting this, or releasing a minor version to fix it.

@johnongit
Copy link
Author

Hello.
Thx for your answer.
Sorry, I'm not really sure to catch it.
I'm unable to find teos-common folder

Currently, in my current dockerfile I'm running pip3 install . in python-teos and (after) in watchtower-plugin

@sr-gi
Copy link
Member

sr-gi commented Dec 2, 2021

Oh sorry, teos-common is the package name. The folder is called common and is located in the root of the repo.

@sr-gi
Copy link
Member

sr-gi commented Feb 8, 2022

Did that work @johnongit? Can this be closed?

@Jossec101
Copy link

Jossec101 commented May 19, 2022

Hi @sr-gi perhaps a new version like teos-common 0.1.X-unstable or whatever naming you might find appropiate would be really cool, I've been struggling until I found this issue when trying to run CLN v0.11.1 + python-teos from master and I really want to test the latest version. I think that maybe the watchtower-plugin requirements.txt should point to a unstable version of the common lib if master and point to the stable versions (based on the tag version) on tagged branches.

I let here a working Dockerfile where I made it work. Someone might find it useful (it uses the official lightnind docker image)

FROM elementsproject/lightningd:v0.11.1

RUN apt update -y
RUN apt-get install python3-pip -y
RUN apt-get install python3-dev -y
RUN python3 -m pip install --upgrade pip
RUN apt install build-essential -y

COPY ./python-teos /opt/python-teos

RUN pip3 install -r /opt/python-teos/watchtower-plugin/requirements.txt
RUN pip3 install pyln-client pyln-bolt1 pyln-bolt7 pyln-bolt2 pyln-bolt4 pyln-proto

RUN pip3 install /opt/python-teos
RUN chmod +x /opt/python-teos/watchtower-plugin/watchtower.py

@sr-gi
Copy link
Member

sr-gi commented May 19, 2022

Hi @Jossec101, sorry about that. I've been working on rust-teos (the rust version of the tower) in order to deprecate python-teos and I completely neglected fixing / documenting this issue.

Currently, there is a release of rust-teos and the CoreLN plugin is under review, so I think I'll just leave this issue open in case someone needs to fix the installation of python-teos.

I'd encourage you to migrate to rust-teos once that's ready given it's a far more efficient implementation, and this one will be (or has been, to be fair) discontinued.

@Jossec101
Copy link

Hi @Jossec101, sorry about that. I've been working on rust-teos (the rust version of the tower) in order to deprecate python-teos and I completely neglected fixing / documenting this issue.

Currently, there is a release of rust-teos and the CoreLN plugin is under review, so I think I'll just leave this issue open in case someone needs to fix the installation of python-teos.

I'd encourage you to migrate to rust-teos once that's ready given it's a far more efficient implementation, and this one will be (or has been, to be fair) discontinued.

Sorry for the off-topic, is rust-teos compatible with the python CLN plugin? Or shall I test it using the rust CLN plugin which you say is WIP, I don't mind if its not stable but at least functional, we are actually researching about Watchtowers and avoiding a deprecated codebase is way better.

@sr-gi
Copy link
Member

sr-gi commented May 19, 2022

The two codebase are actually not compatible. There are small discrepancies. I may write a migration script if current users ask for it though.

If you are gonna set up a new one, I'd encourage you to go for Rust. Especially if you want to try things out.

Feel free to ping me if you need any support (either here or on Slack).

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

No branches or pull requests

3 participants