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 get -u pulling the preview release and causing issue with ambiguous imports #2224

Closed
Venkat2382 opened this issue Aug 7, 2023 · 5 comments
Labels
closed-for-staleness guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@Venkat2382
Copy link

Describe the bug

When ever I do a go get -u to update the packages, I see that the preview release is getting pulled and giving issues with ambiguous imports. More over the preview release seems to be different than the current 1.20 version. How to avoid this when we do go get -u and what is the date that we have to move to new v2.0.0 version.

Expected Behavior

go get -u should pull only the latest stable version not the preview version.

Current Behavior

go get -u is pulling the preview release and causing issues with go imports.

Reproduction Steps

go get -u is pulling the preview release and causing issues with go imports.

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

1.20.0

Compiler and Version used

go version go1.20.7 darwin/amd64

Operating System and version

Mac OS

@Venkat2382 Venkat2382 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 7, 2023
@lucix-aws
Copy link
Contributor

We have no "preview" version of the Go v2 SDK nor should there be a tag for one with v2.0.0. We have no plans to implement a 2.x version of the SDK at this time.

Can you elaborate on the issue you're having with go get? Can you share the resulting content of go.mod / go.sum after running the command?

@lucix-aws lucix-aws removed the needs-triage This issue or PR still needs to be triaged. label Aug 8, 2023
@Venkat2382
Copy link
Author

Venkat2382 commented Aug 8, 2023

@lucix-aws the below is what I see

github.com/aws/aws-sdk-go-v2/service/s3: ambiguous import: found package github.com/aws/aws-sdk-go-v2/service/s3 in multiple modules:
github.com/aws/aws-sdk-go-v2 v2.0.0-preview.4+incompatible (/usr/local/go/pkg/pkg/mod/github.com/aws/aws-sdk-go-v2@v2.0.0-preview.4+incompatible/service/s3)
github.com/aws/aws-sdk-go-v2/service/s3 v1.36.0 (/usr/local/go/pkg/pkg/mod/github.com/aws/aws-sdk-go-v2/service/s3@v1.36.0)

not sure where this is github.com/aws/aws-sdk-go-v2 v2.0.0-preview.4+incompatible. when I do a go get -u this is the library it is pulling for aws-sdk-go-v2 as latest

@Venkat2382
Copy link
Author

Venkat2382 commented Aug 8, 2023

The below is sample go.mod

go 1.20

require (
github.com/aws/aws-sdk-go-v2 v1.20.0
github.com/aws/aws-sdk-go-v2/config v1.18.27
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.71
github.com/aws/aws-sdk-go-v2/service/s3 v1.36.0
github.com/aws/aws-sdk-go-v2/service/sqs v1.23.2
github.com/cloudevents/sdk-go/v2 v2.14.0
github.com/go-redis/redis/v8 v8.11.5
github.com/go-redis/redismock/v8 v8.11.5
github.com/google/uuid v1.3.0
github.com/stretchr/testify v1.8.4
gitlab.centene.com/caas/DeliveryServices/mongo-service v0.0.7
gitlab.centene.com/caas/DeliveryServices/utils/config v1.1.4
gitlab.centene.com/caas/DeliveryServices/utils/eventbridge v1.0.4
gitlab.centene.com/caas/DeliveryServices/utils/http v1.0.3
gitlab.centene.com/caas/DeliveryServices/utils/logger v1.0.3
gitlab.centene.com/caas/DeliveryServices/utils/logging v1.0.5
gitlab.centene.com/caas/DeliveryServices/utils/models v1.2.5
gitlab.centene.com/caas/DeliveryServices/utils/prometheus v1.0.3
gitlab.centene.com/caas/DeliveryServices/utils/redisUtils v1.0.12
gitlab.centene.com/caas/DeliveryServices/utils/router v1.0.2
gitlab.centene.com/caas/DeliveryServices/utils/s3manager v1.0.11
gitlab.centene.com/caas/DeliveryServices/utils/sanitizers v1.0.2
gitlab.centene.com/caas/DeliveryServices/utils/sqsconsumer v1.0.14
)

require (
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect
github.com/alessio/shellescape v1.4.1 // indirect
github.com/aws/aws-sdk-go v1.44.106 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.26 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.26 // indirect
github.com/aws/aws-sdk-go-v2/service/eventbridge v1.19.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.29 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.3 // indirect
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.8 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 // indirect
github.com/aws/smithy-go v1.14.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bytedance/sonic v1.10.0-rc2 // indirect
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.0 // indirect
github.com/cyberark/conjur-api-go v0.11.1 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/pprof v1.4.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.9.1 // indirect
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.6.6 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/vault/api v1.9.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.11.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.31.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rs/zerolog v1.28.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smarty/assertions v1.15.1 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.10.1 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.0.2 // indirect
github.com/xdg-go/stringprep v1.0.2 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
github.com/zalando/go-keyring v0.2.3-0.20230503081219-17db2e5354bd // indirect
github.com/zsais/go-gin-prometheus v0.1.0 // indirect
gitlab.centene.com/caas/DeliveryServices/utils/constants v1.0.2 // indirect
gitlab.centene.com/caas/DeliveryServices/utils/secrets v1.0.5 // indirect
gitlab.centene.com/caas/fedlayer/fedlayermodels v1.9.1 // indirect
go.mongodb.org/mongo-driver v1.7.3 // indirect
go.uber.org/atomic v1.4.0 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.10.0 // indirect
golang.org/x/arch v0.4.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

The below is the go.sum
[redacted due to length]

@lucix-aws
Copy link
Contributor

The tag v2.0.0-preview.4+incompatible doesn't exist in this repository as of this writing, but it does exist in the history of pkg.go.dev. I can only assume one of the following:

  • Your system acquired this tag at some point (it appears to have existed in the past) and is holding onto it. You may need to clean out your vendored module directory.
  • You have go get configured to pull from somewhere that is misbehaving (most likely via GOPROXY).
  • One of your indirects has the bad tag as a direct dependency, causing the conflict.
    • if you set GOPROXY to direct (assuming it isn't already) it may highlight the issue, assuming (1) isn't at play and it truly is trying to fetch this tag every time, it should fail outright since the tag doesn't exist here.

Please verify all of the above and try again. Unfortunately there's not really anything actionable for us here otherwise. I receive the expected version v1.20.1 when I run go get -u github.com/aws/aws-sdk-go-v2.

@lucix-aws lucix-aws added guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed bug This issue is a bug. labels Aug 9, 2023
@github-actions
Copy link

This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants