Skip to content

localnet: Fails to start when building from a branch due to bug in config versioning #9503

@thanethomson

Description

@thanethomson

Tendermint version (use tendermint version or git rev-parse --verify HEAD if installed from source): main, v0.37.x and v0.34.x.

ABCI app (name for built-in, URL for self-written if it's publicly available): kvstore

What happened:

Running the following on a branch (jasmina/p2p-bugfix) and not with a specific Git tag checked out:

make localnet-start

results in the following errors:

node0  | ERROR: error in config file: invalid version string: unreleased-jasmina/p2p-bugfix-4c5faa7c6c629574e8b952a7690fd07a513eb631
node3  | ERROR: error in config file: invalid version string: unreleased-jasmina/p2p-bugfix-4c5faa7c6c629574e8b952a7690fd07a513eb631
node2  | ERROR: error in config file: invalid version string: unreleased-jasmina/p2p-bugfix-4c5faa7c6c629574e8b952a7690fd07a513eb631
node1  | ERROR: error in config file: invalid version string: unreleased-jasmina/p2p-bugfix-4c5faa7c6c629574e8b952a7690fd07a513eb631

What you expected to happen:

For the localnet to start correctly.

More details:

It appears as though, when building a binary, we auto-detect whether a specific tag's checked out or a branch here:

tendermint/Makefile

Lines 8 to 12 in 45518db

ifneq ($(shell git symbolic-ref -q --short HEAD),)
VERSION := unreleased-$(shell git symbolic-ref -q --short HEAD)-$(shell git rev-parse HEAD)
else
VERSION := $(shell git describe)
endif

We also override the TMCoreSemVer variable here:

LD_FLAGS = -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION)

This TMCoreSemVer variable is used as the default value of the config version here:

Version: version.TMCoreSemVer,

This results in validation failure here and the resulting error message:

tendermint/config/config.go

Lines 305 to 307 in 45518db

if cfg.Version != "" && !semverRegexp.MatchString(cfg.Version) {
return fmt.Errorf("invalid version string: %s", cfg.Version)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    stalefor use by stalebot

    Type

    No type

    Projects

    Status

    Done/Merged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions