How to specify dns for go get command - go

I have a dependency which is published in company's GitLab and is only discoverable with domain name from a certain dns server. The go get command is failing to fetch such dependency on my local environment like this:
go get our-domain.com/group/library#v0.1.0
go: our-domain.com/group/library#v0.1.0: verifying go.mod: our-domain.com/group/library#v0.1.0/go.mod: reading https://sum.golang.org/lookup/our-domain.com/group/library#v0.1.0: 410 Gone
server response: not found: our-domain.com/group/library#v0.1.0: unrecognized import path "our-domain.com/group/library": https fetch: Get "https://our-domain.com/group/library?go-get=1": dial tcp: lookup our-domain.com on 8.8.8.8:53: no such host
It works if I'm building inside docker with adding dns to /etc/docker/daemon.json
{ "dns": ["1.2.3.4"] }
How to do it for getting dependency locally?
Running on MacOs with go1.13
I tried to add DNS address to the Network settings but go get still doesn't use it.

Try set GOPRIVATE=our-domain.com.
go env -w GOPRIVATE=our-domain.com
Otherwise the command tries to resolve the name using the Go proxy and checksum db.

Related

Connection Refused

I'm getting the following error when I type git clone --recursive https://github.com/projectname:
fatal: unable to access 'https://github.com/projectname': Failed to connect to 127.0.0.1 port 1080 after 2057 ms: Connection refused
I've been searching for the solution but I haven't find yet.
I also cloned repository with SSH key but while downloading the submodules I get the same message.
Check first your environment variables, looking for any HTTP_PROXY/HTTPS_PROXY.
For instance, at work, I have mine set to 127.0.0.1:3128, because I use an intermediate local proxy px, in order to avoid entering my credentials whenever I need to use the company proxy.

Docker For Mac / Lando: cannot cURL external webservice

I am testing out Lando for a new local dev setup.
Everything has gone well so far but I am running into an error that I don't get on my old Vagrant/VM environment, but do with Lando.
We have part of the site that uses Guzzle to fetch data from a web service. On Lando, I get a cURL error:
cURL error 7: Failed to connect to webservice.internalsite.com port 80: No route to host
How can I resolve this? When I try to ping that url, it says "Destination host unreachable". I am using Docker For Mac if that factors in.

ENOTFOUND proxy.server.com when running `heroku create`

The Heroku documentation says that I should use the following proxy settings when I use the heroku create command:
> set HTTP_PROXY=http://proxy.server.com:portnumber
or
> set HTTPS_PROXY=https://proxy.server.com:portnumber
> heroku login
Unfortunately, I am receiving the following error message:
! ECONNRESET: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND proxy.server.com
! proxy.server.com:8080
How can I fix this error?
I am also having trouble cloning the GitHub repo which is mentioned in the Heroku documentation, so I have to download it manually.
That documentation is under the heading Using an HTTP proxy. Are you sure that you need to use an HTTP proxy? In many cases you won't need one; simply running heroku create will work.
If you are sure that you need an HTTP proxy you should make sure to replace proxy.server.com with your actual proxy server's name or IP address. proxy.server.com is just an example.

Cannot access Gitlab repo from browser or from terminal

I cannot access Gitlab from the browser.
I am getting the following message:
This site can’t be reached
gitlab.com took too long to respond.
Try:
Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_TIMED_OUT
I am not able to use git pull origin master and git push -u origin master from the terminal.
It is showing the following error message:
**fatal: unable to access "https://gitlab.com/myproject.git/" : OpenSSL SSL_connect: SS_ERROR_SYSCALL in connection to gitlab.com:443**
Help me to fix the isssue,
Thanks.
Check your DNS settings, can you reach other sites? This doesn't seem to be a gitlab specific problem.
Also, your remote URL seems quite weird. It's usually gitlab.com/user/repo.git
Try other sites, do they work?
Try acquiring the IP Address from gitlab using an online whois service. Does opening this IP work?
Adjust your origin:
git remote rm origin
git remote add origin "https://username#gitlab.com/username/password.git"
Try this and report back if something worked.

Git: fatal: unable to access 'https://MY_REPO': Received HTTP code 504 from proxy after CONNECT

I have a repository on our internal servers. If i try to pull/clone an existing repository i'm getting this error message.
But if i type this repo-link to Chrome, i can see my repository without any problem. We use corporate proxies and i've configurem them in ENV-Variable on windows and git global settings.
Git global settings:
http.sslverify=false
user.name=My name
user.email=myname#domain.com
http.proxy=http://PROXY:8080/
https.proxy=http://PROXY:8080/
I should remove the proxy settings everywhere to connect my VPN. Because proxy server blocks my request because of non-existing server address.
Removing proxy for a local repository is also easy:
git config remote.origin.proxy ""

Resources