Author

Topic: Bitcoin RPC loadwallet Error - Wallet file verification failed (Read 204 times)

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
I get file validation error when directory name and folder path are correct

If I mistype the directory name I get another error because, Wallet file verification failed.

Response body: Wallet file verification failed. Failed to load database path '/lastwallet/hey.dat'. Path does not exist.

Last time I checked, the wallet file needs to have a very specific name (wallet.dat), it's the folder name that indicates the name of your wallet, and as such, only the folder name should be included in a loadwallet call, without any path.
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
Maybe nc50lc's answer makes it clearer?
Sorry, same error.

I try with all kinds of link structures / I get an error whether I put it or not. I tried all link structures.
Have you copied it to the correct directory that I've pointed-out in my reply?
Namely: .bitcoin/wallets ; either paste 'backup.dat' inside or create a 'backup' folder there, paste 'backup.dat' file inside it and rename it into 'wallet.dat'.

Because if you did, there shouldn't be any error when you used the said commands.
staff
Activity: 3458
Merit: 6793
Just writing some code
loadwallet takes the name of a wallet, which is the name of the directory within the wallets/ directory that contains the wallet.dat file.

You can use the restorewallet RPC to restore a wallet from a backup. This takes the name to give the restored wallet, and the path to the backup of a wallet.dat file. It will create the necessary directory structure, copy the backup to the correct location, and name everything correctly. The restored wallet will already be loaded, and can be loaded or unloaded in the future using the name that you gave it when doing the restore.

Note that this RPC is currently only available in version 23.0.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
(I'm assuming testwallet is the first wallet you used and one that works with the rpc command, is it or does that still not work)?

drwx------ ariswallet
drwx------ lastwallet
drwx--x--x nudewallet
drwx--x--x testwallet

Why are these different, is there a reason for that?

Can you sudo chmod 711 them (according to a search engine that should be RWX--X--X you might want to confirm before doing it?

See if there's a difference between the subfiles of both of those directories too.

newbie
Activity: 4
Merit: 0
Can you check the permissions on the wallet file and post the here (ls -l in the parent directory where the wallet file is and then show us the first 10 characters that should look something like -rwxrw----) just in case it's that, you could also try doing that with the parent folder if you made it yourself to check bitcoin core has the rights to see files inside the folder.
Of course I'm sending right away

Wallet file ls -l:

total 1876
drwx------ 2 systemd-coredump systemd-coredump   4096 Sep  7 16:23 database
-rw------- 1 systemd-coredump systemd-coredump      0 Sep  7 14:55 db.log
-rw------- 1 systemd-coredump systemd-coredump 958464 Sep  7 15:50 hey.dat
-rw------- 1 systemd-coredump systemd-coredump 958464 Sep  7 17:56 wallet.dat


Parent bitcoin file ls -l:

drwx------ 2 systemd-coredump systemd-coredump     4096 Sep  7 14:07 ariswallet
-rw------- 1 systemd-coredump systemd-coredump       31 Sep  7 10:54 banlist.json
-rw------- 1 systemd-coredump systemd-coredump        2 Sep  7 13:33 bitcoind.pid
drwx------ 3 systemd-coredump systemd-coredump   184320 Sep  7 17:58 blocks
drwx------ 2 systemd-coredump systemd-coredump    90112 Sep  7 17:57 chainstate
-rw------- 1 systemd-coredump systemd-coredump 62182892 Sep  7 17:58 debug.log
-rw------- 1 systemd-coredump systemd-coredump   247985 Sep  7 13:32 fee_estimates.dat
drwx------ 3 systemd-coredump systemd-coredump     4096 Sep  7 15:50 lastwallet
-rw------- 1 systemd-coredump systemd-coredump       18 Sep  7 13:32 mempool.dat
drwx--x--x 2 systemd-coredump systemd-coredump     4096 Sep  7 13:33 nudewallet
-rw------- 1 systemd-coredump systemd-coredump   821890 Sep  7 17:48 peers.dat
-rw------- 1 systemd-coredump systemd-coredump       47 Sep  7 14:55 settings.json
drwx--x--x 2 systemd-coredump systemd-coredump     4096 Sep  7 13:33 testwallet
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Can you check the permissions on the wallet file and post the here (ls -l in the parent directory where the wallet file is and then show us the first 10 characters that should look something like -rwxrw----) just in case it's that, you could also try doing that with the parent folder if you made it yourself to check bitcoin core has the rights to see files inside the folder.
newbie
Activity: 4
Merit: 0
Response body: Wallet file verification failed. Failed to load database path '/lastwallet/hey.dat'. Path does not exist.

The parameter has to be either a folder, either a filename (not a file path!). You've still put a path there, of course it's not working.
Maybe nc50lc's answer makes it clearer?

Sorry, same error.

I try with all kinds of link structures / I get an error whether I put it or not. I tried all link structures.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
Response body: Wallet file verification failed. Failed to load database path '/lastwallet/hey.dat'. Path does not exist.

The parameter has to be either a folder, either a filename (not a file path!). You've still put a path there, of course it's not working.
Maybe nc50lc's answer makes it clearer?
newbie
Activity: 4
Merit: 0
how can i bypass this error

but certainly not the full path.
Of course, this may mean some adaptations in filenames or paths.


All the examples on the net seem to be loading wallet.dat without a path. Is it a problem for you to put into the datadir the wallet(s) you're planning to load?

I get file validation error when directory name and folder path are correct

If I mistype the directory name I get another error because, Wallet file verification failed.

Response body: Wallet file verification failed. Failed to load database path '/lastwallet/hey.dat'. Path does not exist.
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
how can i bypass this error
Either put 'backup.dat' inside .bitcoin/wallets dir or
Create a 'backup' folder inside .bitcoin/wallets dir, paste your 'backup.dat' file there and rename it into 'wallet.dat'.

Then load it using loadwallet backup.dat for the former or loadwallet backup for the latter.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
how can i bypass this error

I didn't use this, but according to the error message you may have to have either

Code:
{"jsonrpc": "1.0", "id": "curltest", "method": "loadwallet", "params": ["/home/bitcoin/.bitcoin/"]}

or

Code:
{"jsonrpc": "1.0", "id": "curltest", "method": "loadwallet", "params": ["backup.dat"]}


but certainly not the full path.
Of course, this may mean some adaptations in filenames or paths.


All the examples on the net seem to be loading wallet.dat without a path. Is it a problem for you to put into the datadir the wallet(s) you're planning to load?
newbie
Activity: 4
Merit: 0
Hi!

I am using my own bitcoin node server. I get the following error while making load wallet with RPC.


Request body:

{"jsonrpc": "1.0", "id": "curltest", "method": "loadwallet", "params": ["/home/bitcoin/.bitcoin//backup.dat"]}


Response body:

{
    "result": null,
    "error": {
        "code": -4,
        "message": "Wallet file verification failed. Invalid -wallet path '/home/bitcoin/.bitcoin//backup.dat'. -wallet path should point to a directory where wallet.dat and database/log.HuhHuhHuh? files can be stored, a location where such a directory could be created, or (for backwards compatibility) the name of an existing data file in -walletdir (\"/home/bitcoin/.bitcoin\")"
    },
    "id": "curltest"
}

how can i bypass this error
Jump to: