kushanx
(Kushan Liyanarachchi)
2015 年1 月 10 日 23:53
1
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 个赞
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.
kushanx
(Kushan Liyanarachchi)
2015 年1 月 11 日 13:04
5
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.
Stefan
(Stefan)
2015 年1 月 11 日 13:10
6
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 个赞
genachka
(Genachka)
2015 年2 月 3 日 22:40
7
@Stefan thanks, this resolved it for me.
danlucraft
(Daniel Lucraft)
2015 年10 月 21 日 09:54
8
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.
riking
(Kane York)
2015 年10 月 23 日 04:58
9
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?
1 个赞
danlucraft
(Daniel Lucraft)
2015 年10 月 23 日 08:16
10
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?
danlucraft
(Daniel Lucraft)
2015 年10 月 23 日 08:49
11
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.
xiasummer
(xiasummer)
2019 年9 月 19 日 06:46
12
How to restart docker?
Fine, I find the best solution is simply to reboot the server and wait for a while.
sudo reboot
neounix
(Dark Matter)
2020 年6 月 27 日 13:14
13
今天我在新安装的 Discourse Docker 环境中遇到了完全相同的问题。
通过 @Stefan 在上面发布的相同解决方案解决了该问题(谢谢!):
编辑:
/etc/default/docker
取消注释以下行:
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
修改后应如下所示:
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
然后执行:
systemctl restart docker
之后,启动器(launcher)的 bootstrap 和 rebuild 命令将不会因 DNS 问题而挂起或失败。
奇怪的是,我曾在多个 Ubuntu 发行版上使用 apt 安装过 Docker,但只有这次安装出现了该问题。
# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
2 个赞
minipunch
(Josh Yolles)
2020 年12 月 4 日 22:21
14
我取消注释了那一行,重启了 Docker,并重新运行了 /discourse-setup,但不知为何仍然无法解析 github.com
使用的是 Ubuntu 20.04,甚至尝试重新安装了 Docker..
# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal