grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.93k stars 3.45k forks source link

build: getting lots of `unknown revision` errors #6519

Closed Dentrax closed 2 years ago

Dentrax commented 2 years ago

Describe the bug

Opened the fresh downloaded repo with Goland and got some weird errors:

go: github.com/ionos-cloud/sdk-go/v6@v6.0.5851: invalid version: unknown revision v6.0.5851
go: golang.zx2c4.com/wireguard@v0.0.20200121: invalid version: unknown revision v0.0.20200121
go: github.com/prometheus/prometheus@v1.8.2-0.20211119115433-692a54649ed7 requires
    github.com/ionos-cloud/sdk-go/v6@v6.0.5851: reading github.com/ionos-cloud/sdk-go/go.mod at revision v6.0.5851: unknown revision v6.0.5851
$ go mod tidy

go: github.com/prometheus/prometheus@v1.8.2-0.20211119115433-692a54649ed7 requires
    github.com/ionos-cloud/sdk-go/v6@v6.0.5851: reading github.com/ionos-cloud/sdk-go/go.mod at revision v6.0.5851: unknown revision v6.0.5851

Version: 8eed9a4ddebe5b5ccbd332ae517c4effe381da2a

To Reproduce Steps to reproduce the behavior:

  1. Fresh clone
  2. cd into it, open with goland
  3. see the errors

Expected behavior It should work?

Environment: -

Screenshots, Promtail config, or terminal output -

Any thoughts how to fix these?

Dentrax commented 2 years ago

I noticed the following lines in the go.sum:

github.com/ionos-cloud/sdk-go/v6 v6.0.5851 h1:Xjdta3uR5SDLXXl0oahgVIJ+AQNFCyOCuAwxPAXFUCM=
github.com/ionos-cloud/sdk-go/v6 v6.0.5851/go.mod h1:UE3V/2DjnqD5doOqtjYqzJRMpI1RiwrvuuSEPX1pdnk=

I checked the repo but couldn't find any v6.0.5851 tag. Avaiable tags are: v6.0.0-beta.1 v6.0.0-beta.2 v6.0.0-beta.3 v6.0.0-beta.4 v6.0.0-beta.5 v6.0.0-beta.6 v6.0.0-beta.7 v6.0.0-beta.8 v6.0.0-beta.9 v6.0.0 v6.0.1 v6.0.2 v6.0.3 v6.0.4 v6.1.0

db9dbe8e this commits adds that indirect dependency, any ideas @jesusvazquez?

Dentrax commented 2 years ago

Keep getting different errors on Golang:

Added the following line and error has changed:

replace github.com/ionos-cloud/sdk-go/v6 => github.com/ionos-cloud/sdk-go/v6 v6.1.0

Error:

$ go mod tidy

go: github.com/thanos-io/thanos@v0.22.0 requires
    github.com/efficientgo/e2e@v0.11.2-0.20211027134903-67d538984a47 requires
    github.com/efficientgo/tools/core@v0.0.0-20210129205121-421d0828c9a6: invalid version: unknown revision 421d0828c9a6

Goland throws:

go: github.com/grafana/loki@v1.6.2-0.20220128102010-431d018ec64f: invalid version: unknown revision 431d018ec64f
go: github.com/harlow/kinesis-consumer@v0.3.6-0.20210911031324-5a873d6e9fec: invalid version: unknown revision 5a873d6e9fec
Dentrax commented 2 years ago

Tried to get repo by Go way, but:

$ go install github.com/grafana/loki@latest

go: github.com/grafana/loki@latest: module github.com/grafana/loki@latest found (v1.6.1), but does not contain package github.com/grafana/loki

$ go install github.com/grafana/loki/v2@v2.5.0

go: github.com/grafana/loki/v2@v2.5.0: github.com/grafana/loki@v2.5.0: invalid version: module contains a go.mod file, so module path must match major version ("github.com/grafana/loki/v2")
javierhonduco commented 2 years ago

Hi @Dentrax! Just in case this is still causing issues for you, I bumped into this when I saw this same error in our project, https://github.com/ionos-cloud/sdk-go/issues/27 seems to be the culprit

Dentrax commented 2 years ago

Thanks for the letting me know! 🤗 @javierhonduco Have you solved it yet? What should I do here?

javierhonduco commented 2 years ago

I haven't properly solved it, but setting GOPROXY="https://proxy.golang.org,direct" unblocked me

Dentrax commented 2 years ago

You are awesome @javierhonduco!

$ go env -w GOPROXY="https://proxy.golang.org,direct"

This one fixed the issue. Thanks! ❤️