elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
106 stars 121 forks source link

Upgrading from 7.17.22-SNAPSHOT to 8.14.0-SNAPSHOT is broken #4755

Closed rdner closed 1 week ago

rdner commented 2 weeks ago

Failed build https://buildkite.com/elastic/elastic-agent/builds/8930#018f7c4e-abf5-45be-a774-41fa9a35fb3f

fixture.go:656: >> running binary with: [C:\Users\windows\AppData\Local\Temp\TestStandaloneUpgradeUpgrade_7.17.22-SNAPSHOT_to_8.14.0-SNAPSHOT_(privileged)2978752608\001\elastic-agent-7.17.22-SNAPSHOT-windows-x86_64\elastic-agent.exe version --binary-only --yaml]
    upgrade_standalone_test.go:68: 
            Error Trace:    C:/Users/windows/agent/testing/integration/upgrade_standalone_test.go:68
                                        C:/Users/windows/agent/testing/integration/upgrade_standalone_test.go:43
            Error:          Received unexpected error:
                            could not unmarshal agent version output: error: exit status 2, output: panic: proto: file "elastic-agent-client.proto" has a name conflict over proto.STOPPING
                                previously from: "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/control/proto"
                                currently from:  "github.com/elastic/elastic-agent-client/v7/pkg/proto"
                            See https://protobuf.dev/reference/go/faq#namespace-conflict

                            goroutine 1 [running]:
                            google.golang.org/protobuf/reflect/protoregistry.glob..func1({0x1fbcc60?, 0xc0005765b0?}, {0x1fbcc60?, 0xc0005765f0})
                                /go/pkg/mod/google.golang.org/protobuf@v1.33.0/reflect/protoregistry/registry.go:56 +0x1e5
                            google.golang.org/protobuf/reflect/protoregistry.(*Files).RegisterFile.func1({0x1fda320, 0xc000557480})
                                /go/pkg/mod/google.golang.org/protobuf@v1.33.0/reflect/protoregistry/registry.go:154 +0x263
                            google.golang.org/protobuf/reflect/protoregistry.rangeTopLevelDescriptors({0x1fe2e50, 0xc000557180}, 0xc00061f790)
                                /go/pkg/mod/google.golang.org/protobuf@v1.33.0/reflect/protoregistry/registry.go:412 +0x2ce
                            google.golang.org/protobuf/reflect/protoregistry.(*Files).RegisterFile(0xc000008ed0, {0x1fe2e50?, 0xc000557180?})
                                /go/pkg/mod/google.golang.org/protobuf@v1.33.0/reflect/protoregistry/registry.go:149 +0x73e
                            google.golang.org/protobuf/internal/filedesc.Builder.Build({{0x1927e23, 0x34}, {0x2e15580, 0x1308, 0x1308}, 0x8, 0x17, 0x0, 0x1, {0x1fc2a48, ...}, ...})
                                /go/pkg/mod/google.golang.org/protobuf@v1.33.0/internal/filedesc/build.go:112 +0x1d6
                            google.golang.org/protobuf/internal/filetype.Builder.Build({{{0x1927e23, 0x34}, {0x2e15580, 0x1308, 0x1308}, 0x8, 0x17, 0x0, 0x1, {0x0, ...}, ...}, ...})
                                /go/pkg/mod/google.golang.org/protobuf@v1.33.0/internal/filetype/build.go:138 +0x199
                            github.com/elastic/elastic-agent-client/v7/pkg/proto.file_elastic_agent_client_proto_init()
                                /go/pkg/mod/github.com/elastic/elastic-agent-client/v7@v7.8.1/pkg/proto/elastic-agent-client.pb.go:2971 +0x258
                            github.com/elastic/elastic-agent-client/v7/pkg/proto.file_elastic_agent_client_future_proto_init()
                                /go/pkg/mod/github.com/elastic/elastic-agent-client/v7@v7.8.1/pkg/proto/elastic-agent-client-future.pb.go:1329 +0x30
                            github.com/elastic/elastic-agent-client/v7/pkg/proto.init.1()
                                /go/pkg/mod/github.com/elastic/elastic-agent-client/v7@v7.8.1/pkg/proto/elastic-agent-client-future.pb.go:1324 +0xf

                            yaml: mapping values are not allowed in this context
            Test:           TestStandaloneUpgrade/Upgrade_7.17.22-SNAPSHOT_to_8.14.0-SNAPSHOT_(privileged)
elasticmachine commented 2 weeks ago

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

rdner commented 2 weeks ago

I can't see any recent changes in the 7.17 branch that could cause this. There is a client update https://github.com/elastic/beats/pull/39224 on Apr 25 but that would've failed earlier.

cmacknz commented 2 weeks ago

@michel-laterman this definitely seems related to https://github.com/elastic/beats/pull/39224

michel-laterman commented 2 weeks ago

The initial error; where it can't get the starting agent version might be due to the 7.17.x builds including a hash in their version report, but the more recent ones do not:

https://github.com/elastic/beats/blob/7.17/x-pack/elastic-agent/pkg/agent/control/proto/control.pb.go#L182-L195

rdner commented 2 weeks ago

Disabling the version until this is resolved https://github.com/elastic/elastic-agent/pull/4758

michel-laterman commented 2 weeks ago

actually this error occurs when running elastic-agent version on 7.17.22-snapshot

ycombinator commented 1 week ago

Fixed via https://github.com/elastic/beats/pull/39585