babylonchain / babylon

Main repo for Babylon full node
https://babylonchain.io
Other
232 stars 162 forks source link

Error creating state directory: .babylond folder created in /root despite specified home directory #631

Open meetrick opened 4 months ago

meetrick commented 4 months ago

Summary of Bug

Even if I specify a home directory when executing the babylondcommand, the .babylond folder is still created in the /root directory. However, the actual data is stored in the specified home directory. If I prevent the creation of the folder by adding touch /root/.babylond, the babylond command will fail because it cannot create the folder.

Version

Steps to Reproduce

  1. touch /root/.babylond
  2. babylond or added home flag
  3. get error as below
    
    panic: Error calling the VM: Cache error: Error creating state directory

goroutine 1 [running]: github.com/CosmWasm/wasmd/x/wasm/keeper.NewKeeper({, }, {, }, {, }, {, }, {0x3b55090, 0xc000d83480}, ...) github.com/CosmWasm/wasmd@v0.50.0/x/wasm/keeper/keeper_cgo.go:72 +0xe4d github.com/babylonchain/babylon/app.NewBabylonApp({0x3b54f28?, 0x59e74c0}, {0x3b6af60, 0xc0002399a0}, {0x0, 0x0}, 0x1, 0x0?, 0x0, 0xc000f0cc08, ...) github.com/babylonchain/babylon/app/app.go:712 +0x56c7 github.com/babylonchain/babylon/app.NewTmpBabylonApp() github.com/babylonchain/babylon/app/encoding.go:13 +0x1e5 github.com/babylonchain/babylon/cmd/babylond/cmd.NewRootCmd() github.com/babylonchain/babylon/cmd/babylond/cmd/root.go:51 +0x2a main.main() github.com/babylonchain/babylon/cmd/babylond/main.go:16 +0x1c



## Anticipated Issues:
- The coexistence of the specified `home directory` and the default `/root/.babylond` directory can cause confusion for users. This poses significant risks in terms of node management.