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

Unable to Install on Ubuntu 20.04 #805

Closed
thefathacker opened this issue Aug 5, 2020 · 12 comments
Closed

Unable to Install on Ubuntu 20.04 #805

thefathacker opened this issue Aug 5, 2020 · 12 comments

Comments

@thefathacker
Copy link

thefathacker commented Aug 5, 2020

When executing go get github.com/StackExchange/dnscontrol

Output:
# github.com/StackExchange/dnscontrol/providers/hexonet go/src/github.com/StackExchange/dnscontrol/providers/hexonet/domains.go:7:41: cannot use map[string]string literal (type map[string]string) as type map[string]interface {} in argument to n.client.Request go/src/github.com/StackExchange/dnscontrol/providers/hexonet/domains.go:13:41: cannot use map[string]string literal (type map[string]string) as type map[string]interface {} in argument to n.client.Request go/src/github.com/StackExchange/dnscontrol/providers/hexonet/nameservers.go:44:41: cannot use map[string]string literal (type map[string]string) as type map[string]interface {} in argument to n.client.Request go/src/github.com/StackExchange/dnscontrol/providers/hexonet/nameservers.go:97:31: cannot use cmd (type map[string]string) as type map[string]interface {} in argument to n.client.Request go/src/github.com/StackExchange/dnscontrol/providers/hexonet/records.go:171:23: cannot use cmd (type map[string]string) as type map[string]interface {} in argument to n.client.Request go/src/github.com/StackExchange/dnscontrol/providers/hexonet/records.go:187:23: cannot use cmd (type map[string]string) as type map[string]interface {} in argument to n.client.Request
# github.com/StackExchange/dnscontrol/providers/vultr go/src/github.com/StackExchange/dnscontrol/providers/vultr/vultrProvider.go:120:103: cannot use r.Priority (type *int) as type int in argument to api.client.DNSRecord.Create go/src/github.com/StackExchange/dnscontrol/providers/vultr/vultrProvider.go:193:35: cannot convert r.Priority (type *int) to type uint16 go/src/github.com/StackExchange/dnscontrol/providers/vultr/vultrProvider.go:196:50: cannot convert r.Priority (type *int) to type uint16 go/src/github.com/StackExchange/dnscontrol/providers/vultr/vultrProvider.go:242:3: cannot use priority (type int) as type *int in field value

/usr/bin/go version: go version go1.14.6 linux/amd64
Using https://golang.org/dl/go1.14.6.linux-amd64.tar.gz

@tlimoncelli
Copy link
Contributor

I can reproduce the issue with:

GO111MODULE=on go get github.com/StackExchange/dnscontrol

However I don't know enough of the internals of go.mod to explain how to fix it. In the meanwhile this works:

$ mkdir -p src/github.com/StackExcahnge
$ cd src/github.com/StackExcahnge
$ git clone http://github.com/StackExchange/dnscontrol
$ cd dnscontrol/
$ go install

Best,
Tom

@ndabAP
Copy link

ndabAP commented Aug 12, 2020

I've the same problem with go1.15 linux/amd64 and Ubuntu 20.

@tlimoncelli
Copy link
Contributor

I think the problem is that "go get" is grabbing the newest hexonet and vultr dependencies but we need the older ones. I don't know go modules well enough to know how to specify that the older modules should be used. Can someone help?

Alternatively if we update the code to support the newest github.com/vultr/govultr and github.com/hexonet/go-sdk the problem would go away. Could I ask @Papakai and @geek1011 to look into that?

@Veratil
Copy link
Contributor

Veratil commented Aug 19, 2020

The issue doesn't happen when I use go get -d. I figure this is similar to the git clone method.

@KaiSchwarz-cnic
Copy link
Contributor

@tlimoncelli I already planned handing over responsibility for the dnscontrol module to team member as I don't come to it myself. I can't promise things, but I am in hope that all assigned hexonet github issues can be covered until end of Q4.

Just for reference related to go get: https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them

The -d flag instructs get to download the source code needed to build the named packages, including downloading necessary dependencies, but not to build and install them.

I am also not familiar to go modules. our go-sdk dependency itself is at least not available/published as go module, we are just releasing it at github using tags and releases. Maybe this is already the origin of this issue?... no idea. I am not having updated insights about how dependencies are used in dnscontrol - I just remember that there was a specific config file / config entry in the vendors directory to specify the exact version (commit id or so). If this has changed to always use something like latest, would then also be wrong. As said, I would need to have insights in how go modules are working and on how dnscontrol itself is currently managing dependencies / sub-dependencies to get an impression and ideas. Maybe we can come to that point through this discussion :-)

@pgaskin
Copy link
Contributor

pgaskin commented Aug 24, 2020

That's because you're not using the module URL (which needs to include the major version). This works:

GO111MODULE=on go get github.com/StackExchange/dnscontrol/v3

See 24b7d06, 2f83aa9, and #595.

P.S. I changed my username from @geek1011 to @pgaskin a few weeks ago, so I didn't get the original mention.

@tlimoncelli
Copy link
Contributor

@pgaskin Ah! Is it just a missing -d? That would be wonderful. (I seriously need to study go modules to understand how all that works).

Re: the name change: Please take a look at #823

@pgaskin
Copy link
Contributor

pgaskin commented Aug 24, 2020

Is it just a missing -d?

?

It's a missing /v3.

@tlimoncelli
Copy link
Contributor

Sorry... I shouldn't be allowed near a keyboard before coffee. I meant /v3

@tlimoncelli
Copy link
Contributor

I've updated the docs. Could you take a look?

(the change is on the web and in master)

@pgaskin
Copy link
Contributor

pgaskin commented Aug 26, 2020

That looks good in general, but the go get -d github.com/StackExchange/dnscontrol isn't required.

@tlimoncelli
Copy link
Contributor

Thanks for the help!

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

6 participants