Problem starting new install of core lightning

Hello,

My new install of core lightning is giving the following repeating error:

Starting Wait for Bitcoin Start
2025-03-04T13:57:42+00:00  Cleaning old lightning rpc
2025-03-04T13:57:42+00:00  Fetching system cert for REST interface
2025-03-04T13:57:42+00:00  Waiting for system cert key file...
2025-03-04T13:57:43+00:00  Waiting for system cert key file...
2025-03-04T13:57:44+00:00  Waiting for system cert key file...
2025-03-04T13:57:45+00:00  Waiting for system cert key file...
2025-03-04T13:57:46+00:00  Waiting for system cert key file...

One then has to uninstall as stopping the service doesn’t work.

I am using Bitcoin Knots as I want to use Datum gateway if that makes a difference.

I have a instances of LND and Alby hub which is running fine.

I’ve had a good search but to no avail. Any help is appreciated.

Many thanks!

That output in the CLN logs is specific to a small bit of code that moves the key around to a place we want to keep it…

mkdir -p /usr/local/libexec/c-lightning/plugins/c-lightning-REST/certs
cp /mnt/cert/rest.key.pem /usr/local/libexec/c-lightning/plugins/c-lightning-REST/certs/key.pem

For the check for it to be looping can only mean that the key was not in that first original place. Which means something earlier on failed.

Is this a fresh install of CLN? And when you uninstall CLN, you install it again, and the same thing happnes?

Many thanks again for looking.

I have just made sure to uninstall and re-install CLN. I configured and started the service.

I notice in the log that the old log entries are still present and new entries start below with the ‘Waiting for system cert key file…’ issue.

I ssh’d and the /mnt/cert directory doesn’t exist.

Quick update - the ‘rest.key.pem’ file doesnt exist anywhere on my system.

In that case, rather than providing you with information that shouldn’t really form part of StartOS support for you to perform actions that you shouldn’t need to do at all… we’d instead need to work on addressing the actual problem.

Out of every user of StartOS that has installed CLN fresh without a problem, what makes your situation different? Hopefully it should be something obvious that you can declare right away. If we can identify something, then we have something to work on.

I do have a bit of a non-standard installation:

  • DIY build on an optiplex 3040
  • Installed startOS
  • Installed bitcoin core and LND
  • Copied over blockchain and LND directory from a raspibolt build
  • Bitcoin core and LND working
  • Downgraded to Bitcoin Knots so I could use datum gateway
  • Knots, LND and Datum all working
  • Tried to install CLN and noticed this problem

Maybe some of that will give a clue? I’ve tried the rebuild today from system menu and still the same problem.

Thanks again.

No really. I see no reason why you can’t simply install CLN, press start then have it work. I’ll see if I can find out anything more for you.

This seems to be identical to a similar issue that was reported…

What that seemed to be caused by was the need to enter a chrooted environment, which you will have needed to do with DATUM.

You’ll find in that link the solution was found to be…

cp /embassy-data/package-data/volumes/c-lightning/data/main/bitcoin/server-key.pem /var/lib/embassy/ssl/c-lightning/rest/rest.key.pem
cp /embassy-data/package-data/volumes/c-lightning/data/main/bitcoin/server.pem /var/lib/embassy/ssl/c-lightning/rest/rest.cert.pem

…which should still be valid. We’ll be looking into what has been causing this.

Unfortunately the keys and directory below have not yet been created. When I get some time I might rebuild the system, installing core lightning first but I’ll need to get some time to do this.

I was looking how to manually create the keys from the blockstream instructions. I’ll have to invesigate this further.