Failed to Bootstrap Ping is working to github

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 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,

1 Like

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

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.

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.

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

8 Likes

@Stefan thanks, this resolved it for me.

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.

What happens if you try without that?

1 Like

It works! Thank you :smile:

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?

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.

How to restart docker?

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

sudo reboot

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:

/etc/default/docker

Uncomment the following line:

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

Will look like this:

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

Then:

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.

# lsb_release -a
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic
2 Likes

I uncommented that line, restarted docker, and re ran /discourse-setup but it continues to not be able to resolve github.com for some reason :frowning:

Using Ubuntu 20.04, tired reinstalling Dockerā€¦

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