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

go install fails for mdatagen #9281

Open
atoulme opened this issue Jan 12, 2024 · 11 comments · Fixed by #9310
Open

go install fails for mdatagen #9281

atoulme opened this issue Jan 12, 2024 · 11 comments · Fixed by #9310

Comments

@atoulme
Copy link
Contributor

atoulme commented Jan 12, 2024

Expected:

cd /tmp
go install github.com/open-telemetry/opentelemetry-collector/cmd/mdatagen@latest

should install mdatagen under $GOBIN.

Actual:

go install github.com/open-telemetry/opentelemetry-collector/cmd/mdatagen@latest
go: github.com/open-telemetry/opentelemetry-collector/cmd/mdatagen@latest (in github.com/open-telemetry/opentelemetry-collector/cmd/mdatagen@v0.92.0):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.
codeboten pushed a commit to codeboten/opentelemetry-collector that referenced this issue Jan 17, 2024
This fixes open-telemetry#9281

Signed-off-by: Alex Boten <aboten@lightstep.com>
bogdandrutu pushed a commit that referenced this issue Jan 22, 2024
Fixes
#9281

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
TylerHelmuth pushed a commit to TylerHelmuth/opentelemetry-collector that referenced this issue Jan 23, 2024
…ry#9310)

Fixes
open-telemetry#9281

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
@codeboten codeboten reopened this Jan 23, 2024
@bogdandrutu
Copy link
Member

@atoulme
Copy link
Contributor Author

atoulme commented Jan 23, 2024

It works in this repository, but not under a different folder. This means we can't use it for contrib.
I have amended the steps to reproduce.

@cpheps
Copy link
Contributor

cpheps commented Mar 29, 2024

We are also experiencing this when trying to install the mdatagen tool via go install for our distribution.

@khushhboo
Copy link

Is there a fix for this yet? Trying to update some generated files in vcenterreceiver.

@atoulme
Copy link
Contributor Author

atoulme commented Mar 31, 2024

Weird, please make sure you are on latest main and run make generate.

@khushhboo
Copy link

khushhboo commented Apr 1, 2024

Issue persists, tried from inside a folder and from repository as well. Make generate fails.

Error displayed after go install github.com/open-telemetry/opentelemetry-collector/cmd/mdatagen@latest:
go: go.opentelemetry.io/collector/cmd/mdatagen@latest (in go.opentelemetry.io/collector/cmd/mdatagen@v0.97.0):
The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.

@atoulme
Copy link
Contributor Author

atoulme commented Apr 11, 2024

Please check that GOBIN is in your PATH. This might be the problem.

@woody1872
Copy link

Also seeing this issue:

$ go install github.com/open-telemetry/opentelemetry-collector/cmd/mdatagen@latest
go: github.com/open-telemetry/opentelemetry-collector/cmd/mdatagen@latest (in github.com/open-telemetry/opentelemetry-collector/cmd/mdatagen@v0.99.0):
	The go.mod file for the module providing named packages contains one or
	more replace directives. It must not contain directives that would cause
	it to be interpreted differently than if it were the main module.

@atoulme
Copy link
Contributor Author

atoulme commented May 2, 2024

I also can still reproduce. The way contrib works around this is by importing mdatagen into a go.mod first, and then install from there:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/Makefile#L283

@mmynk
Copy link

mmynk commented May 6, 2024

Some traction on this would be appreciated.

Trying to understand why the replace directives were added in the first place in #9358. What issue does that solve?

@TamerSherif
Copy link

still experiencing this when doing go install go.opentelemetry.io/collector/cmd/mdatagen@v0.99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants