Skip to content

testnet command fails for non-validators #3408

@srmo

Description

@srmo

Tendermint version :

  • latest develop
  • 0.30.1
  • 0.30.2
    seems to happen since the split of priv_validator (key + state)

Environment:

  • OS (e.g. from /etc/os-release):
    linux + osx + win

What happened:
Running the testnet command with the --n switch to create also non-validator configs fails with a panic:

panic: open testnettest/node1/data/write-file-atomic-03340859495113226364: no such file or directory

goroutine 1 [running]:
github.com/tendermint/tendermint/privval.(*FilePVLastSignState).Save(0xc000364e08)
	/Users/smueller/development/projects/tendermint/code/src/github.com/tendermint/tendermint/privval/file.go:127 +0x18f
github.com/tendermint/tendermint/privval.(*FilePV).Save(0xc000364dc0)
	/Users/smueller/development/projects/tendermint/code/src/github.com/tendermint/tendermint/privval/file.go:258 +0x64
github.com/tendermint/tendermint/cmd/tendermint/commands.initFilesWithConfig(0xc000151900, 0x18, 0x1ed)
	/Users/smueller/development/projects/tendermint/code/src/github.com/tendermint/tendermint/cmd/tendermint/commands/init.go:37 +0xcff
github.com/tendermint/tendermint/cmd/tendermint/commands.testnetFiles(0x2383000, 0xc000136d20, 0x0, 0x6, 0x0, 0x0)
	/Users/smueller/development/projects/tendermint/code/src/github.com/tendermint/tendermint/cmd/tendermint/commands/testnet.go:118 +0x7ac
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).execute(0x2383000, 0xc000136c60, 0x6, 0x6, 0x2383000, 0xc000136c60)
	/Users/smueller/development/projects/tendermint/code/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:698 +0x47a
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x23829a0, 0xc00049bde0, 0xc0000f5e28, 0x13f3a6d)
	/Users/smueller/development/projects/tendermint/code/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:783 +0x2dc
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).Execute(0x23829a0, 0x13f331b, 0xc000143c10)
	/Users/smueller/development/projects/tendermint/code/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:736 +0x2b
github.com/tendermint/tendermint/libs/cli.Executor.Execute(0x23829a0, 0x1bb3c70, 0x2, 0xc000344680)
	/Users/smueller/development/projects/tendermint/code/src/github.com/tendermint/tendermint/libs/cli/setup.go:89 +0x4e
main.main()

Example command: tendermint testnet --v 1 --n 1 --o build/testnettest
Running the command for validators only works

What you expected to happen:
The command works

Have you tried the latest version: yes/no
Yes

How to reproduce it (as minimally and precisely as possible):
Run the above command

Anything else we need to know:
Analysis shows that the testnet command fails to pregenerate the data directory for non-validators, which leads to the not-found panic.

Creating the fix branch right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions