<p>I don't know exacly how, but I got it working.
I do know that I used <code>export LC_ALL=en_US.UTF-8</code> but I am not sure that is the reason it works. </p>

<p>I still have the same error with the <code>-conf</code> paramter. Even when permissions are 777.</p>

<p>I know this isn't a perfect answer. But my bitcoind server works now.</p>

CC BY-SA 3.0
2016-10-20T17:17:29.293Z
2016-10-20T17:17:29.293Z
Jan Wytze
<p>When I try to connect to my bitcoind server with the username and password in my bitcoin.conf I get a 401 error.
When I set an username and password in the bitcoind parameters(<code>bitcoind -rpcuser=... -rpcpassword=... -daemon</code>) it does work.</p>

<p>I also have prune in my config file. For some reason this does work.
Also the rpcallow works fine.
So it does read my config file?</p>

<p>When I add the -conf parameter with my config file I get this error:</p>

<p><code>Error reading configuration file: the options configuration file contains an invalid line '��</code>
(I also can't read those last 2 characters)</p>

<p>I even get this error when the file is empty</p>

<p>Does someone know how I can fix this?</p>

CC BY-SA 3.0
2016-10-19T20:08:46.403Z
Which version of Bitcoin Core do you use? Does the password/username contain non-ascii characters?
user2084795
CC BY-SA 3.0
2016-10-20T01:25:01.003Z
I'm also interested in what version you're using. Did you build it yourself or does it come from ports? I didn't have this problem with 0.13.1 at least. Also can you do `bitcoind -conf someconffile.conf | & hd` to see what those characters are in hex?
laanwj
CC BY-SA 3.0
2016-10-20T01:31:07.797Z
One guess would be that it is something to do with locale, which isn't set by default on FreeBSD (and the boost function used for conf file parsing may croak on that). e.g. try `export LC_ALL=en_US.UTF-8`.
laanwj
CC BY-SA 3.0
2016-10-20T17:04:56.877Z
@user2084795 I am using the version from the repository. It is 120100. My username and password only contain letters and number.
Jan Wytze
CC BY-SA 3.0
2016-10-20T17:07:48.617Z
@wumpus your command is not correct, I get a syntax error.
Jan Wytze
CC BY-SA 3.0
2016-11-19T10:14:37.307Z
That syntax is based on bash. Your shell may have a different syntax for exporting environment variables
laanwj
CC BY-SA 3.0
2016-11-19T10:49:15.457Z
Could you do an hexdump on bitcoin.conf and check for >0x80 characters, or upload the entire file (w/ censored user and pass) somewhere? I'm quite interested what unicode it contains. Some editors leave UTF-8 BOM markers at the beginning, for example.
laanwj
<bitcoind><json-rpc><bitcoin.conf>
Freebsd Bitcoind doesn't read config correctly
Jan Wytze
# Freebsd Bitcoind doesn't read config correctly

(Asked by: username_0 on 2016-10-19)

When I try to connect to my bitcoind server with the username and password in my bitcoin.conf I get a 401 error.
When I set an username and password in the bitcoind parameters(`bitcoind -rpcuser=... -rpcpassword=... -daemon`) it does work.

I also have prune in my config file. For some reason this does work.
Also the rpcallow works fine.
So it does read my config file?

When I add the -conf parameter with my config file I get this error:

`Error reading configuration file: the options configuration file contains an invalid line '��`
(I also can't read those last 2 characters)

I even get this error when the file is empty

Does someone know how I can fix this?

**Tags:** bitcoind, json-rpc, bitcoin.conf

> **Comments:**
> **username_1**: Which version of Bitcoin Core do you use? Does the password/username contain non-ascii characters?  
> **username_2**: I'm also interested in what version you're using. Did you build it yourself or does it come from ports? I didn't have this problem with 0.13.1 at least. Also can you do `bitcoind -conf someconffile.conf | & hd` to see what those characters are in hex?  
> **username_2**: One guess would be that it is something to do with locale, which isn't set by default on FreeBSD (and the boost function used for conf file parsing may croak on that). e.g. try `export LC_ALL=en_US.UTF-8`.  
> **username_0**: @username_1 I am using the version from the repository. It is 120100. My username and password only contain letters and number.  
> **username_0**: @wumpus your command is not correct, I get a syntax error.  
> **username_2**: That syntax is based on bash. Your shell may have a different syntax for exporting environment variables  
> **username_2**: Could you do an hexdump on bitcoin.conf and check for >0x80 characters, or upload the entire file (w/ censored user and pass) somewhere? I'm quite interested what unicode it contains. Some editors leave UTF-8 BOM markers at the beginning, for example.  

---

## 1 answers

### Answer by username_0 on 2016-10-20. Score: 0 | Accepted answer

I don't know exacly how, but I got it working.
I do know that I used `export LC_ALL=en_US.UTF-8` but I am not sure that is the reason it works.

I still have the same error with the `-conf` paramter. Even when permissions are 777.

I know this isn't a perfect answer. But my bitcoind server works now.


---

