Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

LevelDB doesn't like vboxfs #794

Open
olalonde opened this issue Mar 23, 2015 · 4 comments
Open

LevelDB doesn't like vboxfs #794

olalonde opened this issue Mar 23, 2015 · 4 comments
Labels
question Usability question, not directly related to an error with Boot2Docker

Comments

@olalonde
Copy link

I have a docker-compose.yml file that looks like this:

bitcoind:
  image: kylemanna/bitcoind
  volumes:
    - ~/.bitcoin:/bitcoin/.bitcoin
  user: root
  command: bitcoind -server=0 -testnet -printtoconsole
  ports:
    - "18333"

I'm getting the following error when running docker-compose up bitcoind:

$ docker-compose up bitcoind
Recreating bsync_bitcoind_1...
Attaching to bsync_bitcoind_1
bitcoind_1 | Bitcoin version v0.9.4.0-g41f94ed-beta (Mon, 12 Jan 2015 10:36:57 +0100)
bitcoind_1 | Using OpenSSL version OpenSSL 1.0.1f 6 Jan 2014
bitcoind_1 | Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
bitcoind_1 | Default data directory /bitcoin/.bitcoin
bitcoind_1 | Using data directory /bitcoin/.bitcoin/testnet3
bitcoind_1 | Using at most 125 connections (1048576 file descriptors available)
bitcoind_1 | Using 4 threads for script verification
bitcoind_1 | Using wallet wallet.dat
bitcoind_1 | init message: Verifying wallet...
bitcoind_1 | CDBEnv::Open : LogDir=/bitcoin/.bitcoin/testnet3/database ErrorFile=/bitcoin/.bitcoin/testnet3/db.log
bitcoind_1 | Bound to [::]:18333
bitcoind_1 | Bound to 0.0.0.0:18333
bitcoind_1 | init message: Loading block index...
bitcoind_1 | Opening LevelDB in /bitcoin/.bitcoin/testnet3/blocks/index
bitcoind_1 | IO error: /bitcoin/.bitcoin/testnet3/blocks/index: Invalid argument
bitcoind_1 | : Error opening block database.
bitcoind_1 |
bitcoind_1 | Do you want to rebuild the block database now?
bitcoind_1 | Aborted block database rebuild. Exiting.
bitcoind_1 | : Error opening block database.
bitcoind_1 |
bitcoind_1 | Do you want to rebuild the block database now?
bitcoind_1 | Shutdown : In progress...
bitcoind_1 | StopNode()
bitcoind_1 | Shutdown : done
bsync_bitcoind_1 exited with code 1

After some Googling, this is probably because LevelDB doesn't support the vboxfs filesystem which boot2docker uses for mounted directories.

I was wondering what are my options here (considering I want to persist the bitcoind data across docker-compose up commands). I tried mounting a directory directly from the boot2docker VM and it works fine but the VM quickly runs out of space (and resizing it is a PITA). Ideally, I would like to mount the ~/.bitcoind from my host but it won't work with vboxfs.

Is there a way to change which filesystem boot2docker uses for mounting?

@olalonde
Copy link
Author

Well, I fixed the problem by mounting /Users with nfs instead of vboxsf in boot2docker. I made a script here: https://gist.github.com/olalonde/3f7512c0bd2bc8abb46d

@SvenDowideit
Copy link
Contributor

@tianon @bfirsh another b2d user that created an nfs based solution....

@SvenDowideit SvenDowideit reopened this Mar 24, 2015
@olalonde
Copy link
Author

Disclaimer: I just tested the script on my local machine so I'm not sure it will work on different setups. Basically the script adds the correct line to /etc/exports on OS X and executes a shell script on b2d VM to mount /Users with nfs. It's safe to run the script multiple times because it deletes any line in /etc/exports that start with /Users (a backup of /etc/exports is made on first run).

@hypergig
Copy link

I just tried with docker for mac it works completely natively.

https://docs.docker.com/docker-for-mac/

I was able to use a blockchain that I copied from my bitcoind node that I was running in docker-machine.

@wglambert wglambert added the question Usability question, not directly related to an error with Boot2Docker label Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Usability question, not directly related to an error with Boot2Docker
Projects
None yet
Development

No branches or pull requests

4 participants