<p>I checked your config locally and I think your main issue is that the <code>bitcoin-datadir</code> is not properly escaped. Your external drive name has a space in it, which may be causing the parsing to fail. I'd suggest you try passing it as:</p>
<pre><code>bitcoin-datadir=&quot;/media/myuser/Seagate Expansion Drive/bitcoin/&quot;
</code></pre>
<p>Regarding <code>rpcconnect</code>, I don't see anything wrong with it, your config worked in my local setup. Something worth mentioning though: you don't really need to specify <code>bitcoin-rpcconnect</code> and <code>bitcoin-rpcport</code>. Based on your config you are running on default (that is, localhost on the default mainnet port), so those are the same <code>cln</code> will pick if you just don't overwrite them. Same goes for <code>network=bitcoin</code>, that's the default AFAIK.</p>

CC BY-SA 4.0
2023-12-18T16:42:15.137Z
Adding quotes around the datadir did not work. I tried several different ways of entering the datadir, even commenting it out, but nothing worked. Unfortunately, I can't change the name of that directory in order to remove the spaces.
Zephyrus
CC BY-SA 4.0
2023-12-18T16:50:40.807Z
That is pretty odd. What CLN version are you running?

Also, can you try a minimal config file placed on the default location? That is, create a file called `config` under `~/.lightning` and add only `bitcoin-rpcuser`, `bitcoin-rpcpassword` and `bitcoin-cli`. Then run `lightningd` without any other param.
sr_gi
CC BY-SA 4.0
2023-12-18T16:58:48.287Z
@Zephyrus: If the spaces are really the issue, you could perhaps make a soft link: `ln -s "/media/myuser/Seagate\ Expansion\ Drive/bitcoin/" "~/bitcoin-dir"` and then specify `~/bitcoin-dir` as the data directory in your configuration. (Don't trust, verify: read the man page for ln. `man ln` ;))
Murch
CC BY-SA 4.0
2023-12-18T17:01:13.703Z
Also, just spitballing here… if you put the name into quotes, do you still need to escape the spaces?
Murch
CC BY-SA 4.0
2023-12-18T17:02:03.353Z
@Murch I think you don't. I also realized about that and edited the suggestion. Not sure if that is going to make a change @ Zephyrus
sr_gi
CC BY-SA 4.0
2023-12-18T17:07:54.073Z
It is version 23.11.1. When I removed all other settings and moved the config file to the default location, it started. I am going to try more changes to the datadir to see if that is causing this, and will also try the symbolic link.
Zephyrus
CC BY-SA 4.0
2023-12-19T15:11:05.310Z
Did you find out?
sr_gi
CC BY-SA 4.0
2023-12-18T16:28:09.443Z
2023-12-18T17:00:25.813Z
2023-12-18T17:00:25.813Z
sr_gi
<p>I'm trying to get CLN connected to a running Bitcoin Core node, but it is telling me I have unrecognized options in my config file. I thought the problem was that the data directory for the bitcoin node is on a USB drive that has spaces in its directory name.</p>
<p>In my <code>cln.conf</code> file, it is configured as follows:</p>
<pre><code>bitcoin-rpcconnect=127.0.0.1
bitcoin-rpcport=8332
bitcoin-rpcuser=btcuser
bitcoin-rpcpassword=btcpw
bitcoin-cli=/home/myuser/bitcoin-core/bitcoin-cli
bitcoin-datadir=/media/myuser/Seagate\ Expansion\ Drive/bitcoin/

network=bitcoin

proxy=127.0.0.1:9050
addr=statictor:127.0.0.1:9051
bind-addr=127.0.0.1:9735
always-use-proxy=true
tor-service-password=torpw
</code></pre>
<p>When I try to run CLN, I get the following error:</p>
<pre><code>$ lightningd --conf=../cln.conf 

lightning-cli exited with code 3: lightning-cli: -datadir=/media/myuser/Seagate\\ Expansion\\ Drive/bitcoin/: unrecognized option


Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:

    $ lightning-cli -datadir=/media/myuser/Seagate\\ Expansion\\ Drive/bitcoin/ -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -stdinrpcpass echo 'hello world'
The Bitcoin backend died.
</code></pre>
<p>The Bitcoin backend did not die. I can still access the node with bitcoin-cli.</p>
<pre><code>$ ./bitcoin-cli --rpcconnect=127.0.0.1 --rpcport=8332 --rpcuser=btcuser --rpcpassword=btcpw getbestblockhash
00000000000000000002b050f0ab9cb9f0f7c5ed4e4fc59f02debe724c571690
</code></pre>
<p>So I tried commenting out the <code>bitcoin-datadir</code> line in the config file. Then I get the following error:</p>
<pre><code>$ lightningd --conf=./cln.conf 

lightning-cli exited with code 3: lightning-cli: -rpcconnect=127.0.0.1: unrecognized option


Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:

    $ lightning-cli -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -stdinrpcpass echo 'hello world'
The Bitcoin backend died.
</code></pre>
<p>These settings are all in <a href="https://docs.corelightning.org/docs/configuration" rel="nofollow noreferrer">the documentation</a>. Why is it telling me it doesn't recognize them?</p>

CC BY-SA 4.0
2023-12-18T16:59:31.897Z
What versions of CLN and Bitcoin Core are you running? Is it possible that you are running a version of CLN that doesn't match the version of the documenation you are using to configure it?
Murch
<bitcoin-core><bitcoind><bitcoin-cli><core-lightning>
CLN config file unrecognized options
Zephyrus
# CLN config file unrecognized options

(Asked by: username_0 on 2023-12-18)

I'm trying to get CLN connected to a running Bitcoin Core node, but it is telling me I have unrecognized options in my config file. I thought the problem was that the data directory for the bitcoin node is on a USB drive that has spaces in its directory name.

In my `cln.conf` file, it is configured as follows:

```
bitcoin-rpcconnect=127.0.0.1
bitcoin-rpcport=8332
bitcoin-rpcuser=btcuser
bitcoin-rpcpassword=btcpw
bitcoin-cli=/home/myuser/bitcoin-core/bitcoin-cli
bitcoin-datadir=/media/myuser/Seagate\ Expansion\ Drive/bitcoin/

network=bitcoin

proxy=127.0.0.1:9050
addr=statictor:127.0.0.1:9051
bind-addr=127.0.0.1:9735
always-use-proxy=true
tor-service-password=torpw

```

When I try to run CLN, I get the following error:

```
$ lightningd --conf=../cln.conf 

lightning-cli exited with code 3: lightning-cli: -datadir=/media/myuser/Seagate\\ Expansion\\ Drive/bitcoin/: unrecognized option

Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:

    $ lightning-cli -datadir=/media/myuser/Seagate\\ Expansion\\ Drive/bitcoin/ -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -stdinrpcpass echo 'hello world'
The Bitcoin backend died.

```

The Bitcoin backend did not die. I can still access the node with bitcoin-cli.

```
$ ./bitcoin-cli --rpcconnect=127.0.0.1 --rpcport=8332 --rpcuser=btcuser --rpcpassword=btcpw getbestblockhash
00000000000000000002b050f0ab9cb9f0f7c5ed4e4fc59f02debe724c571690

```

So I tried commenting out the `bitcoin-datadir` line in the config file. Then I get the following error:

```
$ lightningd --conf=./cln.conf 

lightning-cli exited with code 3: lightning-cli: -rpcconnect=127.0.0.1: unrecognized option

Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:

    $ lightning-cli -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -stdinrpcpass echo 'hello world'
The Bitcoin backend died.

```

These settings are all in [the documentation](https://docs.corelightning.org/docs/configuration). Why is it telling me it doesn't recognize them?

**Tags:** bitcoin-core, bitcoind, bitcoin-cli, core-lightning

> **Comments:**
> **username_1**: What versions of CLN and Bitcoin Core are you running? Is it possible that you are running a version of CLN that doesn't match the version of the documenation you are using to configure it?  

---

## 1 answers

### Answer by username_2 on 2023-12-18. Score: 1

I checked your config locally and I think your main issue is that the `bitcoin-datadir` is not properly escaped. Your external drive name has a space in it, which may be causing the parsing to fail. I'd suggest you try passing it as:

```
bitcoin-datadir="/media/myuser/Seagate Expansion Drive/bitcoin/"

```

Regarding `rpcconnect`, I don't see anything wrong with it, your config worked in my local setup. Something worth mentioning though: you don't really need to specify `bitcoin-rpcconnect` and `bitcoin-rpcport`. Based on your config you are running on default (that is, localhost on the default mainnet port), so those are the same `cln` will pick if you just don't overwrite them. Same goes for `network=bitcoin`, that's the default AFAIK.

> **Comments:**
> **username_0**: Adding quotes around the datadir did not work. I tried several different ways of entering the datadir, even commenting it out, but nothing worked. Unfortunately, I can't change the name of that directory in order to remove the spaces.  
> **username_2**: That is pretty odd. What CLN version are you running?  Also, can you try a minimal config file placed on the default location? That is, create a file called `config` under `~/.lightning` and add only `bitcoin-rpcuser`, `bitcoin-rpcpassword` and `bitcoin-cli`. Then run `lightningd` without any other param.  
> **username_1**: @username_0: If the spaces are really the issue, you could perhaps make a soft link: `ln -s "/media/myuser/Seagate\ Expansion\ Drive/bitcoin/" "~/bitcoin-dir"` and then specify `~/bitcoin-dir` as the data directory in your configuration. (Don't trust, verify: read the man page for ln. `man ln` ;))  
> **username_1**: Also, just spitballing here… if you put the name into quotes, do you still need to escape the spaces?  
> **username_2**: @username_1 I think you don't. I also realized about that and edited the suggestion. Not sure if that is going to make a change @ username_0  
> **username_0**: It is version 23.11.1. When I removed all other settings and moved the config file to the default location, it started. I am going to try more changes to the datadir to see if that is causing this, and will also try the symbolic link.  
> **username_2**: Did you find out?  

---

