Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocb go mod tidy bug v0.107.0 #10895

Open
agardnerIT opened this issue Aug 16, 2024 · 4 comments
Open

ocb go mod tidy bug v0.107.0 #10895

agardnerIT opened this issue Aug 16, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@agardnerIT
Copy link

agardnerIT commented Aug 16, 2024

I'm following the OCB instructions and getting invalid value "1.21" for flag -compat

I found this issue so I specified go: (whereis go) but that didn't seem to do anything.

`go version

  1. Downloaded v0.107.0
  2. Created my manifest file
dist:
  name: otelcol-dev
  description: Basic OTel Collector distribution for Developers
  output_path: ./otelcol-dev
  otelcol_version: 0.107.0
  go: /usr/local/go/bin/go

receivers:
  - gomod:
      go.opentelemetry.io/collector/receiver/filestatsreceiver v0.107.0
./ocb_0.107.0_darwin_arm64 --config manifest.yaml --verbose
2024-08-16T15:50:36.299+1000    INFO    internal/command.go:125 OpenTelemetry Collector Builder {"version": "(devel)"}
2024-08-16T15:50:36.302+1000    INFO    internal/command.go:161 Using config file       {"path": "manifest.yaml"}
2024-08-16T15:50:36.474+1000    INFO    builder/config.go:142   Using go        {"go-executable": "/usr/local/go/bin/go"}
2024-08-16T15:50:36.475+1000    INFO    builder/main.go:100     Sources created {"path": "./otelcol-dev"}
2024-08-16T15:50:36.475+1000    INFO    builder/main.go:34      Running go subcommand.  {"arguments": ["mod", "tidy", "-compat=1.21"]}
Error: failed to update go.mod: go subcommand failed with args '[mod tidy -compat=1.21]': exit status 2, error message: invalid value "1.21" for flag -compat: maximum supported Go version is 1.20
usage: go mod tidy [-e] [-v] [-x] [-go=version] [-compat=version]
Run 'go help mod tidy' for details.
% go version
go version go1.20.4 darwin/amd64

Extended Manifest

I thought it may have been to do with only having a receiver, so I added processors and exporters. Still the same.

dist:
  name: otelcol-dev
  description: Basic OTel Collector distribution for Developers
  output_path: ./otelcol-dev
  otelcol_version: 0.107.0
  go: /usr/local/go/bin/go

receivers:
  - gomod: go.opentelemetry.io/collector/receiver/filestatsreceiver v0.107.0
processors:
  - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.107.0
exporters:
  - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.107.0
  - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.107.0

Generate default collector

Reading the man it suggests that running without --config will generate a default collector. This also fails, so this bug has nothing to do with the config YAML file:

% ./ocb_0.107.0_darwin_arm64                              
2024-08-16T15:57:02.193+1000    INFO    internal/command.go:125 OpenTelemetry Collector Builder {"version": "(devel)"}
2024-08-16T15:57:02.193+1000    INFO    internal/command.go:136 Using default build configuration
2024-08-16T15:57:02.194+1000    INFO    builder/config.go:142   Using go        {"go-executable": "/usr/local/go/bin/go"}
2024-08-16T15:57:02.197+1000    INFO    builder/main.go:100     Sources created {"path": "/var/folders/kj/8djq04fs2_v7ywp6lqy67bxc0000gn/T/otelcol-distribution2427294044"}
Error: failed to update go.mod: go subcommand failed with args '[mod tidy -compat=1.21]': exit status 2, error message: invalid value "1.21" for flag -compat: maximum supported Go version is 1.20
usage: go mod tidy [-e] [-v] [-x] [-go=version] [-compat=version]
Run 'go help mod tidy' for details.
@agardnerIT agardnerIT added the bug Something isn't working label Aug 16, 2024
@codeboten
Copy link
Contributor

thanks for the report @agardnerIT, the policy of go support for the collector is to support N-1 where N is the latest version of go. See https://github.com/open-telemetry/opentelemetry-collector/blob/main/CONTRIBUTING.md#required-tools for more details. As of v0.107.0, the supported versions were go 1.21 and go 1.22

@chan-tim-sumo
Copy link

hey @agardnerIT , do you know how come the output shows (devel):

2024-08-16T15:50:36.299+1000    INFO    internal/command.go:125 OpenTelemetry Collector Builder {"version": "(devel)"}

? shouldn't it be 0.107.0?

@chan-tim-sumo
Copy link

@codeboten do you have an idea why this might be also?

@quarckster
Copy link

I was trying to build a collector with ocb version 0.96.0 and got this error too. Is there a way to stick with the specific Go version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants