keilerkonzept / terraform-module-versions

CLI tool that checks Terraform code for module updates. Single binary, no dependencies. linux, osx, windows. #golang #cli #terraform
MIT License
188 stars 27 forks source link

Error on installing terraform-module-version (go install github.com/keilerkonzept/terraform-module-versions@latest) #89

Open pawelrosada opened 2 years ago

pawelrosada commented 2 years ago

I have problem installing go module from today morning.

What I use: Docker: golang:latest

I test too on: go version go version go1.19 darwin/arm64

Same error everywhere:

Error:

go: finding module for package github.com/gobwas/glob
go: finding module for package github.com/hashicorp/go-safetemp
go: finding module for package github.com/apparentlymart/go-textseg/v13/textseg
go: finding module for package github.com/jbenet/go-context/io
go: finding module for package github.com/bgentry/go-netrc/netrc
go: finding module for package golang.org/x/text/unicode/norm
go: finding module for package github.com/mattn/go-runewidth
go: finding module for package github.com/hashicorp/go-cleanhttp
go: finding module for package github.com/klauspost/compress/zstd
go: finding module for package github.com/mitchellh/go-homedir
go: finding module for package github.com/ulikunitz/xz
go: finding module for package golang.org/x/oauth2
go: finding module for package google.golang.org/api/iterator
go: finding module for package google.golang.org/api/option
go: finding module for package github.com/ProtonMail/go-crypto/openpgp
go: finding module for package github.com/go-git/go-billy/v5
go: finding module for package github.com/go-git/go-billy/v5/osfs
go: finding module for package github.com/go-git/go-billy/v5/util
go: finding module for package github.com/imdario/mergo
go: finding module for package github.com/sergi/go-diff/diffmatchpatch
go: finding module for package github.com/google/go-cmp/cmp
go: finding module for package github.com/googleapis/gax-go/v2
go: finding module for package google.golang.org/api/googleapi
go: finding module for package google.golang.org/api/storage/v1
go: finding module for package google.golang.org/api/transport/http
go: finding module for package google.golang.org/genproto/googleapis/iam/v1
go: finding module for package google.golang.org/genproto/googleapis/type/expr
go: finding module for package golang.org/x/net/idna
go: finding module for package github.com/emirpasic/gods/trees/binaryheap
go: finding module for package github.com/go-git/gcfg
go: finding module for package google.golang.org/grpc
go: finding module for package google.golang.org/grpc/codes
go: finding module for package google.golang.org/grpc/metadata
go: finding module for package google.golang.org/grpc/status
go: finding module for package go.opencensus.io/trace
go: finding module for package google.golang.org/genproto/googleapis/rpc/code
go: finding module for package github.com/jmespath/go-jmespath
go: finding module for package golang.org/x/sys/execabs
go: finding module for package github.com/kevinburke/ssh_config
go: finding module for package github.com/xanzy/ssh-agent
go: finding module for package golang.org/x/crypto/ssh
go: finding module for package golang.org/x/crypto/ssh/knownhosts
go: finding module for package golang.org/x/net/proxy
go: found github.com/gobwas/glob in github.com/gobwas/glob v0.2.3
go: found github.com/jbenet/go-context/io in github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
go: found github.com/mattn/go-runewidth in github.com/mattn/go-runewidth v0.0.13
go: found github.com/apparentlymart/go-textseg/v13/textseg in github.com/apparentlymart/go-textseg/v13 v13.0.0
go: found golang.org/x/text/unicode/norm in golang.org/x/text v0.3.7
go: found github.com/bgentry/go-netrc/netrc in github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d
go: found github.com/hashicorp/go-cleanhttp in github.com/hashicorp/go-cleanhttp v0.5.2
go: found github.com/hashicorp/go-safetemp in github.com/hashicorp/go-safetemp v1.0.0
go: found github.com/klauspost/compress/zstd in github.com/klauspost/compress v1.15.9
go: found github.com/mitchellh/go-homedir in github.com/mitchellh/go-homedir v1.1.0
go: found github.com/ulikunitz/xz in github.com/ulikunitz/xz v0.5.10
go: found golang.org/x/oauth2 in golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094
go: found google.golang.org/api/iterator in google.golang.org/api v0.94.0
go: found google.golang.org/api/option in google.golang.org/api v0.94.0
go: found github.com/ProtonMail/go-crypto/openpgp in github.com/ProtonMail/go-crypto v0.0.0-20220822140716-1678d6eb0cbe
go: found github.com/go-git/go-billy/v5 in github.com/go-git/go-billy/v5 v5.3.1
go: found github.com/go-git/go-billy/v5/osfs in github.com/go-git/go-billy/v5 v5.3.1
go: found github.com/go-git/go-billy/v5/util in github.com/go-git/go-billy/v5 v5.3.1
go: found github.com/imdario/mergo in github.com/imdario/mergo v0.3.13
go: found github.com/sergi/go-diff/diffmatchpatch in github.com/sergi/go-diff v1.2.0
go: found github.com/google/go-cmp/cmp in github.com/google/go-cmp v0.5.8
go: found github.com/googleapis/gax-go/v2 in github.com/googleapis/gax-go/v2 v2.5.1
go: found google.golang.org/api/googleapi in google.golang.org/api v0.94.0
go: found google.golang.org/api/storage/v1 in google.golang.org/api v0.94.0
go: found google.golang.org/api/transport/http in google.golang.org/api v0.94.0
go: found google.golang.org/genproto/googleapis/iam/v1 in google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc
go: found google.golang.org/genproto/googleapis/type/expr in google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc
go: found golang.org/x/net/idna in golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c
go: found github.com/emirpasic/gods/trees/binaryheap in github.com/emirpasic/gods v1.18.1
go: found github.com/go-git/gcfg in github.com/go-git/gcfg v1.5.0
go: found google.golang.org/grpc in google.golang.org/grpc v1.49.0
go: found google.golang.org/grpc/codes in google.golang.org/grpc v1.49.0
go: found google.golang.org/grpc/metadata in google.golang.org/grpc v1.49.0
go: found google.golang.org/grpc/status in google.golang.org/grpc v1.49.0
go: found go.opencensus.io/trace in go.opencensus.io v0.23.0
go: found google.golang.org/genproto/googleapis/rpc/code in google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc
go: found github.com/jmespath/go-jmespath in github.com/jmespath/go-jmespath v0.4.0
go: found golang.org/x/sys/execabs in golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24
go: found github.com/kevinburke/ssh_config in github.com/kevinburke/ssh_config v1.2.0
go: found github.com/xanzy/ssh-agent in github.com/xanzy/ssh-agent v0.3.2
go: found golang.org/x/crypto/ssh in golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8
go: found golang.org/x/crypto/ssh/knownhosts in golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8
go: found golang.org/x/net/proxy in golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c
go: finding module for package gopkg.in/warnings.v0
go: found gopkg.in/warnings.v0 in gopkg.in/warnings.v0 v0.1.2
# cloud.google.com/go/storage
go/pkg/mod/cloud.google.com/go/storage@v1.22.1/bucket.go:1504:30: cannot use r.Condition.AgeInDays (variable of type int64) as type *int64 in struct literal
go/pkg/mod/cloud.google.com/go/storage@v1.22.1/bucket.go:1592:30: cannot use rr.Condition.Age (variable of type *int64) as type int64 in struct literal

Any idea how to solve problem?

schollii commented 2 years ago

A fix on this would be much appreciated. The README has to be fixed too, to point to https://github.com/keilerkonzept instead of https://github.com/sgreben and to use go install instead of go get -u (or may need both: one for go < 1.17 and another for g >= 1.17).

prshoper commented 1 year ago

@schollii MR waiting for accept and merge, for now I used version from https://github.com/keilerkonzept/terraform-module-versions/pull/90 and works fine

nikolay commented 1 year ago

@keilerkonzept Is this project still maintained?

nitrocode commented 1 year ago

After PR https://github.com/keilerkonzept/terraform-module-versions/pull/87 was merged this build to release 3.1.14 failed to upload release packages

https://github.com/keilerkonzept/terraform-module-versions/actions/runs/2806618579

We can see releases for previous versions but not for 3.1.14

For now, I would install 3.1.13

go install github.com/keilerkonzept/terraform-module-versions@3.1.13

There is also a new fork of this code that maybe more actively maintained.

https://github.com/tfverch/tfvc

nk9 commented 1 year ago

I tried installing 3.1.13 as suggested and still got the ambiguous import error.

nitrocode commented 1 year ago

Maybe try an earlier version

$ go version
go version go1.18
$ go install github.com/keilerkonzept/terraform-module-versions@3.1.11
$ which terraform-module-versions
/Users/user/go/bin/terraform-module-versions
nitrocode commented 1 year ago

This is the build issue in all the recent builds

go: finding github.com/xanzy/ssh-agent v0.3.0
build github.com/keilerkonzept/terraform-module-versions: cannot load cloud.google.com/go/compute/metadata: ambiguous import: found cloud.google.com/go/compute/metadata in multiple modules:
    cloud.google.com/go v0.74.0 (/go/pkg/mod/cloud.google.com/go@v0.74.0/compute/metadata)
    cloud.google.com/go/compute/metadata v0.2.0 (/go/pkg/mod/cloud.google.com/go/compute/metadata@v0.2.0)

Seems like this issue also causes missing artifacts #92

@sgreben when you have time could you please review pr #90

mloskot commented 6 months ago

Despite the installation method not being mentioned in the current README.md, I've tried it and it's failing with

$ go install github.com/keilerkonzept/terraform-module-versions@latest
...
go: github.com/keilerkonzept/terraform-module-versions imports
        github.com/keilerkonzept/terraform-module-versions/pkg/update imports
        github.com/keilerkonzept/terraform-module-versions/pkg/versions imports
        github.com/go-git/go-git/v5 imports
        github.com/imdario/mergo: github.com/imdario/mergo@v1.0.0: parsing go.mod:
        module declares its path as: dario.cat/mergo
                but was required as: github.com/imdario/mergo

p.s. Is this project still maintained?

sgreben commented 6 months ago

Hi all. Sorry about the eternal delays here. I've been rather swamped for a good long while, with barely any cycles to spend on github projects, and I'm just catching up now.

Today the project status is indeed, gotta be honest here, "unmaintained". I'll try to change this within this+next month.

Thanks and kudos to @nitrocode for the thoughtful changes, and keeping the functionality alive on your tfvc fork! I'll ping you once things are happening here again to check if there's anything that should be merged from/into it.

nitrocode commented 6 months ago

Hi @sgreben, happy to see you're back. I cannot take credit for tfvc. Just happened to find it when searching for an alternative.

You may want to ping @ryan-jan 😄

sgreben commented 6 months ago

lol, oops! Sorry @ryan-jan, and thanks @nitrocode 😅 I meant to thank the author there of course. So -this time correctly addressed- thanks & kudos for tfvc to @ryan-jan instead 👏