Author

Topic: Bitcoin Core gets wrong bitcoin.conf file (Read 143 times)

legendary
Activity: 1526
Merit: 6442
bitcoincleanup.com / bitmixlist.org
January 28, 2023, 10:20:49 AM
#13
And make sure the datadir and wallet dir and all the files have 0777 (full user-group-other) permissions.
This is bad advice: it's good practice to give files as few permissions as necessary. Giving all users on a multi user system full access to your wallet is a terrible idea. Also, non-executable files shouldn't have an executable flag.

1. Most people do not share their devices, in fact we have gravitated towards a situation where people use multiple devices.

2. Device mountpoints are notoriously bad at dealing with file permissions, particularly with older versions of user/HAL that would just mount everything as root.

3. If your Unix system gets hit with an application exploit, then it already obtained user access by virtue of the running program being owned by your user account (I will not deal with setUID madness here, but nobody should be using that horrible design anyway), and do not need the group and other bits; they might as well read your SSH keys.

The executable flag, that was a mistake. In that case they can be set to 0644.
legendary
Activity: 3388
Merit: 6072
Crypto Swap Exchange
January 25, 2023, 10:14:46 AM
#12
And make sure the datadir and wallet dir and all the files have 0777 (full user-group-other) permissions.
This is bad advice: it's good practice to give files as few permissions as necessary. Giving all users on a multi user system full access to your wallet is a terrible idea. Also, non-executable files shouldn't have an executable flag.

Beyond that, if you have to do it to make things work something else is terribly wrong with either the application or system configuration.
This is in general, not just related to core.

I have had sysadmins over the years do things like that to get things to work instead of figuring out why they were having issues in the 1st place.

-Dave
hero member
Activity: 1232
Merit: 789
January 25, 2023, 10:08:43 AM
#11
Use includeconf option inside the config file located under the default .bitcoin folder to load additional config files.
Good to know, thank you.
legendary
Activity: 3262
Merit: 16303
Thick-Skinned Gang Leader and Golden Feather 2021
January 25, 2023, 08:36:17 AM
#10
And make sure the datadir and wallet dir and all the files have 0777 (full user-group-other) permissions.
This is bad advice: it's good practice to give files as few permissions as necessary. Giving all users on a multi user system full access to your wallet is a terrible idea. Also, non-executable files shouldn't have an executable flag.
legendary
Activity: 1526
Merit: 6442
bitcoincleanup.com / bitmixlist.org
January 25, 2023, 07:05:22 AM
#9
Use includeconf option inside the config file located under the default .bitcoin folder to load additional config files.

An example:

Code:
# ~/.bitcoin/bitcoin.conf
includeconf=/media//bitcoin.conf

# in /media//bitcoin.conf:
datadir=///.bitcoin
walletdir=/home//.bitcoin/wallets/test

And make sure the datadir and wallet dir and all the files have 0777 (full user-group-other) permissions.

This way you can specify the data and wallet folders without the entire config file being located on the root partition as well - only a skeleton of it with includeconf has to be there.
hero member
Activity: 1232
Merit: 789
January 22, 2023, 12:12:50 PM
#8
Meanwhile I made some changes and I get the following error:

Error: Failed to load database path '/home//.bitcoin'. Data is not in recognized format.

I solved deleting "settings.json" file, it will be created again on next opening of Bitcoin Core.
Hope this can help who encounter the same error.
newbie
Activity: 1
Merit: 0
January 22, 2023, 11:45:50 AM
#7
I've always found it strange how Bitcoin Core places it's config files. I have (in use):
Code:
~/.config/Bitcoin/Bitcoin-Qt.conf
And (0 bytes):
Code:
~/.bitcoin/bitcoin.conf
The former still exists if you change the latter to a different directory. I guess that's where you'll have to look too.

Hey. I can't find it there. Any other place I should look for?
hero member
Activity: 1232
Merit: 789
January 22, 2023, 11:21:22 AM
#6
Those are the setting you've set in the "Welcome Screen" and the "Options...->Settings" in the GUI.
Yes, I had guessed it.

Quote
Welcome screen can be re-accessed by adding a command line option -choosedatadir
Thanks for the hint.
legendary
Activity: 2338
Merit: 5297
Self-proclaimed Genius
January 22, 2023, 01:09:29 AM
#5
I've always found it strange how Bitcoin Core places it's config files. I have (in use):
Code:
~/.config/Bitcoin/Bitcoin-Qt.conf
Those are the setting you've set in the "Welcome Screen" and the "Options...->Settings" in the GUI.
Welcome screen can be re-accessed by adding a command line option -choosedatadir

If you've set a custom datadir in the welcome screen, QT wont use the datadir entry in the bitcoin.conf file nor the lines in bitcoin.conf in the default datadir;
Bitcoin-Qt will use the bitcoin.conf in the custom datadir instead, perhaps that's what happened to OP.
hero member
Activity: 1232
Merit: 789
January 21, 2023, 06:00:53 PM
#4
I've always found it strange how Bitcoin Core places it's config files. I have (in use):
Code:
~/.config/Bitcoin/Bitcoin-Qt.conf
And (0 bytes):
Code:
~/.bitcoin/bitcoin.conf
The former still exists if you change the latter to a different directory. I guess that's where you'll have to look too.
Yes, it does the trick, thank you!
But... wtf!


In addition to what @LoyceV said I would check permissions. Since you said you copied it from another machine to another can this one read & write to those files & folders.

Also, what does the debug.log file say? Any can't read or writes to anyplace?

And, I know it's stupid but I have done it did you verify the is the same mount name in both. Spent way too much time diagnosing that one once.

-Dave
It would have been the next check, thank you anyway for your help.
legendary
Activity: 3388
Merit: 6072
Crypto Swap Exchange
January 21, 2023, 10:44:46 AM
#3
In addition to what @LoyceV said I would check permissions. Since you said you copied it from another machine to another can this one read & write to those files & folders.

Also, what does the debug.log file say? Any can't read or writes to anyplace?

And, I know it's stupid but I have done it did you verify the is the same mount name in both. Spent way too much time diagnosing that one once.

-Dave
legendary
Activity: 3262
Merit: 16303
Thick-Skinned Gang Leader and Golden Feather 2021
January 21, 2023, 10:43:49 AM
#2
I've always found it strange how Bitcoin Core places it's config files. I have (in use):
Code:
~/.config/Bitcoin/Bitcoin-Qt.conf
And (0 bytes):
Code:
~/.bitcoin/bitcoin.conf
The former still exists if you change the latter to a different directory. I guess that's where you'll have to look too.
hero member
Activity: 1232
Merit: 789
January 21, 2023, 10:34:55 AM
#1
I'm running bitcoin-qt without parameters and with the following settings in ".bitcoin/bitcoin.conf" file:

Quote
datadir=/media///.bitcoin
walletdir=/home//.bitcoin/wallets/test

On a computer with Ubuntu it works like a charm: it gets blockchain data and wallet.
On another computer with Linux Mint in which I copied the same Bitcoin Core (v24.0.1) and the same config folder, located in the same path (".bitcoin/bitcoin.conf"), when I launch bitcoin-qt (with no parameters) it gets the wrong bitcoin.conf file, using that is on the external disk and no wallet is loaded.

What the hell is wrong???
Jump to: