IOError on LOCK file when running bitcoind
When trying to run the parser while bitcoind is also running, I receive the following error:
IOError: b'IO error: lock /home/user/.bitcoin/blocks/index/LOCK: Resource temporarily unavailable'
Running the parser while the node has been shut down does work. I've mitigated this issue by copying /.bitcoin/blocks/ to another directory and referencing that with the parser, but I wonder if I'm missing something. May be related to Issue #43.
After messing around for days trying to find a good way to automate updating my "backup" blocks directory, I tried running the original script again and am now no longer getting the error above. I have no clue what the cause of this could be - is it possible that the above error only displays when a new block is being written to disk?
This is the configuration that worked today, but not previously: blockchain = Blockchain(os.path.expanduser('/home/user/.bitcoin/blocks')) bIterator = blockchain.get_ordered_blocks(os.path.expanduser('/home/user/.bitcoin/blocks/index'), start=height_start,end=height_end + 1)
I'll leave the issue open for a few days in case it occurs again.
Indeed this looks like a bug and it happened on my live node.
Unfortunately, it seems that bitcoind's index cannot be read concurrently. Therefore you can run the parser with the node running iff you're not using the get_ordered_blocks method which uses it.
I thought it is possible to mess around plyvel.DB or at least feed only *.ldb files.
However, I try to work with get_unordered_blocks to get all the data I need. Then, maybe, I will try to look for a solution.
Thanks! If there's one I'd be glad to implement it in the project.