Freebsd Bitcoind doesn't read config correctly

0

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?

Jan Wytze

Posted 2016-10-19T19:53:07.273

Reputation: 289

Which version of Bitcoin Core do you use? Does the password/username contain non-ascii characters?user2084795 2016-10-19T20:08:46.403

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?wumpus 2016-10-20T01:25:01.003

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.wumpus 2016-10-20T01:31:07.797

@user2084795 I am using the version from the repository. It is 120100. My username and password only contain letters and number.Jan Wytze 2016-10-20T17:04:56.877

@wumpus your command is not correct, I get a syntax error.Jan Wytze 2016-10-20T17:07:48.617

That syntax is based on bash. Your shell may have a different syntax for exporting environment variableswumpus 2016-11-19T10:14:37.307

1Could 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.wumpus 2016-11-19T10:49:15.457

Answers

0

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.

Jan Wytze

Posted 2016-10-19T19:53:07.273

Reputation: 289