Azure-sdk-for-go: Importing keyvault packages produces a lot of "not enough arguments to return"

Created on 2 May 2020  路  3Comments  路  Source: Azure/azure-sdk-for-go

Bug Report

  • go version go1.14.1 darwin/amd64
  • "github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault" "github.com/Azure/azure-sdk-for-go/services/keyvault/auth" "github.com/Azure/go-autorest/autorest/azure"
  • github.com/Azure/azure-sdk-for-go v42.0.0+incompatible github.com/Azure/go-autorest v10.15.3+incompatible

The way I'm using the SDK is pretty standard:

sf.client = keyvault.New()
authorizer, err := auth.NewAuthorizerFromEnvironment()
if err != nil {
    return err
}
sf.client.Authorizer = authorizer
sf.client.GetSecret(ctx, vaultBaseURL, "secretName", "")

When I build the project I'm getting:

# github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:119:2: not enough arguments to return
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:119:15: client.Send undefined (type BaseClient has no field or method Send)
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:198:2: not enough arguments to return
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:198:15: client.Send undefined (type BaseClient has no field or method Send)
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:293:2: not enough arguments to return
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:293:15: client.Send undefined (type BaseClient has no field or method Send)
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:381:2: not enough arguments to return
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:381:15: client.Send undefined (type BaseClient has no field or method Send)
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:474:2: not enough arguments to return
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:474:15: client.Send undefined (type BaseClient has no field or method Send)
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault/client.go:474:2: too many errors
# github.com/Azure/azure-sdk-for-go/services/keyvault/auth
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/auth/auth.go:45:9: undefined: auth.NewAuthorizerFromFileWithResource
../../../../pkg/mod/github.com/!azure/[email protected]+incompatible/services/keyvault/auth/auth.go:54:9: undefined: auth.NewAuthorizerFromCLIWithResource
# k8s.io/client-go/rest
../../../../pkg/mod/k8s.io/[email protected]+incompatible/rest/request.go:598:31: not enough arguments in call to watch.NewStreamWatcher
    have (*versioned.Decoder)
    want (watch.Decoder, watch.Reporter)
Mgmt customer-reported dependencies question

Most helpful comment

Your version of go-autorest is too old and is missing some changes that the SDK depends on. Can you please update to at least v13.4.0.

Generally speaking, for the version of the SDK you consume, your version of go-autorest must be equal to (or greater than) what's in Gopkg.toml. Using dep will ensure your dependency graph is consistent as we haven't yet introduced modules in the SDK.

All 3 comments

I have the same issue, and apparently it was working fine 2 days ago. The only way I could get it running was falling back to v39.2.0.

Your version of go-autorest is too old and is missing some changes that the SDK depends on. Can you please update to at least v13.4.0.

Generally speaking, for the version of the SDK you consume, your version of go-autorest must be equal to (or greater than) what's in Gopkg.toml. Using dep will ensure your dependency graph is consistent as we haven't yet introduced modules in the SDK.

Hi @jakubigla I believe bumping go-autorest version to v14.0.0 will resolve this issue, therefore I will close this issue in advance. Please feel free to comment or reopen if you still have more concerns or questions.

Was this page helpful?
0 / 5 - 0 ratings