Bitcoin Forum
November 06, 2024, 12:10:33 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Core gets wrong bitcoin.conf file  (Read 168 times)
simpic (OP)
Hero Member
*****
Offline Offline

Activity: 1254
Merit: 811


View Profile
January 21, 2023, 02:34:55 PM
Merited by ABCbits (1)
 #1

I'm running bitcoin-qt without parameters and with the following settings in ".bitcoin/bitcoin.conf" file:

Quote
datadir=/media/<my_user>/<external_hdd>/.bitcoin
walletdir=/home/<my_user>/.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???

LoyceV
Legendary
*
Offline Offline

Activity: 3486
Merit: 17635


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
January 21, 2023, 02:43:49 PM
Merited by DaveF (1), ABCbits (1), simpic (1)
 #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.

▄▄███████████████████▄▄
▄█████████▀█████████████▄
███████████▄▐▀▄██████████
███████▀▀███████▀▀███████
██████▀███▄▄████████████
█████████▐█████████▐█████
█████████▐█████████▐█████
██████████▀███▀███▄██████
████████████████▄▄███████
███████████▄▄▄███████████
█████████████████████████
▀█████▄▄████████████████▀
▀▀███████████████████▀▀
Peach
BTC bitcoin
Buy and Sell
Bitcoin P2P
.
.
▄▄███████▄▄
▄████████
██████▄
▄██
█████████████████▄
▄███████
██████████████▄
███████████████████████
█████████████████████████
████████████████████████
█████████████████████████
▀███████████████████████▀
▀█████████████████████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀

▀▀▀▀███▀▀▀▀
EUROPE | AFRICA
LATIN AMERICA
▄▀▀▀











▀▄▄▄


███████▄█
███████▀
██▄▄▄▄▄░▄▄▄▄▄
████████████▀
▐███████████▌
▐███████████▌
████████████▄
██████████████
███▀███▀▀███▀
.
Download on the
App Store
▀▀▀▄











▄▄▄▀
▄▀▀▀











▀▄▄▄


▄██▄
██████▄
█████████▄
████████████▄
███████████████
████████████▀
█████████▀
██████▀
▀██▀
.
GET IT ON
Google Play
▀▀▀▄











▄▄▄▀
DaveF
Legendary
*
Offline Offline

Activity: 3654
Merit: 6660


Crypto Swap Exchange


View Profile WWW
January 21, 2023, 02:44:46 PM
 #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 <external_hdd> is the same mount name in both. Spent way too much time diagnosing that one once.

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
simpic (OP)
Hero Member
*****
Offline Offline

Activity: 1254
Merit: 811


View Profile
January 21, 2023, 10: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 <external_hdd> 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.

nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6337


Self-proclaimed Genius


View Profile
January 22, 2023, 05:09:29 AM
Merited by NeuroticFish (1), ABCbits (1), simpic (1)
 #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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
simpic (OP)
Hero Member
*****
Offline Offline

Activity: 1254
Merit: 811


View Profile
January 22, 2023, 03:21:22 PM
 #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.

KriptoBTC
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile WWW
January 22, 2023, 03:45:50 PM
 #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?
simpic (OP)
Hero Member
*****
Offline Offline

Activity: 1254
Merit: 811


View Profile
January 22, 2023, 04:12:50 PM
 #8

Meanwhile I made some changes and I get the following error:

Error: Failed to load database path '/home/<my_user>/.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.

NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7362


Top Crypto Casino


View Profile WWW
January 25, 2023, 11: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/<my_user>/bitcoin.conf

# in /media/<my_user>/bitcoin.conf:
datadir=/<my_user>/<external_hdd>/.bitcoin
walletdir=/home/<my_user>/.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.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
LoyceV
Legendary
*
Offline Offline

Activity: 3486
Merit: 17635


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
January 25, 2023, 12:36:17 PM
Merited by ABCbits (1)
 #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.

▄▄███████████████████▄▄
▄█████████▀█████████████▄
███████████▄▐▀▄██████████
███████▀▀███████▀▀███████
██████▀███▄▄████████████
█████████▐█████████▐█████
█████████▐█████████▐█████
██████████▀███▀███▄██████
████████████████▄▄███████
███████████▄▄▄███████████
█████████████████████████
▀█████▄▄████████████████▀
▀▀███████████████████▀▀
Peach
BTC bitcoin
Buy and Sell
Bitcoin P2P
.
.
▄▄███████▄▄
▄████████
██████▄
▄██
█████████████████▄
▄███████
██████████████▄
███████████████████████
█████████████████████████
████████████████████████
█████████████████████████
▀███████████████████████▀
▀█████████████████████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀

▀▀▀▀███▀▀▀▀
EUROPE | AFRICA
LATIN AMERICA
▄▀▀▀











▀▄▄▄


███████▄█
███████▀
██▄▄▄▄▄░▄▄▄▄▄
████████████▀
▐███████████▌
▐███████████▌
████████████▄
██████████████
███▀███▀▀███▀
.
Download on the
App Store
▀▀▀▄











▄▄▄▀
▄▀▀▀











▀▄▄▄


▄██▄
██████▄
█████████▄
████████████▄
███████████████
████████████▀
█████████▀
██████▀
▀██▀
.
GET IT ON
Google Play
▀▀▀▄











▄▄▄▀
simpic (OP)
Hero Member
*****
Offline Offline

Activity: 1254
Merit: 811


View Profile
January 25, 2023, 02:08:43 PM
 #11

Use includeconf option inside the config file located under the default .bitcoin folder to load additional config files.
Good to know, thank you.

DaveF
Legendary
*
Offline Offline

Activity: 3654
Merit: 6660


Crypto Swap Exchange


View Profile WWW
January 25, 2023, 02:14:46 PM
Merited by LoyceV (4)
 #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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7362


Top Crypto Casino


View Profile WWW
January 28, 2023, 02:20:49 PM
 #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.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!