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

Possible bug: Vendor conflict #26

Closed
Ghost---Shadow opened this issue Sep 16, 2019 · 2 comments
Closed

Possible bug: Vendor conflict #26

Ghost---Shadow opened this issue Sep 16, 2019 · 2 comments

Comments

@Ghost---Shadow
Copy link

I am new to go, my understanding of this error message is that somewhere in my code it is registering from the /vendor and somewhere it is getting the absolute path.

panic: gob: registering duplicate types for "github.com/zclconf/go-cty/cty.primitiveType": cty.primitiveType != cty.primitiveType

goroutine 1 [running]:
encoding/gob.RegisterName(0xc0001b4450, 0x2b, 0x3ff4e40, 0xc000422b93)
        /usr/local/Cellar/go/1.12.9/libexec/src/encoding/gob/type.go:820 +0x55e
github.com/terraform-providers/terraform-provider-alicloud/vendor/github.com/zclconf/go-cty/cty.init.3()
        /Users/souradeepnanda/go/src/github.com/terraform-providers/terraform-provider-alicloud/vendor/github.com/zclconf/go-cty/cty/types_to_register.go:52 +0x56a

Is there a way to not make it panic?

Why is cty.primitiveType != cty.primitiveType?

@apparentlymart
Copy link
Collaborator

Hi @Ghost---Shadow,

It looks like your program is importing cty from two different locations... possibly once from the alicloud provider's vendor directory and once directly from your GOPATH.

This library expects to be included in the program only at one import path, because it registers itself with the encoding/gob package.

It looks like perhaps you are compiling the alicloud provider in "GOPATH mode", which is the mode from before Go Modules was introduced in Go 1.11 and is still the default for backward compatibility. You might get better results if you force Go to use the Go Modules mode by setting this environment variable:

GO111MODULE=on

The Terraform providers and this cty library are both Go Modules codebases, and so they may not build correctly in GOPATH mode.

@Ghost---Shadow
Copy link
Author

Thanks

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