EmpowerPlastic / empowerchain

Empowerchain is a global platform to revolutionize waste management and recycling, creating a transparent and efficient circular economy.
https://empowerchain.io
76 stars 432 forks source link

SDK function (prune) panics #988

Closed RaulBernal closed 1 year ago

RaulBernal commented 1 year ago

When you stop the node and try to force "pruning" using the new Cosmos-SDK feature it panics

Steps to reproduce

sudo service empowerd stop
empowerd prune everything 
panic: could not create directory "": mkdir : no such file or directory

goroutine 1 [running]:
github.com/cometbft/cometbft/config.EnsureRoot({0x0, 0x0})
    github.com/cometbft/cometbft@v0.37.2/config/toml.go:35 +0x1f6
github.com/cosmos/cosmos-sdk/server.interceptConfigs(0xc0013b0b60, {0xc0013d6000, 0x2e5b}, {0x2b752e0, 0xc0011e5440}, 0xc0012bec60)
    github.com/cosmos/cosmos-sdk@v0.47.3/server/util.go:230 +0x354
github.com/cosmos/cosmos-sdk/server.InterceptConfigsPreRunHandler(0x0?, {0xc0013d6000, 0x2e5b}, {0x2b752e0, 0xc0011e5440}, 0x0?)
    github.com/cosmos/cosmos-sdk@v0.47.3/server/util.go:148 +0x2e5
github.com/EmpowerPlastic/empowerchain/cmd/empowerd/cmd.NewRootCmd.func1(0xc00121cf00, {0x1?, 0x38e9ed0?, 0x1?})
    github.com/EmpowerPlastic/empowerchain/cmd/empowerd/cmd/root.go:78 +0x2bb
github.com/cometbft/cometbft/libs/cli.concatCobraCmdFuncs.func1(0xc00121cf00?, {0xc0013a66f0, 0x1, 0x1})
    github.com/cometbft/cometbft@v0.37.2/libs/cli/setup.go:118 +0x62
github.com/spf13/cobra.(*Command).execute(0xc00121cf00, {0xc0013a66b0, 0x1, 0x1})
    github.com/spf13/cobra@v1.7.0/command.go:915 +0x739
github.com/spf13/cobra.(*Command).ExecuteC(0xc0011b8f00)
    github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
    github.com/spf13/cobra@v1.7.0/command.go:992
github.com/spf13/cobra.(*Command).ExecuteContext(...)
    github.com/spf13/cobra@v1.7.0/command.go:985
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x21e6230?, {0x0, 0x0}, {0xc000059848, 0x18})
    github.com/cosmos/cosmos-sdk@v0.47.3/server/cmd/execute.go:32 +0x179
main.main()
    github.com/EmpowerPlastic/empowerchain/cmd/empowerd/main.go:20 +0x3c

Version: v1.0.0-rc3 Tested in Testnet circulus-1

RaulBernal commented 1 year ago

Tested also in my BCNAD (v0.47) development: image

RaulBernal commented 1 year ago

As Julien says here: https://github.com/cosmos/cosmos-sdk/issues/16855#issuecomment-1623579987

we should put: empowerd prune --home $HOME/.empowerchain/ --pruning everything I think we can close and wait for a UX / IX improvement :)

gjermundgaraba commented 1 year ago

As Julien says here: cosmos/cosmos-sdk#16855 (comment)

we should put: empowerd prune --home $HOME/.empowerchain/ --pruning everything I think we can close and wait for a UX / IX improvement :)

Thanks again for really digging into these things! Super useful <3