# Failed to Bootstrap Ping is working to github

**URL:** https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869
**Category:** Self-hosting
**Created:** [January 10, 2015, 11:53pm UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869 "2015-01-10T23:53:08Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![kushanx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kushanx/32/115443_2.png) [@kushanx](https://meta.discourse.org/u/kushanx)
#### Post date: [January 10, 2015, 11:53pm UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/1 "2015-01-10T23:53:08Z")

</div>

```
root@daysrilanka:~# mkdir /var/discourse
root@daysrilanka:~# git clone https://github.com/discourse/discourse_docker.git /var/discourse
Cloning into '/var/discourse'...
remote: Counting objects: 1353, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 1353 (delta 2), reused 0 (delta 0)
Receiving objects: 100% (1353/1353), 301.74 KiB | 115.00 KiB/s, done.
Resolving deltas: 100% (791/791), done.
Checking connectivity... done.
root@daysrilanka:~# cd /var/discourse
root@daysrilanka:/var/discourse# cp samples/standalone.yml containers/app.yml
root@daysrilanka:/var/discourse# nano containers/app.yml
root@daysrilanka:/var/discourse# ./launcher bootstrap app
WARNING: No swap limit support
Unable to find image 'samsaffron/discourse:1.0.7' locally
Pulling repository samsaffron/discourse
22d62951587e: Pulling image (1.0.7) from samsaffron/discourse
22d62951587e: Pulling image (1.0.7) from samsaffron/discourse, endpoint: https://registry-1.docker.io/v1/
22d62951587e: Pulling dependent layers
511136ea3c5a: Pulling metadata
511136ea3c5a: Pulling fs layer
511136ea3c5a: Download complete
7e2a471a454a: Pulling metadata
7e2a471a454a: Pulling fs layer
7e2a471a454a: Download complete
cdb5237bc8a7: Pulling metadata
cdb5237bc8a7: Pulling fs layer
cdb5237bc8a7: Download complete
fa6d84c1e733: Pulling metadata
fa6d84c1e733: Pulling fs layer
fa6d84c1e733: Download complete
91cf3969bafa: Pulling metadata
91cf3969bafa: Pulling fs layer
91cf3969bafa: Download complete
22d62951587e: Pulling metadata
22d62951587e: Pulling fs layer
22d62951587e: Download complete
22d62951587e: Download complete
Status: Downloaded newer image for samsaffron/discourse:1.0.7
This user has no SSH key, but a SSH key is required to access the Discourse Docker container.
Generate a SSH key? (Y/n) Y
Generating SSH key
Generating public/private rsa key pair.
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
68:4c:97:44:a9:76:0f:33:c5:89:82:63:6f:76:09:2c root@daysrilanka.com
The key's randomart image is:
+--[RSA 2048]----+
| o .o+ . |
| E +.o.+ |
| . +.+oo |
| o*oB |
| ++oS= |
| . . |
| |
| |
| |
+-----------------+

Calculated ENV: -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=2 -e UNICORN_SIDEKIQS=1 -e RUBY_GC_MALLOC_LIMIT=40000000 -e RUBY_HEAP_MIN_SLOTS=800000 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e HOME=/root -e DISCOURSE_DEVELOPER_EMAILS=codedbykush@gmail.com -e DISCOURSE_HOSTNAME=100.daysrilanka.com -e DISCOURSE_SMTP_ADDRESS=smtp.mandrillapp.com
cd /pups && git pull && /pups/bin/pups --stdin
fatal: unable to access 'https://github.com/SamSaffron/pups.git/': Could not resolve host: github.com
5a57c4f199e4199c5bbc348a82ef798c2e929112bb8ff8c4250630d99b4e8a5a
FAILED TO BOOTSTRAP

```

I have checked a ping to [github.com](http://github.com) and it is working properly.

```
root@daysrilanka:/var/discourse# ping github.com
PING github.com (192.30.252.128) 56(84) bytes of data.
64 bytes from github.com (192.30.252.128): icmp_seq=1 ttl=55 time=240 ms
64 bytes from github.com (192.30.252.128): icmp_seq=2 ttl=55 time=234 ms
64 bytes from github.com (192.30.252.128): icmp_seq=3 ttl=55 time=240 ms

```

Anyone can direct me to the error?

I can’t provide access to my DigitalOcean Droplet

Regards,

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [January 11, 2015, 1:10am UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/4 "2015-01-11T01:10:26Z")

</div>

Could it be to do with the recent blocking of GitHub?

> **[India's Government Asks ISPs To Block GitHub, Vimeo And 30 Other Websites...](https://techcrunch.com/2014/12/31/indian-government-censorsht/)**
>
> Today it emerged that the Indian government has asked internet service providers to block access to 32 sites in the name of its censorship laws.

You could try testing your connectivity to GitHub by running the following command:

```
wget --output-document=/dev/null https://github.com/discourse/discourse_docker.git

```

This should give you output similar to this:

```
root@forum:~# wget --output-document=/dev/null https://github.com/discourse/discourse_docker.git
--2015-01-10 20:06:43-- https://github.com/discourse/discourse_docker.git
Resolving github.com (github.com)... 192.30.252.130
Connecting to github.com (github.com)|192.30.252.130|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/discourse/discourse_docker [following]
--2015-01-10 20:06:44-- https://github.com/discourse/discourse_docker
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘/dev/null’

    [<=>] 52,784 205KB/s in 0.3s

2015-01-10 20:06:44 (205 KB/s) - ‘/dev/null’ saved [52784]

```

EDIT: It does look like a connectivity / availability issue though - trying again after a period of time is a good step.

---

<div class="post-metadata">

### Author: ![kushanx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kushanx/32/115443_2.png) [@kushanx](https://meta.discourse.org/u/kushanx)
#### Post date: [January 11, 2015, 1:04pm UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/5 "2015-01-11T13:04:47Z")

</div>

Thanks for the tips. I’ll check them asap. I’m not in or from India. I  
use git daily for learning purposes. And the digital ocean droplet is  
located in Singapore.

I CAN PROVIDE access to it. Made a mistake in the first post.

---

<div class="post-metadata">

### Author: ![Stefan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stefan/32/104823_2.png) [@Stefan](https://meta.discourse.org/u/Stefan)
#### Post date: [January 11, 2015, 1:10pm UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/6 "2015-01-11T13:10:21Z")

</div>

Edit /etc/default/docker and uncomment the following line:

```
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

```

After this, restart docker and rebuild. I had the same issue today.

The solution is taken from  
[https://meta.discourse.org/t/afatal-unable-to-access-https-github-com-samsaffron-pups-git-could-not-resolve-host-github-com/18611/7?u=stefan](https://meta.discourse.org/t/afatal-unable-to-access-https-github-com-samsaffron-pups-git-could-not-resolve-host-github-com/18611/7)

---

<div class="post-metadata">

### Author: ![genachka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/genachka/32/105744_2.png) [@genachka](https://meta.discourse.org/u/genachka)
#### Post date: [February 3, 2015, 10:40pm UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/7 "2015-02-03T22:40:20Z")

</div>

@Stefan thanks, this resolved it for me.

---

<div class="post-metadata">

### Author: ![danlucraft](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danlucraft/32/107042_2.png) [@danlucraft](https://meta.discourse.org/u/danlucraft)
#### Post date: [October 21, 2015, 9:54am UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/8 "2015-10-21T09:54:13Z")

</div>

I have the same problem,

```
fatal: unable to access 'https://github.com/SamSaffron/pups.git/': Could not resolve host: github.com"_ during `./launcher rebuild app`.

```

My installation was all working fine for a week beforehand but today it told me Sidekiq wasn’t running so I went to rebuild, which has now failed.

I can ping github outside the container and the wget test above also works fine. I’ve tried with and without the DNS options in `/etc/default/docker` (and restarted the docker service after editing each time).

If it matters, I have added `--iptables=false` to the `DOCKER_OPTS` variable, as I wanted to restrict access to the Discourse install by IP with ufw. I am not blocking outgoing traffic at all (and as I said pinging github works anyway).

Any more ideas?

EDIT: there are no other error messages. Also “Fetching origin” seems to complete without errors (and the first time it actually pulled so commits) so I’m very confused as to why only on the pups repo it can’t resolve Github.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [October 23, 2015, 4:58am UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/9 "2015-10-23T04:58:11Z")

</div>

> [@danlucraft](#):
>
> If it matters, I have added --iptables=false to the DOCKER\_OPTS variable, as I wanted to restrict access to the Discourse install by IP with ufw. I am not blocking outgoing traffic at all (and as I said pinging github works anyway).

What happens if you try without that?

---

<div class="post-metadata">

### Author: ![danlucraft](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danlucraft/32/107042_2.png) [@danlucraft](https://meta.discourse.org/u/danlucraft)
#### Post date: [October 23, 2015, 8:16am UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/10 "2015-10-23T08:16:43Z")

</div>

> [@riking](#):
>
> What happens if you try without that?

It works! Thank you 😄

So I need to disable that to rebuild and then reenable it afterwards. Or will it cause problems if I leave the option in while the container is running?

---

<div class="post-metadata">

### Author: ![danlucraft](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danlucraft/32/107042_2.png) [@danlucraft](https://meta.discourse.org/u/danlucraft)
#### Post date: [October 23, 2015, 8:49am UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/11 "2015-10-23T08:49:51Z")

</div>

It no longer works at all with the `--iptables=false` option. Now the site returns a Bad Gateway when that option is present. That’s weird because it worked fine with it with for over a week before.

Any advice on how to restrict access to port 80 by IP? I was using ufw to set the policy but Docker seems to completely bypass that using iptables directly.

---

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [September 19, 2019, 6:46am UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/12 "2019-09-19T06:46:26Z")

</div>

How to restart docker?

Fine, I find the best solution is simply to reboot the server and wait for a while.

```plaintext
sudo reboot

```

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [June 27, 2020, 1:14pm UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/13 "2020-06-27T13:14:04Z")

</div>

Today I experienced this same exact problem in a fresh discourse docker install.

Solved this problem by the same solution posted by @Stefan above (thanks!):

Edit:

```plaintext
/etc/default/docker

```

Uncomment the following line:

```plaintext
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

```

Will look like this:

```plaintext
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

```

Then:

```plaintext
systemctl restart docker

```

Then, the launcher bootstrap and rebuild commands will not hang and fail on the DNS issue.

Strange that I have installed docker on a number of Ubuntu distros using `apt`, but this install was the only one to have this issue.

```plaintext
# lsb_release -a
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic

```

---

<div class="post-metadata">

### Author: ![minipunch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/minipunch/32/202088_2.png) [@minipunch](https://meta.discourse.org/u/minipunch)
#### Post date: [December 4, 2020, 10:21pm UTC](https://meta.discourse.org/t/failed-to-bootstrap-ping-is-working-to-github/23869/14 "2020-12-04T22:21:48Z")

</div>

I uncommented that line, restarted docker, and re ran `/discourse-setup` but it continues to not be able to resolve [github.com](http://github.com) for some reason ☹

Using Ubuntu 20.04, tired reinstalling Docker..

```plaintext
# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal

```
