Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: dentanik on February 26, 2018, 01:35:55 PM



Title: Error opening block database
Post by: dentanik on February 26, 2018, 01:35:55 PM
HI Everyone,

I am new to bitcoin world and just wanted to support the network by downloading the full node on a dedicated Mac computer.

I knew it's going to be a steep learning curve especially for a non computer gig like myself and I was stuck right at the start.

When I try to open the bitcoin core application, it comes with a error message " error opening block database" " do you want to rebuilt the block database now"
I click ok and it comes wit " error opening database" and it closing the application. I have tried to delete the application and install again but I had no susses.

I would love to have someone give me an idea of how to tackle this problem.

Thank you for your time


Title: Re: Error opening block database
Post by: jackg on February 26, 2018, 01:57:38 PM
Can you post your debug.log?
How healthy is your hard drive/computer, how much space does your hard drive have free also?

Can you post your debug log as well. Presumably you're using Windows so by default it's c:\users\[yourusername]\appdata and in a folder named bitcoin either in the Roaming or Local subfolders of appdata.


Title: Re: Error opening block database
Post by: dentanik on February 26, 2018, 02:11:34 PM
HI Jackg,
Thank you for your swift reply.

I am using Mac by the way. When I open debug.log it says: 2018-02-26 12:49:38


Title: Re: Error opening block database
Post by: dentanik on February 26, 2018, 02:21:11 PM
I read the debug log and it says that the disk I am using doesn't support 000001.dbtmp:

I was trying to use an external drive. obviously it doesn't work that way .

How can I change the drive?
I read the debug log and it says that the disk I am using doesn't support 000001.dbtmp:

I was trying to use an external drive. obviously it doesn't work that way .

How can I change the drive?

2018-02-26 14:12:57 Bitcoin Core version v0.16.0 (release build)
2018-02-26 14:12:57 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-02-26 14:12:58 Assuming ancestors of block 0000000000000000005214481d2d96f898e3d5416e43359c145944a909d242e0 have valid signatures.
2018-02-26 14:12:58 Setting nMinimumChainWork=000000000000000000000000000000000000000000f91c579d57cad4bc5278cc
2018-02-26 14:12:58 Using the 'sse4' SHA256 implementation
2018-02-26 14:12:58 Using RdRand as an additional entropy source
2018-02-26 14:12:58 Default data directory /Users/nikolayvladimirov/Library/Application Support/Bitcoin
2018-02-26 14:12:58 Using data directory /Volumes/USB_Storage
2018-02-26 14:12:58 Using config file /Volumes/USB_Storage/bitcoin.conf
2018-02-26 14:12:58 Using at most 125 automatic connections (2560 file descriptors available)
2018-02-26 14:12:58 Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2018-02-26 14:12:58 Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2018-02-26 14:12:58 Using 2 threads for script verification
2018-02-26 14:12:58 scheduler thread start
2018-02-26 14:12:58 Using wallet directory /Volumes/USB_Storage
2018-02-26 14:12:58 init message: Verifying wallet(s)...
2018-02-26 14:12:58 Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-02-26 14:12:58 Using wallet wallet.dat
2018-02-26 14:12:58 CDBEnv::Open: LogDir=/Volumes/USB_Storage/database ErrorFile=/Volumes/USB_Storage/db.log
2018-02-26 14:12:58 Cache configuration:
2018-02-26 14:12:58 * Using 2.0MiB for block index database
2018-02-26 14:12:58 * Using 8.0MiB for chain state database
2018-02-26 14:12:58 * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-02-26 14:12:58 init message: Loading block index...
2018-02-26 14:12:59 Opening LevelDB in /Volumes/USB_Storage/blocks/index
2018-02-26 14:12:59 IO error: /Volumes/USB_Storage/blocks/index/000001.dbtmp: Operation not supported
2018-02-26 14:12:59 Database I/O error
2018-02-26 14:13:03 init message: Loading block index...
2018-02-26 14:13:03 Wiping LevelDB in /Volumes/USB_Storage/blocks/index
2018-02-26 14:13:03 Opening LevelDB in /Volumes/USB_Storage/blocks/index
2018-02-26 14:13:03 IO error: /Volumes/USB_Storage/blocks/index/000001.dbtmp: Operation not supported
2018-02-26 14:13:03 Database I/O error
2018-02-26 14:13:05 Shutdown: In progress...
2018-02-26 14:13:05 scheduler thread interrupt
2018-02-26 14:13:05 Shutdown: done


Title: Re: Error opening block database
Post by: Sellingaccs on February 26, 2018, 02:30:32 PM
-snip-

Seems like you have installed some of the files on external drive.
Do you have sent any bitcoins to the wallet that you are trying to open? If not, the smartest way would be to uninstall the application.
Please provide some more information, and if you have any private keys that you need on the wallet.dat and i'll help you to backup and restore them correctly to new installation of Bitcoin Core.


Title: Re: Error opening block database
Post by: Heisenberg_Hunter on February 26, 2018, 02:33:08 PM
When this problem arrives:

1. Your HDD might be full
2. You may be using a very old indexed drive (Try reindex the drive)

You can change your blockchain default drive location by first locating your blockchain directory. This could be found in the /Library/Application Support/Bitcoin/. Copy the directory folder and and paste it in another drive which is free and then right click and go to properties and paste the code in Target.

Quote
-datadir=your drive name:\BitCoin

Now you can restart your wallet and everything will be fine. :)


Title: Re: Error opening block database
Post by: dentanik on February 26, 2018, 02:52:15 PM
All done.


I am now in the process of waiting.

Thanks heaps for your help. ;D

You guys rock!!!!!



Title: Re: Error opening block database
Post by: themossinator on March 01, 2018, 11:07:53 PM
Hi, I am also getting this error
Running a mini PC Windows 10, blockchain on 4TB external drive

Got this from the debug log

Code:
2018-03-01 22:54:06 init message: Loading block index...
2018-03-01 22:54:06 Opening LevelDB in d:\Bitcoin\blocks\index
2018-03-01 22:54:06 IO error: d:\Bitcoin\blocks\index/000419.dbtmp: Could not rename file.
2018-03-01 22:54:06 Database I/O error
2018-03-01 22:54:07 init message: Loading block index...
2018-03-01 22:54:07 Wiping LevelDB in d:\Bitcoin\blocks\index
2018-03-01 22:54:07 IO error: d:\Bitcoin\blocks\index\000102.ldb: Could not delete file.
2018-03-01 22:54:07 Database I/O error
2018-03-01 22:54:09 Shutdown: In progress...
2018-03-01 22:54:09 scheduler thread interrupt
2018-03-01 22:54:09 Shutdown: done

any ideas what is wrong? I am really struggling to get my node up and running, thank you


Title: Re: Error opening block database
Post by: jackg on March 01, 2018, 11:24:26 PM
Hi, I am also getting this error
Running a mini PC Windows 10, blockchain on 4TB external drive

Got this from the debug log

Code:
2018-03-01 22:54:06 init message: Loading block index...
2018-03-01 22:54:06 Opening LevelDB in d:\Bitcoin\blocks\index
2018-03-01 22:54:06 IO error: d:\Bitcoin\blocks\index/000419.dbtmp: Could not rename file.
2018-03-01 22:54:06 Database I/O error
2018-03-01 22:54:07 init message: Loading block index...
2018-03-01 22:54:07 Wiping LevelDB in d:\Bitcoin\blocks\index
2018-03-01 22:54:07 IO error: d:\Bitcoin\blocks\index\000102.ldb: Could not delete file.
2018-03-01 22:54:07 Database I/O error
2018-03-01 22:54:09 Shutdown: In progress...
2018-03-01 22:54:09 scheduler thread interrupt
2018-03-01 22:54:09 Shutdown: done

any ideas what is wrong? I am really struggling to get my node up and running, thank you

You don't happen to have that folder open anywhere do you?
Was it able to obtain "a LOCK on the database"?

Can you post from the startup of that instance of bitcoin core of the debug.log.
You could try reindexing it or checking the stability of your hard drive/defragment the hard drive using optimisation tools.


Title: Re: Error opening block database
Post by: themossinator on March 05, 2018, 05:39:45 PM
Hi, no i dont have the folder open anywhere

here is the rest of the log

Code:
2018-03-01 22:53:15 Bitcoin Core version v0.16.0 (release build)
2018-03-01 22:53:15 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-03-01 22:53:16 Assuming ancestors of block 0000000000000000005214481d2d96f898e3d5416e43359c145944a909d242e0 have valid signatures.
2018-03-01 22:53:16 Setting nMinimumChainWork=000000000000000000000000000000000000000000f91c579d57cad4bc5278cc
2018-03-01 22:53:16 Using the 'sse4' SHA256 implementation
2018-03-01 22:53:16 Using RdRand as an additional entropy source
2018-03-01 22:53:16 GUI: "registerShutdownBlockReason: Successfully registered: Bitcoin Core didn't yet exit safely..."
2018-03-01 22:53:17 Default data directory C:\Users\BTC\AppData\Roaming\Bitcoin
2018-03-01 22:53:17 Using data directory d:\Bitcoin
2018-03-01 22:53:17 Using config file d:\Bitcoin\bitcoin.conf
2018-03-01 22:53:17 Using at most 125 automatic connections (2048 file descriptors available)
2018-03-01 22:53:17 Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2018-03-01 22:53:17 Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2018-03-01 22:53:17 Using 4 threads for script verification
2018-03-01 22:53:17 scheduler thread start
2018-03-01 22:53:17 Using wallet directory d:\Bitcoin
2018-03-01 22:53:17 init message: Verifying wallet(s)...
2018-03-01 22:53:17 Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-03-01 22:53:17 Using wallet wallet.dat
2018-03-01 22:53:17 CDBEnv::Open: LogDir=d:\Bitcoin\database ErrorFile=d:\Bitcoin\db.log
2018-03-01 22:53:17 Cache configuration:
2018-03-01 22:53:17 * Using 2.0MiB for block index database
2018-03-01 22:53:17 * Using 8.0MiB for chain state database
2018-03-01 22:53:17 * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-03-01 22:53:17 init message: Loading block index...
2018-03-01 22:53:17 Opening LevelDB in d:\Bitcoin\blocks\index
2018-03-01 22:53:18 IO error: d:\Bitcoin\blocks\index/000419.dbtmp: Could not rename file.
2018-03-01 22:53:18 Database I/O error
2018-03-01 22:53:42 init message: Loading block index...
2018-03-01 22:53:42 Wiping LevelDB in d:\Bitcoin\blocks\index
2018-03-01 22:53:42 IO error: d:\Bitcoin\blocks\index\000102.ldb: Could not delete file.
2018-03-01 22:53:42 Database I/O error
2018-03-01 22:53:43 Shutdown: In progress...
2018-03-01 22:53:43 scheduler thread interrupt
2018-03-01 22:53:43 Shutdown: done
2018-03-01 22:54:05


Title: Re: Error opening block database
Post by: jackg on March 06, 2018, 12:35:41 AM
Hi, no i dont have the folder open anywhere

here is the rest of the log

~

Your best option is probably to try running the -reindex command and see if that fixes your issue a bit. Unless you can run/have run any hard drive testing software that has found a problem in the hard drive, then this error may likely continue.

Also, do you have ANY antivirus installed, there were rumors that at least one block in the main chain got deleted from the blockchain by antivirus because someone decided to add a virus signature to a block (not to be malicious intentionally but probably to see if it caused AV issues from the blockchain itself - which was proven).


Title: Re: Error opening block database
Post by: themossinator on March 06, 2018, 03:12:08 PM
thank, i dont have any AV software running - what you mean by -reindex?

I have uninstalled and reinstalled the software, after reinstall it verifies the blocks, says Done Loading - then it hangs. Cant believe this is so difficult to get running!


Title: Re: Error opening block database
Post by: bob123 on March 06, 2018, 03:28:15 PM
thank, i dont have any AV software running - what you mean by -reindex?

He is talking about running -reindex command.

Either open the console of core ('Help' -> 'Debug window' -> 'Console') and type: -reindex.

Or start core via command line with -reindex as command line argument:
e.g. in linux:
Code:
./bitcoin-qt -reindex



Title: Re: Error opening block database
Post by: jackg on March 06, 2018, 05:10:28 PM
thank, i dont have any AV software running - what you mean by -reindex?

He is talking about running -reindex command.

Either open the console of core ('Help' -> 'Debug window' -> 'Console') and type: -reindex.

Or start core via command line with -reindex as command line argument:
e.g. in linux:
Code:
./bitcoin-qt -reindex



Yes. As Bob says, I'd recommend booting it from the Linux console with the command.

Rename the Blocks and Chainstate folders first also just to check it.

Ordinarily I'd offer my version of the file but yours is a temp file and not a fully made one.

Did you shutdown forcefully at any point? As, if so, this probably caused the error (and the error doesn't always appear straight away).


Title: Re: Error opening block database
Post by: themossinator on March 13, 2018, 03:31:23 AM
Ok, thanks for help all - i got the reindex going so just letting it do its thing, hopefully will be ok then. My next problem is trying to open port 8333, nothing is easy with this lol


Title: Re: Error opening block database
Post by: jackg on March 13, 2018, 09:41:09 PM
Ok, thanks for help all - i got the reindex going so just letting it do its thing, hopefully will be ok then. My next problem is trying to open port 8333, nothing is easy with this lol

You can change the port to a lower number (like 22 - the SSH port or another well known/used port that should be open - the 80 port also if you really have to).

Though it depends on how you're connecting to the network and the nature of the network (is it a public or private network for example)?


Title: Re: Error opening block database
Post by: themossinator on March 14, 2018, 10:03:40 PM
Ok, thanks for help all - i got the reindex going so just letting it do its thing, hopefully will be ok then. My next problem is trying to open port 8333, nothing is easy with this lol

You can change the port to a lower number (like 22 - the SSH port or another well known/used port that should be open - the 80 port also if you really have to).

Though it depends on how you're connecting to the network and the nature of the network (is it a public or private network for example)?

Its my own home network.

So i started the reindex and left it to do its thing for a couple of days - come back and found bitcoin core wasnt running, started the program and got the error opening block database again LOL

its almost like this isnt meant to be - cant understand why this is so difficult to get running  :( :( :(


Title: Re: Error opening block database
Post by: jackg on March 14, 2018, 10:27:08 PM
~

Its my own home network.

So i started the reindex and left it to do its thing for a couple of days - come back and found bitcoin core wasnt running, started the program and got the error opening block database again LOL

its almost like this isnt meant to be - cant understand why this is so difficult to get running  :( :( :(

Go to the start menu and search "event" you should get an application called "Event Viewer" that pops up in the search results as a program. Click on that. Use this to check to see if there are any unexpected shutdowns (or check if there is a difference in timing between when it turns off and back on - if events are quite frequent and immediately drop off then you know there's an issue there).

Also, check your power supply and try coming back to the computer eveyr few hours just to check on it (or even once a day). If you shutdown the core every couple of hours (you can get a script to do this) and then restart it, it'll save where its up to if there is an issue with the computer - it'll cut some issues NOT ALL!

Also check the debug.log to see if it shows there is an unexpected shutdown when you rebooted bitcoin core? Is your computer set to hybernate/sleep at any point, if so, turn this off (change the setting in control panel to NEVER).


Title: Re: Error opening block database
Post by: themossinator on March 23, 2018, 06:16:22 PM
thank for your help, really appreciate it. I think I will abandon this on Windows and look into running a node on Linux instead as this is just way too unreliable


Title: Re: Error opening block database
Post by: jackg on March 23, 2018, 06:34:38 PM
I'm not sure Linux will help so much but you can always try, it does seem a bit more lightweight though than Windows so there may be less errors. You have to install dependencies though on their own which gets a bit annoying if you turn to Linux (though if you use Ubuntu, I guess there'll be fewer issues as that's what it's made for - it's the most widespread).


Title: Re: Error opening block database
Post by: LoyceV on March 23, 2018, 07:14:54 PM
Code:
2018-03-01 22:53:18 IO error: d:\Bitcoin\blocks\index/000419.dbtmp: Could not rename file.
2018-03-01 22:53:18 Database I/O error
Could this be a file system limitation? Which file system do you use?

I think I will abandon this on Windows and look into running a node on Linux instead as this is just way too unreliable
May I suggest installing a "Linux file system" on your external drive? Ext4 is a good default choice.


Title: Re: Error opening block database
Post by: Sellingaccs on April 03, 2018, 06:39:40 AM
Code:
2018-03-01 22:53:18 IO error: d:\Bitcoin\blocks\index/000419.dbtmp: Could not rename file.
2018-03-01 22:53:18 Database I/O error
Could this be a file system limitation? Which file system do you use?

I think I will abandon this on Windows and look into running a node on Linux instead as this is just way too unreliable
May I suggest installing a "Linux file system" on your external drive? Ext4 is a good default choice.

That is a great suggestion! I'd personally recommend Minitool Partition Wizard (https://www.partitionwizard.com/free-partition-manager.html) to use for creating partition, IF you wish to create partitions via Windows OS. That tool is easy to use and very reliable. It is very similar to Gparted IMO.



However creating partitions is usually safer on GNU/Linux OS and i think that he should create the partition from installation of Xubuntu or liveCD (https://xubuntu.org/). Xubuntu is lightweight, as it features XFCE instead of Gnome3 as DE.


Title: Re: Error opening block database
Post by: themossinator on April 17, 2018, 02:18:12 PM
hey thanks for replies - I am now running on Ubuntu 16.04 LTS - so far so good, blockchain syncing now but its taking quite a while, not sure why, it seemed to sync a hell of a lot faster on Windows

Anyway, my final problem (i hope) is that I cannot open port 8333, have seen suggestions that ISPs may block this port but I think its probably more something on my end

If i use one of those port checking websites it says 8333 is Open but https://bitnodes.earn.com/ says Not Reachable

does anyone know what Im missing here? I am only getting 8 active connections on my Bitcoin Core

thanks


Title: Re: Error opening block database
Post by: LoyceV on April 17, 2018, 04:52:14 PM
If i use one of those port checking websites it says 8333 is Open but https://bitnodes.earn.com/ says Not Reachable

does anyone know what Im missing here?
Let's start with the obvious: did you portforward port 8333 in your modem settings to the IP address of your Ubuntu?


Title: Re: Error opening block database
Post by: themossinator on April 18, 2018, 04:20:57 PM
If i use one of those port checking websites it says 8333 is Open but https://bitnodes.earn.com/ says Not Reachable

does anyone know what Im missing here?
Let's start with the obvious: did you portforward port 8333 in your modem settings to the IP address of your Ubuntu?

yes


Title: Re: Error opening block database
Post by: jackg on April 18, 2018, 04:46:03 PM
If i use one of those port checking websites it says 8333 is Open but https://bitnodes.earn.com/ says Not Reachable

does anyone know what Im missing here?
Let's start with the obvious: did you portforward port 8333 in your modem settings to the IP address of your Ubuntu?

yes

Do you use a VPN or have a service that monitors your network traffic (a "physical firewall" for outbound/inbound data).

Since you're still getting connections, what does it say at the bottom? Is it still syncing or is there another error. 8 perrs seems about right.

If you're still stuck after this, I'd suggest you try and change the port to something else (22 would be my suggestion - it's usually for SSH so should be available unless your router already uses that port).


Title: Re: Error opening block database
Post by: themossinator on April 21, 2018, 06:08:01 PM
If i use one of those port checking websites it says 8333 is Open but https://bitnodes.earn.com/ says Not Reachable

does anyone know what Im missing here?
Let's start with the obvious: did you portforward port 8333 in your modem settings to the IP address of your Ubuntu?

yes

Do you use a VPN or have a service that monitors your network traffic (a "physical firewall" for outbound/inbound data).

Since you're still getting connections, what does it say at the bottom? Is it still syncing or is there another error. 8 perrs seems about right.

If you're still stuck after this, I'd suggest you try and change the port to something else (22 would be my suggestion - it's usually for SSH so should be available unless your router already uses that port).

says its syncing with network, only 2 active connections :(

how to change the default port?

thanks


Title: Re: Error opening block database
Post by: jackg on April 21, 2018, 08:39:00 PM
For ALL OSes, locate the bitcoin-qt script (for microsoft windows it's bitcoin-qt.exe for linux, you can probably jsut type bitcoin-qt into the console).

FOR WINDOWS:
Open command prompt and type Path_You_Just_Found+"\bitcoin-qt.exe -port=22"

For Linux:
Open command prompt and type "bitcoin-qt -port=22".

Hopefully that should work correctly. If not, try installing TOR and forcing your packets through it.


Title: Re: Error opening block database
Post by: themossinator on April 25, 2018, 07:38:04 PM
Its actually ok, when my wallet finished syncing it's working!! thanks to everyone for helping me!  :)


Title: Re: Error opening block database
Post by: PabloRod2 on January 25, 2020, 12:45:45 AM
I got a similar error, i use the core at another location, now I use a MacBook to check some things and even tho the hard disk is updated till yesterday without issues the Mac client shows the following errors

https://i.ibb.co/rxrm3CV/BC1.png
https://i.ibb.co/84hgKkY/BC2.png

Any ideas? I know i could format the drive and re-download the hole database, I would like no avoid doing that


Title: Re: Error opening block database
Post by: AdolfinWolf on January 25, 2020, 12:19:36 PM
Any ideas? I know i could format the drive and re-download the hole database, I would like no avoid doing that
Hmm. Those errors could mean a variety of things. Best thing you could probably do is make a backup first, then maybe open a new thread (as you're currently bumping a year-old thread) with a debug.log attached ( => https://en.bitcoin.it/wiki/Data_directory).

If you're not interested in opening another thread, you can try some of the following:

https://bitcoin.stackexchange.com/questions/60709/when-should-i-use-reindex-chainstate-and-when-reindex/60711#60711

Reindex it and see if that fixes your DB issues. (Again that might be unnecessary if you can check the debug.log to see what the error might be.)
(Maybe there is an error with the -datadir (since you use it a "different" location?) but if you've used the wallet succesfully before, i kind of doubt it.)