bitcoin fails to find/read .conf when using -datadir argument

4 messages GitHub nanotube, Gavin Andresen May 18, 2011 — August 9, 2011
nanotube May 18, 2011 Source · Permalink

When i try to run bitcoin with -testnet and -datadir=someotherdir things get stored as expected, in someotherdir/testnet but if i try to run it with -server (or run bitcoind), it complains that it can’t find rpcpassword, even though it is present in someotherdir/testnet.

Warning: To use the “-server” option, you must set rpcpassword= in the configuration file: someotherdir/testnet/bitcoin.conf If the file does not exist, create it with owner-readable-only file permissions.

the file is of course quite present, and has correct permissions.

i have tried copying the .conf file into stock ~/.bitcoin/testnet location, i have tried making a symlink from there to the whole dir - nothing helps. the only way to make it stop complaining is to stop using the -datadir argument, and let it store things in the default location.

This is a bug, and should be fixed. :)

Note, I have thus far only tried it with -testnet, I do not know if this behavior is only present when using -testnet or not. This needs testing.

I know it’s weird, but -testnet reads bitcoin.conf from the datadir, NOT datadir/testnet.

nanotube May 19, 2011 Source · Permalink

gavinandresen: well… shouldn’t this be fixed, so it stops being weird? :)

gavinandresen August 9, 2011 Source · Permalink

Won’t fix— it is what it is.

(for the record, Satoshi re-wrote my initial implementation to put the .conf file on top of the testnet/ folder, so I agree with y’all. But changing it again now isn’t, in my opinion, worth all the confusion the change would cause).