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 currently fails to download dnscontrol #774

Closed
marcolussetti opened this issue Jun 30, 2020 · 13 comments
Closed

go get currently fails to download dnscontrol #774

marcolussetti opened this issue Jun 30, 2020 · 13 comments

Comments

@marcolussetti
Copy link

Looks like there's a few issues currently for me (building on Windows):

  1. ns1-go/rest targets the incorrect branch/tag on their end (Can't seem to use go get on /rest ns1/ns1-go#104)
  2. hexonet/go-sdk seems to be set up for 1.x.x, but current release is 3.x.x (missing github.com/hexonet/go-sdk/client and github.com/hexonet/go-sdk/response/listresponse which I was last able to find on https://github.com/hexonet/go-sdk/tree/e12cede7032b5fb069cbeb6df5d5e86e95cfc654 / https://github.com/hexonet/go-sdk/releases/tag/v1.2.1 )

In the meantime, for 1, I had success by switching the branch to v2:

go get gopkg.in/ns1/ns1-go.v2
cd ~/go/src/gopkg.in/ns1/ns1-go.v2
git checkout v2

For 2, I thought I could fix it with a checkout to the tag, but that didn't work (obviously to experienced go devs, but very new to golang :) ):

cd ~/go/src/github.com/hexonet/go-sdk
git checkout v1.2.1
@marcolussetti
Copy link
Author

Upstream addressed 1. by issuing v2.4.1 a few minutes ago, though I haven't tested it yet.

@tlimoncelli
Copy link
Contributor

Maybe it is related to this? #757

It works for me if I leave off the version:

tlimwork2:~/src$ go version
go version go1.14.4 darwin/amd64
tlimwork2:~/src$ rm -rf github.com/StackExchange/dnscontrol
tlimwork2:~/src$ go get github.com/StackExchange/dnscontrol/v3    
package github.com/StackExchange/dnscontrol/v3: cannot find package "github.com/StackExchange/dnscontrol/v3" in any of:
	/usr/local/go/src/github.com/StackExchange/dnscontrol/v3 (from $GOROOT)
	/Users/tlimoncelli/src/github.com/StackExchange/dnscontrol/v3 (from $GOPATH)
tlimwork2:~/src$ go get github.com/StackExchange/dnscontrol   
tlimwork2:~/src$ echo $GOPATH
/Users/tlimoncelli

@maclennann
Copy link
Contributor

FWIW I can repro this issue. Running in a fresh docker container to avoid any potential differences in my workstation config:

$ docker run -it --rm golang:latest bash
root@ef60f458bd09:/go# go version
go version go1.14.4 linux/amd64
root@ef60f458bd09:/go# go get github.com/StackExchange/dnscontrol
# github.com/StackExchange/dnscontrol/providers/hexonet
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
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
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
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
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
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
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
src/github.com/StackExchange/dnscontrol/providers/vultr/vultrProvider.go:193:35: cannot convert r.Priority (type *int) to type uint16
src/github.com/StackExchange/dnscontrol/providers/vultr/vultrProvider.go:196:50: cannot convert r.Priority (type *int) to type uint16
src/github.com/StackExchange/dnscontrol/providers/vultr/vultrProvider.go:242:3: cannot use priority (type int) as type *int in field value

TBH I haven't looked into this overmuch to see if dependencies changed their interfaces or what - just noticed it's breaking our automation so we're moving to the pre-compiled releases for now.

@tlimoncelli
Copy link
Contributor

My recollection is that gopkg.in/ns1/ns1-go.v2 changed their API. We have to use v2.0.0-20170502175150-c563826f4cbe until someone updates the provider for the new API.

@tlimoncelli
Copy link
Contributor

@Papakai is the maintainer of HEXONET. Hopefully they can chime in with a solution.

@KaiSchwarz-cnic
Copy link
Contributor

KaiSchwarz-cnic commented Jul 15, 2020

Hi guys,

tbh I have no idea why go get tries to pull that version from hexonet's go-sdk. We haven't changed it - there is a pending github issue at dnscontrol asking us to upgrade. Honestly, I did not came to that.
We made breaking change in v3 of our go-sdk. The above errors are pointing to v3 being used, which is of course wrong.

I don't remember exactly which version was in use of our module in dnscontrol v2, probably v1.
In addition: the hexonet provider module is not yet dnscontrol 3 ready (pending github issue at dnscontrol).

HTH

@tlimoncelli
Copy link
Contributor

I don't think this is a problem with HEXONET. I think this is a problem with the dev environment.

It works for me on macOS. Maybe something is set wrong on your environment? What's the value of $GOPATH, $GO15VENDOREXPERIMENT, and etc?

@jmpenalosa
Copy link

jmpenalosa commented Jul 17, 2020

Hi @tlimoncelli

I'm trying out DNSControl in a lab environment but I cannot seem to download using the command "go get github.com/StackExchange/dnscontrol"

I get this error in below screenshot:
image

@tlimoncelli
Copy link
Contributor

What about:

git clone https://github.com/StackExchange/dnscontrol.git

@thefathacker
Copy link

thefathacker commented Aug 5, 2020

Got 3.2.0-dev Installed.

git clone https://github.com/StackExchange/dnscontrol.git && cd ./dnscontrol && go get ./

@tlimoncelli
Copy link
Contributor

@jmpenalosa FYI: "go install" in the base directory of the repo should install it. I'll clarify that in the README

@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 should work:

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

Best,
Tom

@tlimoncelli
Copy link
Contributor

This is a dup of #805

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