c-lightning-REST: Could not run as a plugin, but works perfectly as a standalone service
Hi there, just finished building out a Core LN + c-lightning-REST + RTL setup, and ran into this error when trying to use c-lightning-REST as a plugin for lightningd:
plugin-plugin.js: Killing plugin: exited before replying to getmanifest
The plugin works perfectly when run as it’s own service (systemd script here, config file here), but no matter what I tried lightningd would crash instantly on trying to load the plugin.
Here are the commands I ran before adding it to the lightningd config file:
5 wget https://github.com/Ride-The-Lightning/c-lightning-REST/releases/download/v0.7.2/v0.7.2.tar.gz.asc
6 tar -xvf v0.7.2.tar.gz
7 cd c-lightning-REST-0.7.2
8 npm install --only=prod
Then I added via full path as specified here: https://github.com/Ride-The-Lightning/c-lightning-REST#option-2-run-as-c-lightning-plugin
Not sure how to get better logs, but happy to collect what I can for you!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 31
Commits related to this issue
- lightningd.service: note that the hardening setting seems to break node.js plugins See-also: https://github.com/Ride-The-Lightning/c-lightning-REST/issues/116 Signed-off-by: Rusty Russell <rusty@rust... — committed to rustyrussell/lightning by rustyrussell 2 years ago
- lightningd.service: note that the hardening setting seems to break node.js plugins See-also: https://github.com/Ride-The-Lightning/c-lightning-REST/issues/116 Signed-off-by: Rusty Russell <rusty@rust... — committed to ElementsProject/lightning by rustyrussell 2 years ago
- lightningd.service: note that the hardening setting seems to break node.js plugins See-also: https://github.com/Ride-The-Lightning/c-lightning-REST/issues/116 Signed-off-by: Rusty Russell <rusty@rust... — committed to ddustin/lightning by rustyrussell 2 years ago
- lightningd.service: note that the hardening setting seems to break node.js plugins See-also: https://github.com/Ride-The-Lightning/c-lightning-REST/issues/116 Signed-off-by: Rusty Russell <rusty@rust... — committed to ddustin/lightning by rustyrussell 2 years ago
Disabling those protections resolved the issue, will nail down which one is to blame shortly.
I’ve solved it. The problem was I had this line in the systemd service:
Environment=PATH=/home/jochemin/clightning/usr/bin:/home/jochemin/bitcoin/bin
But node executable is in /usr/bin so it was not accesible. I’ve added that route and now it works perfect!
Thanks @ShahanaFarooqui , no luck for me. My executable name is node so no naming isuue, I installed nodejs from Ubuntu repositories with sudo apt-install nodejs.
I’ve tried to install last LTS version but the error continues.
Mi SO is Ubuntu Server 22.04 and node version is 18.12.1
I’ll keep trying.
@sethforprivacy Thank you for the quick testing and solution.
@jochemin & @litch Could you also verify your permissions or add
rest-execmode=testto get some failure insights. I am keeping this issue open till then.Narrowed down to this:
If the user has this hardening measure enabled in their systemd script, c-lightning-REST cannot function as a plugin.
Disabling the hardening has everything working perfectly!
Ideally there is some way you can have both this hardening and the plugin, but that’s far above my pay grade.
I’ll test again ASAP.
Here it is:
https://paste.sethforprivacy.com/?3e2080ae7cbf5ad0#BMcHpNDXn4rtv8SjQ8sd2HNTxxjMbqkYyLisHGdYgEU
When I was trying c-lightning-rest as a plugin I called it via full-path, i.e.:
My best guess would be it being related to lightningd not properly recognizing the location of the
nodebinary, but nothing I could find to resolve that worked.