error: fatal: unable to access '': Could not resolve ho

原创 2018年04月15日 20:42:59

System Environment

  1. Run as root.

    Currently OpenShift v3 must be started as root in order to manipulate your iptables configuration. The openshift commands (e.g. oc create) do not need to be run as root.

  2. Properly configure or disable firewalld.

    On Fedora or other distributions using firewalld: Add docker0 to the public zone

     $ firewall-cmd --zone=trusted --change-interface=docker0
     $ systemctl restart firewalld

    Alternatively you can disable it via:

     $ systemctl stop firewalld . -- this is the solution for me
  3. Setup your host DNS to an address that the containers can reach

Containers need to be able to resolve hostnames, so if you run a local DNS server on your host, you should update your /etc/resolv.conf to instead use a DNS server that will be reachable from within running containers. Google's "" server is a popular choice.

  1. Save iptables rules before restarting iptables and restore them afterwards. If iptables have to be restarted, then the iptables rules should be saved and restored, otherwise the docker inserted rules would get lost:

     $ iptables-save > /path/to/iptables.bkp
     $ systemctl restart iptables
     $ iptables-restore < /path/to/iptables.bkp

Build Failures

To investigate a build failure, first check the build logs. You can view the build logs via:

$ oc logs build/[build_id]

and you can get the build id via:

$ oc get builds

the build id is in the first column.

If you're unable to retrieve the logs in this way, you can also get them directly from docker. First you need to find the docker container that ran your build:

$ docker ps -a | grep builder

The most recent container in that list should be the one that ran your build. The container id is the first column. You can then run:

$ docker logs [container id]

Hopefully the logs will provide some indication of what it failed (e.g. failure to find the source repository, an actual build issue, failure to push the resulting image to the docker registry, etc).

One issue seen sometimes is not being able to resolve any hostname (for example from within running containers:

E0708 17:28:07.845231       1 git.go:102] fatal: unable to access '': Could not resolve host:; Unknown error

If this shows up in your build logs, restart docker and then resubmit a build:

$ sudo systemctl restart docker
$ oc start-build --from-build=<your build identifier>

fatal: unable to access '': Could not resolve host:

使用git clone 或者 git pull 或者 git push,凡是git有关网络 的操作的时候,如果提示出现上述错误。解决办法请查看你的DNS配置是否正确。如果有改动,请还原git.osch...
  • snowrain1108
  • snowrain1108
  • 2016-06-03 10:39:45
  • 3073

unable to access '': Could not resolve host: github

之前用Git没有出错,今天用报了如下错误 发现自己的DNS1配置错误,把DNS1配置:就可以了...
  • u013680037
  • u013680037
  • 2017-05-07 11:24:53
  • 845

fatal: unable to access '': Could not resolve host: github.

fatal: unable to access ‘‘: Could not resolve host: github....
  • Notzuonotdied
  • Notzuonotdied
  • 2017-04-08 14:18:32
  • 1967

iOS - 解决fatal: unable to access Could not resolve host:

打开终端,输入sudo vim /etc/resolv.conf在最后一行增加nameserver或者nameserver即可...
  • lincsdnnet
  • lincsdnnet
  • 2016-12-18 16:15:19
  • 2244

git 出现错误 Could not resolve host:

也不知道为什么在使用git下载东西的时候出现了错误,,然后重新安装了电脑发现还是不起作用没办法只有谷歌 最后结合几家的意见找到了解决办法 原来是因为github.com没有被主机给...
  • zhanglongdream
  • zhanglongdream
  • 2017-05-07 09:04:43
  • 6481

Git错误fatal: unable to access '****.git/': Couldn't resolve host ''

今天对github上的项目进行git pull的时候出现了错误:fatal: unable to access '****.git/: Couldn't reso...
  • mhs624014469
  • mhs624014469
  • 2017-08-12 17:34:26
  • 1599

git之fatal: unable to access '': Could not resolve host问题

今天想把项目放到github上,发现github创建私有的项目要收取每月7美元,所以干脆放到了国内的代码托管仓库git.oschina.cn上了。 但是遇到如问题:fatal: unable t...
  • yexudengzhidao
  • yexudengzhidao
  • 2017-02-19 19:16:15
  • 7346

执行git clone提示“fatal: unable to access目标地址”的问题

今天遇到一个问题,记录下来。 问题:在github上下载一个开源项目,本地git环境已经建好,之前也用过,本地仓库已经建好。当执行git clone
  • wpyily
  • wpyily
  • 2015-08-31 10:35:38
  • 8732


  • abc1230456
  • abc1230456
  • 2014-10-31 10:30:58
  • 2284

使用github出了些问题?fatal: unable to access;Failed connect to;

使用github出了些问题?fatal: unable to access;Failed connect to; No error 我今天使用git push...
  • lly20000
  • lly20000
  • 2015-07-16 01:27:19
  • 18103
您举报文章:error: fatal: unable to access '': Could not resolve ho