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

[cmd/builder] Updating OCB to v0.109.0 broke implied providers #11152

Closed
jburns24 opened this issue Sep 11, 2024 · 1 comment · Fixed by #11168
Closed

[cmd/builder] Updating OCB to v0.109.0 broke implied providers #11152

jburns24 opened this issue Sep 11, 2024 · 1 comment · Fixed by #11168
Labels
bug Something isn't working

Comments

@jburns24
Copy link

Describe the bug
Updating our collector components including cmd/builder to v0.109.0 caused build failures when resolving envprovider and runtime errors for the fileprovider.

After updating to v0.109.0 building our collector errored out with the following.

Error: mismatch in go.mod and builder configuration versions: component "go.opentelemetry.io/collector/confmap/provider/envprovider" version calculated by dependencies "v1.15.0" does not match configured version "v0.109.0". Use --skip-strict-versioning to temporarily disable this check. This flag will be removed in a future minor version
make: *** [build] Error 1

I noticed in the core collector and the contrib collector your OCB config files specified

 providers: 
   - gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.15.0 

Adding this to our builder config file resolved the build error.

Updating to 0.109.0 also caused our collector to fail with the following runtime error when trying to pass in a config file

2024-09-10T15:49:45.870-0700	INFO	builder/main.go:35	Running go subcommand.	{"arguments": ["build", "-trimpath", "-o", "otelcol-custom", "-ldflags=-s -w"]}
2024-09-10T15:49:50.519-0700	INFO	builder/main.go:131	Compiled	{"binary": "./build/otelcol-custom"}
/Users/jburns/git/liatrio-otel-collector/build/otelcol-custom --config config/config.yaml
Error: failed to get config: cannot resolve the configuration: cannot retrieve the configuration: scheme "file" is not supported for uri "file:config/config.yaml"
2024/09/10 15:49:52 collector server run finished with error: failed to get config: cannot resolve the configuration: cannot retrieve the configuration: scheme "file" is not supported for uri "file:config/config.yaml"
make: *** [run] Error 1

Adding the following to the list of providers in the builder config file resolved this runtime error.

 - gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.15.0 

Steps to reproduce

  1. clone https://github.com/liatrio/liatrio-otel-collector
  2. Checkout v0.68.0
  3. comment out the providers section of config/manifest.yaml
  4. run make build -> this will give the envprovider error

To reproduce the runtime error you would need to go through the Get Started guide and then run make run

What did you expect to see?
Building the collector and running the collector without explicitly setting these providers in the OCB builder configuration worked. This worked for us when using v0.108.0 (which you can see if you checkout v0.67.0 of the liatrio-otel-collector)

What version did you use?
v0.109.0

What config did you use?

---
dist:
  name: otelcol-custom
  module: github.com/liatrio/liatrio-otel-collector
  description: Basic OTel Collector distribution for Developers
  otelcol_version: 0.109.0
  output_path: ./build
  debug_compilation: false

extensions:
  - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.109.0
  - gomod: github.com/liatrio/liatrio-otel-collector/extension/githubappauthextension v0.52.0

exporters:
  - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.109.0
  - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.109.0
  - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/influxdbexporter v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/lokiexporter v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opensearchexporter v0.109.0

processors:
  - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.109.0
  - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.109.0

receivers:
  - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.109.0
  - gomod: github.com/liatrio/liatrio-otel-collector/receiver/gitproviderreceiver v0.1.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/webhookeventreceiver v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscloudwatchmetricsreceiver v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscloudwatchreceiver v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8seventsreceiver v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sobjectsreceiver v0.109.0

connectors:
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.109.0
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector v0.109.0

# providers:
#  - gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.15.0
#  - gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.15.0

replaces:
  - github.com/liatrio/liatrio-otel-collector/receiver/gitproviderreceiver => ../receiver/gitproviderreceiver/
  - github.com/liatrio/liatrio-otel-collector/extension/githubappauthextension => ../extension/githubappauthextension/

Environment
OS: macOS 14.5 (23F79)
Compiler: go 1.23

@jburns24 jburns24 added the bug Something isn't working label Sep 11, 2024
@bogdandrutu
Copy link
Member

Hi @jburns24,

Thanks for a very detailed report, I've also updated the release notes to point to this problem https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.109.0.

Also this was discussed in #11129.

Unfortunately our first fix does not work because of the StrictVersioning check that happens here

adrielp pushed a commit to liatrio/liatrio-otel-collector that referenced this issue Sep 12, 2024
Explicitly add providers to builder config due to upstream design assumptions that enforce strict versioning and assume that inferred default provider modules match the builder version 
* https://github.com/open-telemetry/opentelemetry-collector/blob/main/cmd/builder/internal/builder/config.go#L219-L231
* open-telemetry/opentelemetry-collector#11152
mx-psi added a commit that referenced this issue Sep 13, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Disable strict version check. The `--skip-strict-version-check` is kept
but is now a no-op.

This fixes #11152.

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes #11152
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

Successfully merging a pull request may close this issue.

2 participants