Lighthouse: Ensure dbs are found when using --datadir

Created on 13 Dec 2019  路  5Comments  路  Source: sigp/lighthouse

Description

When attempting to use a custom datadir I got a "database not found" (or similar) message. I haven't looked into it, but I suspect there's a bug here.

bug

Most helpful comment

I am seeing this as well when trying to run with --datadir as the root of a docker volume. It's an empty volume with no existing database, but I want it to create all files in there.

All 5 comments

All right so we (@pawanjay176 and I ) tried toying around with --datadir etc, but did not manage to trigger this.
The only way we found something that looks like the error message you got was when we deleted the chain_db folder inside ~/.lighthouse/beacon. So I'm guessing maybe you used --datadir to a location where there was an existing beacon folder but no chain_db?
The message was

Failed to start Lighthouse: Failed to start beacon node: No database found in datadir. Use 'testnet -f' to overwrite the existing datadir, or specify a different `--datadir`.

This seems like it is an acceptable behaviour, but maybe we should be a bit more verbose in the error message? Also testnet -f doesn't seem to be specific enough!

@AgeManning I think you were the one that came across this after we were recovering from the 13-dec crash. What are your thoughts on the above comment?

I am seeing this as well when trying to run with --datadir as the root of a docker volume. It's an empty volume with no existing database, but I want it to create all files in there.

I was increasing space. If you had a testnet going. I moved the ~/.lighthouse directory to another folder then tried to re-run with the datadir.
For example, moving ~/.lighthouse to /tmp and then running with datadir=/tmp/.lighthouse gave this error for me.

I recall having to specify datadir=/tmp/.lighthouse/beacon_chain or something, which is unintuitive and it still had issues even when doing that.

I think we have some assumptions about the directory being at ~/.lighthouse

Ok so I found the (silly) mistake.
Fixed it (there was a missing .join(BEACON_NODE_DIR), and updated the error message. :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JustinDrake picture JustinDrake  路  3Comments

michaelsproul picture michaelsproul  路  4Comments

paulhauner picture paulhauner  路  5Comments

q9f picture q9f  路  4Comments

michaelsproul picture michaelsproul  路  4Comments