I used the following command and tried to clone a repo but unfortunately the following error pops up. I cannot go further
ubuntu#ip-add-rr-ee-ss:~$ git clone https://github.com/repo/file.git
Cloning into 'file'...
fatal: unable to access 'https://github.com/repo/file.git/': Could not resolve host: github.com
Could not resolve host
This must be due to DNS issue on your EC2 instance (I can see that you're using Ubuntu here)
You can try to use curl to test the connection to that URL first
Check the DNS configuration: cat /etc/resolv.conf
If possible, you
should replace your current DNS setting with others DNS like google
(8.8.8.8 & 8.8.4.4)
Try to edit that file: vi /etc/resolv.conf
You
should insert/edit the following into:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save the file by clicking [Esc] and type :wq
I fixed the problem once I added the following to my outbound connection for my group security setting:
Type: All traffic
Protocol: All
ip: 0.0.0.0/0
This also fixed my sudo yum install issues too.
Related
I'm writing as I've encountered an issue that doesn't seem to get resolved, would value the community's help.
I'm trying to push an image to a local registry I deployed on port 5000.
When I use this command docker push localhost:5000/explorecalifornia.com to push the image to my local registry, I get the following message
Get "http://localhost:5000/v2/": net/http: request canceled (Client.Timeout exceeded while awaiting headers)
I've confirmed the registry is on port 5000 by using GET on postman, and I get a valid, expected {} response (since there's no images currently on my local registry).
I've since tried to fix this by updating my etc/hosts file to comment out "::1 localhost" per advise of this post. This is the contents of my etc/hosts file
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
# ::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
I also updated my etc/resolve.conf file with the following nameservers per advise from this post.
nameserver 10.0.2.3
nameserver 8.8.8.8
nameserver 8.8.4.4
None of this worked. Did anyone also encounter this issue? Is there any recommendations to help fix this issue?
Here's the source code if it helps! Thank you in advance :)
You may have a HTTP proxy defined. Please try running these commands.
unset http_proxy
unset https_proxy
I think there must be sth changed with the kind image. I use the script from this page:
https://kind.sigs.k8s.io/docs/user/local-registry/
I am able to create a new kind cluster and registry. After that, I have no problem following the video lecture to push the explorecalifornia.com image to the local registry.
I use a work-around for this error and it is as below:
Firstly, tag the images using the localhost ip instead, ie
docker tag imagename 127.0.0.1:5000/imagename
and,
docker push 127.0.0.1:5000/imagename
I hope this works for you as well.
I have installed ubuntu 18.04(WSL) in my win 10 64 bit, 1903.
For the command git clone https://github.com/facebookresearch/fastText.git,
it works well in git bash(git for windows) and ubuntu 18.04 shell but not in bash (C:\Windows\System32\bash.exe), the error message is
$ git clone https://github.com/facebookresearch/fastText.git
Cloning into 'fastText'...
fatal: unable to access 'https://github.com/facebookresearch/fastText.git/': Could not resolve host: github.com
I have only two .gitconfig file in my pc, one for git bash and another for ubuntu 18.04 shell. I think ubuntu 18.04 shell may equal to bash in some degree but the bash must have problems.
It could be that your /etc/resolv.conf file is corrupt - it happened to me!
Symptoms are:
Inside WSL /etc/resolv.conf is not plain text but some binary garbage. It should be plain text.
You cannot e.g. ping google.com or ping stackoverflow.com from inside WSL.
You can ping those domains OK from powershell in the windows host. Windows git also works OK.
Aside: Interestingly ping github.com fails for me today on all my machines but that doesn't stop me from visiting github in my browser or using git - strange.
The solution is to sudo rm /etc/resolv.conf and restart WSL - windows will recreate that file for you and you should be able to ping away and use git once more from within WSL.
To restart WSL - open a Powershell terminal in Administrator mode and run the following commands. (taken from #germa-vinsmoke 's answer)
wsl --shutdown
Get-Service LxssManager | Restart-Service
Edit your wsl.conf
sudo nano /etc/wsl.conf
[network]
generateResolvConf = false
Save this file and exit. Then edit /etc/resolv.conf.
sudo nano /etc/resolv.conf
Add/Edit this line
nameserver 1.1.1.1
Then close your WSL console. Open Powershell with admin and shutdown the wsl.
wsl --shutdown
At last, restart the wsl service
Get-Service LxssManager | Restart-Service
More info - WSL2 - No internet connectivity. DNS Issues(Temporary failure in name resolution)
Edit 1 By P.hunter:
When your are behind an VPN, you need to set your nameserver to same what the VPN provides.
For that -
Go to Network Status (On Windows) and click on change adapter settings.
Find the adapter of your VPN, right click on it and open properties.
Find IpV4 option from the dropdown, and open it.
Find the DNS mentioned and use the same in Step 3.
None of the above answers worked for me. But this answer from this Github thread did. Reposting for ease:
It seems launching the VSCode daemon messes things up
Make this your /etc/wsl.conf file
[network]
generateResolvConf = false
Shutdown wsl
wsl --shutdown
Start wsl and create the file: /etc/resolv.conf containing
nameserver 8.8.8.8
P.S. if this answer doesn't help, others on the Github thread might!
I can assume that you have problems with proxying.
Try it:
git config --global --unset http.proxy
git config --global --unset https.proxy
Similar problem: #20370294 and #5377703
I did the following step to resolve the issue:
Check the connection to the internet.
ping stackoverflow.com
Edit /etc/resolv.conf, in my case the reason is due to the nameserver 172.22.16.1
sudo vim /etc/resolv.conf
add the nameserver to point to google server
nameserver 8.8.8.8
nameserver 8.8.4.4
and add a comment to the original nameserver by adding #
Repeat step 1 to cross-check the connection again.
Hope this helps!
I have installed a local cloud foundry instance following cf_nise_installer
Environment:
Host: Windows 10
Vagrant: 1.7.4
Virtualbox: 5.0.2
cf: 6.13.0-e68ce0f-2015-10-15T15:53:50+00:00
Installation went fine but when I try to access the endpoint using the command:
cf login -a https://api.10.0.2.15.xip.io -u admin -p c1oudc0w --skip-ssl-validation
I get following error
API endpoint: https://api.10.0.2.15.xip.io
FAILED
Error performing request: Get https://api.10.0.2.15.xip.io/v2/info: dial tcp
10.0.2.15:443: ConnectEx tcp: i/o timeout
I googled and found it be some DNS and /etc/hosts entries issue so I changed the DNS of my wifi adapter to 8.8.8.8 / 8.8.4.4 and added following entries to the /etc/hosts file
10.0.2.15 api.10.0.2.15.xip.io
10.0.2.15 uaa.10.0.2.15.xip.io
10.0.2.15 10.0.2.15.xip.io
10.0.2.15 hello.10.0.2.15.xip.io
I flushed the DNS, restarted but still I am getting same error.
Below is the output of nslookup api.10.0.2.15.xip.io
Server: google-public-dns-a.google.com
Address: 8.8.8.8
Non-authoritative answer:
Name: api.10.0.2.15.xip.io
Address: 10.0.2.15
Now I am out of options. Please guide me what I am missing.
Thanks
I am able to resolve this by adding route to the 10.0.2.15
In my routing table, there was no entry for the above IP so I added an entry as
route add 10.0.2.15 10.39.39.1 where 10.39.39.1 is the IP of virtual box host only adapter.
This resolved the issue.
I want to clone a bunch of private git repositories while provisioning a vagrant box. According to this article this should be possible using config.ssh.forward_agent = true. However, when trying to connect to github via something like ssh -T git#github.com -o StrictHostKeyChecking=no it fails with the following error:
Warning: Permanently added 'github.com,192.30.252.130' (RSA) to the list of known hosts.
Permission denied (publickey).
I cut my configuration down to the simplest possible configuration. You can find it here: https://gist.github.com/TomTasche/31f7c45fcffc2997d43a
When I do "vagrant ssh" and try the same again, a similar error occurs:
Cloning into 'private-repositories'...
Warning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Edit: the configuration linked above does work on a host running Ubuntu, but does neither work on a Mac host, nor on a Windows host. My goal is to have a configuration that works on all these three hosts.
Please check whether your host system has ssh-agent forwarding enabled. You can do so for example by adding this block to your ~/.ssh/config file:
Host *
ForwardAgent yes
If this is enabled vagrant ssh (and also vagrant provision) should be able to forward your key to the guest machine.
You also might want to check using ssh-add -l whether your ssh-agent does know about your SSH-key. If it is in the list and you have agent-forwarding activated you should have a success. Otherwise you can add the key to your ssh-agent by running ssh-add <path to your key file>.
It sounds like you may be hitting this particular bug:
https://github.com/mitchellh/vagrant/issues/1735
(Despite it being "closed" it's actually not fixed)
On Windows, SSH Forwarding in Vagrant does not work properly by default (because of a bug in net-ssh).
However, there is a workaround or simple hack. You can auto-copy your local SSH key to the Vagrant VM via a simple provisioning script in your VagrantFile. Here's an example:
https://github.com/mitchellh/vagrant/issues/1735#issuecomment-25640783
Tom,
What you're doing is fairly generic in nature and I don't think is Vagrant specific.
Try some of the following to track down the issue:
edit your /etc/ssh/sshd_config
Set LogLevel debug
Restart the sshd service sudo service sshd restart or /etc/init.d/sshd restart
tail -f /var/log/authlog -- note, the file may be something else like /var/log/authd.log or /var/log/secure or something.
Watch what happens when you connect. It should give you some indication of why it's failing.
Again sorry, I'm not that familiar with Vagrant but I'm wondering if the provisioning script is running as another user, in which case the agent forwarding may not work as expected?
I am running Docker via CoreOS and Vagrant on OS X 10.10.
When I run docker pull ubuntu in CoreOS, I got following errors:
$ docker pull ubuntu
Pulling repository ubuntu
cc0067db4f11: Error pulling image (precise) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/, Get https://cdn-registry-1.docker.io/v1/images/cc0067db4f11198ef6fd0435f96a973e559b1cebfceb2bc8e4fe527b32045c2f/ancestry: dial tcp: lookup cdn-registry-1.dcc0067db4f11: Error pulling image (precise) from ubuntu, Get https://cdn-registry-1.docker.io/v1/images/cc0067db4f11198ef6fd0435f96a973e559b1cebfceb2bc8e4fe527b32045c2f/ancestry: dial tcp: lookup cdn-registry-1.docker.io on [10.0.2.3]:53: too many redirects
6006e6343fad: Error pulling image (quantal) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/, Get https://cdn-registry-1.docker.io/v1/images/6006e6343fadaaeb5dd98436a3cd17eac8c03cabca1ed4c8778d039e72ebcc9c/ancestry: dial tcp: lookup cdn-registry-1.d6006e6343fad: Error pulling image (quantal) from ubuntu, Get https://cdn-registry-1.docker.io/v1/images/6006e6343fadaaeb5dd98436a3cd17eac8c03cabca1ed4c8778d039e72ebcc9c/ancestry: dial tcp: lookup cdn-registry-1.docker.io on [10.0.2.3]:53: too many redirects
7656cbf56a8c: Error pulling image (13.04) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/, Get https://cdn-registry-1.docker.io/v1/images/7656cbf56a8c831de71ef43809b04fcf8125e7b039250835b6c5f6f280daf12e/ancestry: dial tcp: lookup cdn-registry-1.doc7656cbf56a8c: Error pulling image (13.04) from ubuntu, Get https://cdn-registry-1.docker.io/v1/images/7656cbf56a8c831de71ef43809b04fcf8125e7b039250835b6c5f6f280daf12e/ancestry: dial tcp: lookup cdn-registry-1.docker.io on [10.0.2.3]:53: too many redirects
3db9c44f4520: Error pulling image (lucid) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/, Get https://cdn-registry-1.docker.io/v1/images/3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710/ancestry: dial tcp: lookup cdn-registry-1.doc3db9c44f4520: Error pulling image (lucid) from ubuntu, Get https://cdn-registry-1.docker.io/v1/images/3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710/ancestry: dial tcp: lookup cdn-registry-1.docker.io on [10.0.2.3]:53: too many redirects
5cf8fd909c6c: Error pulling image (trusty) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/, Get https://cdn-registry-1.docker.io/v1/images/5cf8fd909c6ccc61199df6dbeb165767b83c23842ef49ca3ef3b81ece1bdce4f/ancestry: dial tcp: lookup cdn-registry-1.do5cf8fd909c6c: Error pulling image (trusty) from ubuntu, Get https://cdn-registry-1.docker.io/v1/images/5cf8fd909c6ccc61199df6dbeb165767b83c23842ef49ca3ef3b81ece1bdce4f/ancestry: dial tcp: lookup cdn-registry-1.docker.io on [10.0.2.3]:53: too many redirects
d2099a5ba6c5: Error pulling image (saucy) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/, Get https://cdn-registry-1.docker.io/v1/images/d2099a5ba6c5a0f94f84162d69b4cb79b47c7ea1768550c6cee55a7ba2dc3647/ancestry: dial tcp: lookup cdn-registry-1.docd2099a5ba6c5: Error pulling image (saucy) from ubuntu, Get https://cdn-registry-1.docker.io/v1/images/d2099a5ba6c5a0f94f84162d69b4cb79b47c7ea1768550c6cee55a7ba2dc3647/ancestry: dial tcp: lookup cdn-registry-1.docker.io on [10.0.2.3]:53: too many redirects
2014/06/05 12:17:11 Could not find repository on any of the indexed registries.
I'd really appreciate if anyone could give me a useful advise on how to troubleshoot this problem.
Try this temporary workaround:
osx$ boot2docker up
osx$ boot2docker ssh
docker#boot2docker$ sudo echo "nameserver 8.8.8.8" > /etc/resolv.conf
docker#boot2docker$ sudo /etc/init.d/docker restart
It works until reboot.
I don't know about OS X, but on linux this could happen due to "bad" /etc/resolv.conf on the host. For example, ubuntu puts something like:
nameserver 127.0.1.1
and then handles the DNS requests through some service. The problem is, that this is accessible from inside of the image.
To fix this, I had to add some external nameservers, like:
nameserver 127.0.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4
10.0.2.3 is virtualbox dns server, check Fine-tuning the VirtualBox NAT engine
You can as other suggested use 8.8.8.8 which is google dns server.
# /etc/resolve.conf
nameserver 8.8.8.8
And if you work in intranet, then replace it with your normal dns server, which you can add search as well like below
# /etc/resolve.conf
nameserver xxx.xxxx.xxx
search company.com
This will be good to access your private repo
I had a similar issue when trying to pull a container from docker repository with this command :
docker pull ubuntu
Note that I was using coreos inside virtualbox and I was using Nat as my Networking Configuration to have access to internet. When Switching network modes with virtualbox, I couldn't do any pull.
I solved the issue by restarting docker with systemctl by iniating this command :
sudo systemctl restart docker
And then my pull worked fine. I hope this solution helped you. And I got it from from google group issue addressed by one of CoreOS creators(Brandon Philips) through this link:
https://groups.google.com/forum/#!topic/coreos-dev/vWqSbPgNYro
On MacOSX, if you use Docker Machine you can try to:
docker-machine ls
docker-machine ssh YOUR_VM_NAME
and then from within the VM:
kill the /usr/local/bin/docker process and start it again by hand:
sudo /usr/local/bin/docker -d -D -g /var/lib/docker -H unix:// -H tcp://0.0.0.0:2376 --label provider=virtualbox --tlsverify --tlscacert=/var/lib/boot2docker/ca.pem --tlscert=/var/lib/boot2docker/server.pem --tlskey=/var/lib/boot2docker/server-key.pem -s aufs
Funnily enough, restarting like this
sudo /etc/init.d/docker restart
does not help.
On windows I was able to fix it by doing the following:
Go to virtual box application
Delete the VM that was created
Restart computer (optional, i think)
Start Kitematic
Go back to Virtual Box, hit show
Make sure ping google.com command works
Now I am able to download docker images from the hub.