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

ambiguous import: found package github.com/knadh/koanf/providers/confmap in multiple modules #28561

Closed
HuangMarco opened this issue Oct 24, 2023 · 3 comments
Labels
bug Something isn't working needs triage New item requiring triage receiver/syslog

Comments

@HuangMarco
Copy link

Component(s)

receiver/syslog

What happened?

Description

When using this receiver to build a custom collector, there are issues happened. The issue is as below:

go: downloading github.com/antonmedv/expr v1.15.0 go: downloading github.com/mostynb/go-grpc-compression v1.2.0 go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.43.0 go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc go: downloading github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.85.0 go: finding module for package go.opentelemetry.io/collector/processor/batchprocessor go: finding module for package go.opentelemetry.io/collector/exporter/loggingexporter go: found go.opentelemetry.io/collector/exporter/loggingexporter in go.opentelemetry.io/collector/exporter/loggingexporter v0.88.0 go: found go.opentelemetry.io/collector/processor/batchprocessor in go.opentelemetry.io/collector/processor/batchprocessor v0.88.0 go: finding module for package go.opentelemetry.io/collector/otelcol go: found go.opentelemetry.io/collector/otelcol in go.opentelemetry.io/collector/otelcol v0.88.0 go.opentelemetry.io/collector/cmd/builder imports github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver imports go.opentelemetry.io/collector/confmap imports github.com/knadh/koanf/maps: ambiguous import: found package github.com/knadh/koanf/maps in multiple modules: github.com/knadh/koanf v1.5.0 (/Users/work_dir/go_workspace/src/prod/pkg/mod/github.com/knadh/koanf@v1.5.0/maps) github.com/knadh/koanf/maps v0.1.1 (/Users/work_dir/go_workspace/src/prod/pkg/mod/github.com/knadh/koanf/maps@v0.1.1) go.opentelemetry.io/collector/cmd/builder imports github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver imports go.opentelemetry.io/collector/confmap imports github.com/knadh/koanf/providers/confmap: ambiguous import: found package github.com/knadh/koanf/providers/confmap in multiple modules: github.com/knadh/koanf v1.5.0 (/Users/work_dir/go_workspace/src/pkg/mod/github.com/knadh/koanf@v1.5.0/providers/confmap) github.com/knadh/koanf/providers/confmap v0.1.0 (/Users//work_dir/go_workspace/src/prod/pkg/mod/github.com/knadh/koanf/providers/confmap@v0.1.0)

Steps to Reproduce

Use below configuration yaml to create a collector:

`dist:
name: test # the binary name. Optional.
output_path: ./otel-test # the path to write the output (sources and binary). Optional.
otelcol_version: 0.85.0

exporters:

  • import: go.opentelemetry.io/collector/exporter/loggingexporter
    gomod: go.opentelemetry.io/collector v0.85.0

- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/dynatraceexporter v0.85.0

  • gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.85.0

processors:

  • gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.85.0
  • import: go.opentelemetry.io/collector/processor/batchprocessor
    gomod: go.opentelemetry.io/collector v0.85.0

receivers:

  • gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.85.0

path: ./cfreceiver

`

Expected Result

The OTEL package should be built.

Actual Result

Error happened.

Collector version

v0.79.0~v0.87.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

dist:
  name: test # the binary name. Optional.
  output_path: ./otel-test # the path to write the output (sources and binary). Optional.
  otelcol_version: 0.85.0

exporters:
  - import: go.opentelemetry.io/collector/exporter/loggingexporter
    gomod: go.opentelemetry.io/collector v0.85.0
  # - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/dynatraceexporter v0.85.0
  - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.85.0

processors:
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.85.0
  - import: go.opentelemetry.io/collector/processor/batchprocessor
    gomod: go.opentelemetry.io/collector v0.85.0

receivers:
  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.85.0

Log output

2023-10-24T15:13:39.769+0800	INFO	internal/command.go:126	OpenTelemetry Collector Builder	{"version": "0.73.0", "date": "2023-03-07T01:45:41Z"}
2023-10-24T15:13:39.770+0800	INFO	internal/command.go:159	Using config file	{"path": "builder-config-test.yaml"}
2023-10-24T15:13:39.771+0800	INFO	builder/config.go:116	Using go	{"go-executable": "/usr/local/opt/go@1.20/bin/go"}
2023-10-24T15:13:39.771+0800	INFO	builder/main.go:52	You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API	{"builder-version": "0.73.0"}
2023-10-24T15:13:39.774+0800	INFO	builder/main.go:76	Sources created	{"path": "./otel-test"}
Error: failed to update go.mod: exit status 1. Output:
go: downloading go.opentelemetry.io/collector v0.85.0
go: downloading github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.85.0
go: downloading github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.85.0
go: downloading go.opentelemetry.io/collector/exporter/otlphttpexporter v0.85.0
go: downloading go.opentelemetry.io/collector/connector v0.85.0
go: downloading go.opentelemetry.io/collector/receiver v0.85.0
go: downloading go.opentelemetry.io/collector/config/configtelemetry v0.85.0
go: downloading go.opentelemetry.io/collector/exporter v0.85.0
go: downloading go.opentelemetry.io/collector/processor v0.85.0
go: downloading go.opentelemetry.io/collector/extension v0.85.0
go: downloading go.opentelemetry.io/collector/confmap v0.85.0
go: downloading go.opentelemetry.io/collector/component v0.85.0
go: downloading go.opentelemetry.io/collector/featuregate v1.0.0-rcv0014
go: downloading go.uber.org/zap v1.25.0
go: downloading github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.85.0
go: downloading github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.85.0
go: downloading go.opentelemetry.io/collector/consumer v0.85.0
go: downloading go.opentelemetry.io/collector/pdata v1.0.0-rcv0014
go: downloading github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.85.0
go: downloading go.opentelemetry.io/collector/config/configcompression v0.85.0
go: downloading go.opentelemetry.io/collector/config/confighttp v0.85.0
go: downloading go.opentelemetry.io/collector/config/configopaque v0.85.0
go: downloading google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc
go: downloading go.opentelemetry.io/collector/config/configtls v0.85.0
go: downloading go.opentelemetry.io/collector/receiver/otlpreceiver v0.85.0
go: downloading google.golang.org/grpc v1.58.0
go: downloading go.opentelemetry.io/collector/semconv v0.85.0
go: downloading go.opentelemetry.io/otel v1.17.0
go: downloading go.opentelemetry.io/otel/metric v1.17.0
go: downloading go.opentelemetry.io/otel/sdk/metric v0.40.0
go: downloading go.opentelemetry.io/otel/sdk v1.17.0
go: downloading go.opentelemetry.io/otel/trace v1.17.0
go: downloading go.opentelemetry.io/collector/config/confignet v0.85.0
go: downloading go.opentelemetry.io/collector/extension/zpagesextension v0.85.0
go: downloading github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.85.0
go: downloading github.com/klauspost/compress v1.16.7
go: downloading go.opentelemetry.io/collector/config/configauth v0.85.0
go: downloading go.opentelemetry.io/collector/extension/auth v0.85.0
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.43.0
go: downloading go.opentelemetry.io/collector/config/internal v0.85.0
go: downloading github.com/shirou/gopsutil/v3 v3.23.7
go: downloading go.opentelemetry.io/otel/bridge/opencensus v0.40.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.40.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.17.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.40.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.17.0
go: downloading go.opentelemetry.io/otel/exporters/prometheus v0.40.1-0.20230831181707-02616a25c68e
go: downloading go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.40.0
go: downloading go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.17.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.17.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.40.0
go: downloading go.opentelemetry.io/collector/config/configgrpc v0.85.0
go: downloading go.opentelemetry.io/contrib/zpages v0.43.0
go: downloading github.com/antonmedv/expr v1.15.0
go: downloading github.com/mostynb/go-grpc-compression v1.2.0
go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.43.0
go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc
go: downloading github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.85.0
go: finding module for package go.opentelemetry.io/collector/processor/batchprocessor
go: finding module for package go.opentelemetry.io/collector/exporter/loggingexporter
go: found go.opentelemetry.io/collector/exporter/loggingexporter in go.opentelemetry.io/collector/exporter/loggingexporter v0.88.0
go: found go.opentelemetry.io/collector/processor/batchprocessor in go.opentelemetry.io/collector/processor/batchprocessor v0.88.0
go: finding module for package go.opentelemetry.io/collector/otelcol
go: found go.opentelemetry.io/collector/otelcol in go.opentelemetry.io/collector/otelcol v0.88.0
go.opentelemetry.io/collector/cmd/builder imports
	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver imports
	go.opentelemetry.io/collector/confmap imports
	github.com/knadh/koanf/maps: ambiguous import: found package github.com/knadh/koanf/maps in multiple modules:
	github.com/knadh/koanf v1.5.0 (/Users/work_dir/go_workspace/src/prod/pkg/mod/github.com/knadh/koanf@v1.5.0/maps)
	github.com/knadh/koanf/maps v0.1.1 (/Users/work_dir/go_workspace/src/prod/pkg/mod/github.com/knadh/koanf/maps@v0.1.1)
go.opentelemetry.io/collector/cmd/builder imports
	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver imports
	go.opentelemetry.io/collector/confmap imports
	github.com/knadh/koanf/providers/confmap: ambiguous import: found package github.com/knadh/koanf/providers/confmap in multiple modules:
	github.com/knadh/koanf v1.5.0 (/Users/work_dir/go_workspace/src/prod/pkg/mod/github.com/knadh/koanf@v1.5.0/providers/confmap)
	github.com/knadh/koanf/providers/confmap v0.1.0 (/Users/work_dir/go_workspace/src/prod/pkg/mod/github.com/knadh/koanf/providers/confmap@v0.1.0)

Additional context

No response

@HuangMarco HuangMarco added bug Something isn't working needs triage New item requiring triage labels Oct 24, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski
Copy link
Member

The koanf v1.5.0 dependency which appears to be the problem here was removed in #27670.

@crobert-1
Copy link
Member

crobert-1 commented Oct 24, 2023

As @djaglowski commented, it has been fixed in the latest release, v0.88.0. I'm going to close as fixed, but please let us know if you still hit these errors on v0.88.0.

Thanks for filing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/syslog
Projects
None yet
Development

No branches or pull requests

3 participants