-
Notifications
You must be signed in to change notification settings - Fork 43
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
Could not run as a plugin, but works perfectly as a standalone service #116
Comments
Hi @sethforprivacy is it possible for you to share your core lightning config settings? It should be in the |
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 |
what all do you have in the Keep in mind that C-Lightning-REST is not an "official" plugin, so not sure if there is manifest where it needs to be registered. But that's not required for it to run as a plugin. May be, I need to get it registered as an official plugin (not sure if that's a thing either) 😄 |
Adding my 2c, maybe it helps: |
I just got bit by the same exact issue - where the plugin config in the
|
Hi @litch can you share your config file settings? |
The config file sections were exactly as in the readme:
Similarly to @sethforprivacy - it works swimmingly if I run it otherwise. |
@saubyk - I don't have any plugins in there, just this structure: tiny in tiny in ~ on master [!?] took 5s ❯ sudo tree /etc/lightningd
/etc/lightningd
├── lightningd.conf
├── lightningd.log
└── lightning-rpc
0 directories, 3 files
tiny in tiny in ~ on master [!?] ❯ sudo tree /home/lightningd/.lightning
/home/lightningd/.lightning
└── bitcoin
├── backup.lock
├── crash.log.20220517195817
├── crash.log.20220522165328
├── data.clboss
├── gossip_store
├── hsm_secret
├── keys.clboss
├── lightningd.sqlite3
└── lightning-rpc
1 directory, 9 files I was loading the c-lightning-REST plugin from a directory in /home/lightningd (where it's running from now as a standalone app without issues under the same user as lightningd). @devastgh - plugin.js is properly permissioned for the user, and has the execute bit set: -rwxrwxr-x 1 lightningd lightningd 1698 May 9 22:31 plugin.js Happy to help however I can! |
Still the same issue with v0.8.0:
Config tested:
Folder structure for cln-REST:
|
Could you just check it without any options specified in c-lightning config? |
Same issue, doesn't help:
|
Maybe try it with just |
Same error on fresh install, it works when run as it's own service but fails trying to run it as plugin. |
Could you run the plugin after adding I tried all above mentioned scenarios on my local Ubuntu 22 and they all are working successfully. It seems like some local setting issue. |
I'll test again ASAP. |
|
Still fails to start the plugin, above seems the error returned with execmode=test set. |
The only thing I can think of that may be causing this is the recommended hardening in the lightningd systemd script:
Testing without it now. |
Disabling those protections resolved the issue, will nail down which one is to blame shortly. |
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. |
@sethforprivacy Thank you for the quick testing and solution. @jochemin & @litch Could you also verify your permissions or add |
I was also running the "hardening" systemd script, and that makes perfect sense as to the cause. I echo the, "I would prefer to run this and have the thing hardened" but likewise don't have enough insight into the changes required to have a strong opinion about whether that would be better than, perhaps a log message that detects that flag and tells the user that that is the cause of the error. |
No luck for me. This is my systemd service: `# /etc/systemd/system/lightningd.service [Unit] [Service] `# Process management `# Directory creation and permissions
`# Mount /usr, /boot/ and /etc read-only for the process.
[Install] I've commented MemoryDenyWriteExecute but same error: 2022-11-04T18:21:08.430Z INFO plugin-plugin.js: Killing plugin: exited before replying to getmanifest |
Try also commenting out this line, I realized I had it commented out already for other issues:
|
@jochemin Also add |
nov 04 19:32:02 jbtc lightningd[537230]: /usr/bin/env: 'node': No such file or directory It seems a problem with node executable. I've checked and I have node executable in /user/bin Out of ideas |
Nope, same error. |
@jochemin It either looks like an incorrect naming issue which can be resolved via symlink OR nodejs-legacy installation might work. Below are some links for your reference related to these solutions: |
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. |
@jochemin Thank you for the update. Please post your solution, if you find any, as it might help other users. I am closing this issue now as there is no action required from us anymore. |
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! |
…de.js plugins See-also: Ride-The-Lightning/c-lightning-REST#116 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…de.js plugins See-also: Ride-The-Lightning/c-lightning-REST#116 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…de.js plugins See-also: Ride-The-Lightning/c-lightning-REST#116 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…de.js plugins See-also: Ride-The-Lightning/c-lightning-REST#116 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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!
The text was updated successfully, but these errors were encountered: