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

Error on try compiler #10

Closed
antoniogil opened this issue Sep 6, 2023 · 4 comments
Closed

Error on try compiler #10

antoniogil opened this issue Sep 6, 2023 · 4 comments

Comments

@antoniogil
Copy link

Trying compile this extension following the instructions on this web https://k6.io/docs/results-output/real-time/elasticsearch/

get the next error:

go: downloading go.buf.build/grpc/go/prometheus/prometheus v1.4.4
go: k6 imports
go.k6.io/k6/cmd imports
github.com/grafana/xk6-output-prometheus-remote/pkg/remotewrite imports
go.buf.build/grpc/go/prometheus/prometheus: unrecognized import path "go.buf.build/grpc/go/prometheus/prometheus": https fetch: Get "https://go.buf.build/grpc/go/prometheus/prometheus?go-get=1": dial tcp: lookup go.buf.build: no such host
2023/09/06 13:08:24 [INFO] Cleaning up temporary folder: C:\Users\agfierro\AppData\Local\Temp\buildenv_2023-09-06-1308.10199663
2023/09/06 13:08:24 [FATAL] exit status 1

@danielmitterdorfer
Copy link
Member

danielmitterdorfer commented Sep 7, 2023

Thanks for the report. I tried to reproduce your output by following the instructions in https://k6.io/docs/results-output/real-time/elasticsearch/.

Here's what I did:

go install go.k6.io/xk6/cmd/xk6@latest
xk6 build --with github.com/elastic/xk6-output-elasticsearch

That's the complete output that I got:

2023/09/07 07:29:58 [INFO] Temporary folder: /tmp/buildenv_2023-09-07-0729.982824198
2023/09/07 07:29:58 [INFO] Initializing Go module
2023/09/07 07:29:58 [INFO] exec (timeout=10s): /usr/bin/go mod init k6 
go: creating new go.mod: module k6
2023/09/07 07:29:58 [INFO] Pinning versions
2023/09/07 07:29:58 [INFO] exec (timeout=0s): /usr/bin/go mod edit -require github.com/elastic/xk6-output-elasticsearch@latest 
2023/09/07 07:29:58 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17 
go: downloading github.com/elastic/xk6-output-elasticsearch v0.1.0
go: finding module for package github.com/rogpeppe/go-internal/fmtsort
go: found github.com/rogpeppe/go-internal/fmtsort in github.com/rogpeppe/go-internal v1.11.0
2023/09/07 07:30:00 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17 
2023/09/07 07:30:00 [INFO] Writing main module: /tmp/buildenv_2023-09-07-0729.982824198/main.go
2023/09/07 07:30:00 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17 
2023/09/07 07:30:00 [INFO] Build environment ready
2023/09/07 07:30:00 [INFO] Building k6
2023/09/07 07:30:00 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17 
2023/09/07 07:30:00 [INFO] exec (timeout=0s): /usr/bin/go build -o /home/daniel/src/go/xk6/k6 -ldflags=-w -s -trimpath 
2023/09/07 07:30:12 [INFO] Build complete: ./k6
2023/09/07 07:30:12 [INFO] Cleaning up temporary folder: /tmp/buildenv_2023-09-07-0729.982824198

xk6 has now produced a new k6 binary which may be different than the command on your system path!
Be sure to run './k6 run <SCRIPT_NAME>' from the '/home/daniel/src/go/xk6' directory.

The output that you pasted seems to indicate to me that you've built a different extension as it mentions github.com/grafana/xk6-output-prometheus-remote)? Finally, the error dial tcp: lookup go.buf.build: no such host indicates to me that you're running into grafana/k6#3252, so maybe this is solved by rerunning go install go.k6.io/xk6/cmd/xk6@latest.

Can you please retry the two commands that I pasted above and retry? If it does not work, can you please paste the full output?

@antoniogil
Copy link
Author

Hello, thanks for you anwser. I've executed the instruccions again with the same result.

I forgot to say than i'm on Window 10 to build.

The complete logs are:

❯❯ k6-elastic-search 11:22 go install go.k6.io/xk6/cmd/xk6@latest
execution correct without problem

❯❯ k6-elastic-search  11:22 xk6 build --with github.com/elastic/xk6-output-elasticsearch
2023/09/07 11:22:59 [INFO] Temporary folder: C:\Users\agfierro\AppData\Local\Temp\buildenv_2023-09-07-1122.2487129068
2023/09/07 11:22:59 [INFO] Initializing Go module
2023/09/07 11:22:59 [INFO] exec (timeout=10s): C:\Program Files\Go\bin\go.exe mod init k6
go: creating new go.mod: module k6
2023/09/07 11:22:59 [INFO] Pinning versions
2023/09/07 11:22:59 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe mod edit -require github.com/elastic/xk6-output-elasticsearch@latest
2023/09/07 11:22:59 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe mod tidy -compat=1.17
go: finding module for package github.com/rogpeppe/go-internal/fmtsort
go: found github.com/rogpeppe/go-internal/fmtsort in github.com/rogpeppe/go-internal v1.11.0
2023/09/07 11:23:01 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe mod tidy -compat=1.17
2023/09/07 11:23:03 [INFO] Writing main module: C:\Users\agfierro\AppData\Local\Temp\buildenv_2023-09-07-1122.2487129068\main.go
2023/09/07 11:23:03 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe mod tidy -compat=1.17
go: downloading go.buf.build/grpc/go/prometheus/prometheus v1.4.4
go: k6 imports
        go.k6.io/k6/cmd imports
        github.com/grafana/xk6-output-prometheus-remote/pkg/remotewrite imports
        go.buf.build/grpc/go/prometheus/prometheus: unrecognized import path "go.buf.build/grpc/go/prometheus/prometheus": https fetch: Get "https://go.buf.build/grpc/go/prometheus/prometheus?go-get=1": dial tcp: lookup go.buf.build: no such host
2023/09/07 11:23:06 [INFO] Cleaning up temporary folder: C:\Users\agfierro\AppData\Local\Temp\buildenv_2023-09-07-1122.2487129068
2023/09/07 11:23:06 [FATAL] exit status 1

execution with error

Thank you so much.

@danielmitterdorfer
Copy link
Member

Hmm, that's really odd. I can't point my finger to it but it seems somewhere is still an outdated version left around. Would the workaround mentioned in grafana/k6#3252 work for you?

xk6 build --with github.com/elastic/xk6-output-elasticsearch --replace go.buf.build/grpc/go/prometheus/prometheus=buf.build/gen/go/prometheus/prometheus/protocolbuffers/go@latest --replace go.buf.build/grpc/go/gogo/protobuf=buf.build/gen/go/gogo/protobuf/protocolbuffers/go@latest

This changes the URL from where two dependencies are fetched from go.buf.build to buf.build.

@antoniogil
Copy link
Author

Thanks.

With this solution I had can compile and get a k6 client with elastic search output

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

No branches or pull requests

2 participants