reth icon indicating copy to clipboard operation
reth copied to clipboard

No way to configure `datadir` when running `reth db repair-trie`

Open bwc1337 opened this issue 1 week ago • 2 comments
trafficstars

Describe the bug

Problem

It does not seem possible to configure the datadir when running:

reth db repair-trie

See below steps to reproduce.

Questions

  1. What is the right way to run this command?
  2. Could additional explanations and examples be added to the docs?
  3. Could more user-friendly options, consistent with reth node, be added?

Steps to reproduce

  1. Prepare a Reth datadir with mainnet data, placed in an arbitrary directory which is not the default (${HOME}/.local/share/reth/mainnet), e.g., /var/lib/reth/mainnet.
  2. Try to run reth db repair-trie against that directory.

Attempts

Attempt 1: Defaults

By default, it says that the directory does not exist:

$ reth db repair-trie --chain mainnet --dry-run
[...]
Error: Datadir does not exist: "${HOME}/.local/share/reth/mainnet"
Attempt 2: Pass a --datadir option

Attempting to pass a --datadir option, like when running the Execution Client, does not work, as the option is not supported:

$ reth db repair-trie --chain mainnet --datadir /path/to/data/dir --dry-run
error: unexpected argument '--datadir' found
Attempt 3: Pass an argument

Attempting to pass an argument is also not supported:

$ reth db repair-trie --chain mainnet --dry-run /path/to/data/dir
error: unexpected argument '/path/to/data/dir' found

Usage: reth db repair-trie [OPTIONS]

For more information, try '--help'.
Attempt 4: Use an environment variable

Attempting to pass an environment variable also doesn't work:

$ DATA_DIR="/path/to/data/dir" reth db repair-trie --chain mainnet --dry-run
Error: Datadir does not exist: "${HOME}/.local/share/reth/mainnet"

Potentially relevant code

  • https://github.com/paradigmxyz/reth/blob/84785f025eac5eed123997454998db77a299e1e5/crates/cli/commands/src/db/mod.rs#L73-L83
  • https://github.com/paradigmxyz/reth/blob/84785f025eac5eed123997454998db77a299e1e5/crates/node/core/src/args/datadir_args.rs#L8-L38

Node logs

N/A.

Platform(s)

Linux (x86)

Container Type

Not running in a container

What version/commit are you on?

$ reth --version
Reth Version: 1.9.0
Commit SHA: 84785f025eac5eed123997454998db77a299e1e5
Build Timestamp: 2025-11-05T13:56:53.988649620Z
Build Features: asm_keccak,jemalloc,min_debug_logs,otlp
Build Profile: maxperf

What database version are you on?

Data initially created by reth at version 1.6.x. Cannot confirm the exact version of the database as I cannot run reth db pointing to where the data is...

Which chain / network are you on?

mainnet

What type of node are you running?

Full via --full flag

What prune config do you use, if any?

I don't use a reth.toml file.

If you've built Reth from source, provide the full command you used

Not built from source. Using the 1.9.0 binary from GitHub releases.

Code of Conduct

  • [x] I agree to follow the Code of Conduct

bwc1337 avatar Nov 07 '25 14:11 bwc1337