Title: Error opening blocks database Post by: bodom on April 29, 2016, 11:17:17 PM Hi there!
I have installed the Bitcoin client for Linux (bitcoin-qt). I have started it, and it started synchronizing blocks. After a while, my disk got full. I have then moved the ~/.bitcoin/blocks and ~/.bitcoin/chainstate to a different partition and created symlinks. The client started again and downloaded blocks for some hours, then also that partition got full. I have a NAS mounted via cifs (smbfs) with huge disk space. If I move the blocks and chainstate folders there and symlink them, exactly in the same way i did with the other partition, I get an error opening blocks database. It asks me if I want to rebuild it. If I answer yes, it then says the same error again and exits. Any ideas? Thank you Title: Re: Error opening blocks database Post by: achow101 on April 29, 2016, 11:44:36 PM Hi there! I'm pretty sure that is a problem with cifs since I have done this before and it has failed. You should really only be doing it with locally connected drives.I have installed the Bitcoin client for Linux (bitcoin-qt). I have started it, and it started synchronizing blocks. After a while, my disk got full. I have then moved the ~/.bitcoin/blocks and ~/.bitcoin/chainstate to a different partition and created symlinks. The client started again and downloaded blocks for some hours, then also that partition got full. I have a NAS mounted via cifs (smbfs) with huge disk space. If I move the blocks and chainstate folders there and symlink them, exactly in the same way i did with the other partition, I get an error opening blocks database. It asks me if I want to rebuild it. If I answer yes, it then says the same error again and exits. Any ideas? Thank you Title: Re: Error opening blocks database Post by: bodom on April 30, 2016, 01:15:20 PM Why aren't network drivers ok? ???
Title: Re: Error opening blocks database Post by: achow101 on April 30, 2016, 02:28:07 PM Why aren't network drivers ok? ??? I haven't fully investigated it yet, so I don't know why. But after some experimentation, I do know that network drives do not work.Title: Re: Error opening blocks database Post by: bodom on April 30, 2016, 09:45:02 PM In theory, there should be no way for the Bitcoin software to distinguish between a local and a network drive. That's why I do not see why it should not work.
Is there a way to have a more precise error message saying what is wrong? Is this the right place to ask support for that software? Title: Re: Error opening blocks database Post by: achow101 on April 30, 2016, 09:54:31 PM In theory, there should be no way for the Bitcoin software to distinguish between a local and a network drive. That's why I do not see why it should not work. In theory, yes. In practice, the software implementation may be doing something which differs from a local drive and causes Bitcoin Core to react in unexpected ways.Is there a way to have a more precise error message saying what is wrong? Those error messages are in the debug.log. Can you post that here so that we can see what the errors are? IIRC, though, the error messages for this are not all to helpful.Is this the right place to ask support for that software? No. The developers do not use these forms anymore. The proper place to report bugs and issues is on the github issue tracker at https://github.com/bitcoin/bitcoin/issuesTitle: Re: Error opening blocks database Post by: bodom on April 30, 2016, 10:14:49 PM Thank you for the explanations.
I have tried doing something very weird: I have created big image file inside the network share, then mounted it. Goods news: it works. Bad news: it is incredibly slow, as expected. So the network itself is definitely not a problem. Could be a permissions problem? here is the debug.log: Code: 2016-04-30 22:11:04 Bitcoin version v0.12.1.0-g9779e1e (Mon, 11 Apr 2016 13:01:43 +0200) The folder giving an I/O error exists: Code: $stat /home/bodom/.bitcoin/blocks/index Title: Re: Error opening blocks database Post by: achow101 on April 30, 2016, 10:20:10 PM So the network itself is definitely not a problem. Could be a permissions problem? I don't think it is permissions. I think it has to do with how cifs does file sharing, although, again, I'm not sure. I'll open an issue on github since I have also had this problem before.Title: Re: Error opening blocks database Post by: bodom on April 30, 2016, 10:33:16 PM So following your hints I've found these links:
https://github.com/bitcoin/bitcoin/issues/4276 https://github.com/smira/aptly/issues/317 Quote No, this is LevelDB reporting that an internal system call returned with an error status indicating that an invalid argument was passed. I assume that the samba filesystem does not offer certain functionality that LevelDB requires of its databases, such a certain types of locking, syncing or mmaping. Long story short, BitCoin uses LevelDB from Google, that seems to have some "undfined" issues with cifs. They could most probably be fixed/worked around, but that would require me to report the problem to the Bitcoin devs, then they to report it upstream, wait for Google to fix it, then update the LevelDB version in Bitcoin. I bet it could take years :D I am now exploring different solutions. At least, the image file works. Thank you Title: Re: Error opening blocks database Post by: achow101 on April 30, 2016, 10:49:16 PM Long story short, BitCoin uses LevelDB from Google, that seems to have some "undfined" issues with cifs. They could most probably be fixed/worked around, but that would require me to report the problem to the Bitcoin devs, then they to report it upstream, wait for Google to fix it, then update the LevelDB version in Bitcoin. I bet it could take years :D I've already reported it to the devs: https://github.com/bitcoin/bitcoin/issues/7981. And since they maintain their own fork of LevelDB (https://github.com/bitcoin-core/leveldb), any fix probably has a good likelihood of making it into the next major release, 0.13. That will be in a few months though, since they usually don't have bug fixes for minor releases unless they are major problems.Title: Re: Error opening blocks database Post by: bodom on April 30, 2016, 10:58:19 PM Oh, thanks.
I see it works under NFS. I am planning to use it meanwhile (if I can manage to set it up in a safe way). Title: Re: Error opening blocks database Post by: 2c0de on May 04, 2016, 09:13:11 PM Oh, thanks. I see it works under NFS. I am planning to use it meanwhile (if I can manage to set it up in a safe way). don't never do reindex, it's a waste of time. sure. delete blocks/ and chainstate/ let it download for a day or so, on your best computer once it's downloaded, backup blocks/ and chainstate/ regularly backup chainstate/ , blocks/index/ , and the blocks/blk,rev.dat files whose size did grow (you don't need previous except last dat files backup twice because they never change anyway) If your chain becomes corrupt (Error opening blocks database), simply abort and recover known good chainstate/ , blocks/index/ , and the corresponding blocks/blk,rev.dat files once your backup is recovered bitcoin starts nearly instantly , no reindex needed |