After Discourse installation can’t reach it in browser

Hello,

I have set up a new Ubuntu 18 Cloud Server and installed Discourse like I did it all times, the Standard under 30 Min setup. When I now want to first create a admin, I am calling the installation in my browser and getting error that server is not reachable. 2 things are different to my other servers, 1. I changed to Hetzner Cloud, 2. I can only call the installtion with the IP adress at the moment, as I want to switch another existing server to the new one.

The Hetzner Ubuntu Image is minimal I think, nothing installed. I am out of knowledge now and hope that someone could point me the right direction :slight_smile:

Thanks a lot in advance.
Cheers, Daniel

If you can access via ip but not the desired domain name then it’s a dns problem. If you share the domain name and ip then someone could confirm.

Hi Jay,

thx for reply. I think I explained wrong. I tried only to access via IP, the domain name is still not pointed on the new server. The result of trying to access via IP is the error I said before.

Discourse is up and running but the server somehow diesn´t point to the docker container. I don´t have clue.

Perhaps you need to make sure that port 80 (and 443 if you’re going to want https) is accessible to the outside. Check with your provider.

I have another stupid question, really stupid :slight_smile:
Do I need an an apache or any other webserver installed additionally? Or does the mentioned install method supports everything needed for launching? Sorry for that dumb question :frowning:

The server is complete fresh, minimal installation of ubuntu, so nothing more is installed.

No. You don’t want to install anything else.

I recommend opening a ticket with the provider and/or checking their settings to see if you need to do something to open up ports. Sometimes all ports are closed by default.

My provider Hetzner doesn´t offers a extern firewall for the cloud server structure. The only I can do is to check up my system configuration, ufw for example.

Nmap scan report for localhost (127.0.0.1)
Host is up (0.00013s latency).
Not shown: 131065 closed ports
PORT     STATE         SERVICE
22/tcp   open          ssh
80/tcp   open          http
443/tcp  open          https
6010/tcp open          x11
68/udp   open|filtered dhcpc

Nmap done: 1 IP address (1 host up) scanned in 4851.83 seconds
root@crazy-geek:~# ufw status
Status: inactive

As I said, its a standard configuration. I am sure I am missing a small thing :frowning:(

Docker Status:

root@crazy-geek:~# service docker status
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-01-17 12:45:06 CET; 1 day 9h ago
     Docs: https://docs.docker.com
 Main PID: 3857 (dockerd)
    Tasks: 22
   CGroup: /system.slice/docker.service
           ├─ 3857 /usr/bin/dockerd -H fd://
           ├─14119 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.17.0.2 -container-port 443
           └─14130 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.17.0.2 -container-port 80

Jan 17 12:58:49 crazy-geek dockerd[3857]: time="2019-01-17T12:58:49.450467881+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
Jan 17 12:58:50 crazy-geek dockerd[3857]: time="2019-01-17T12:58:50.171181280+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
Jan 17 12:58:51 crazy-geek dockerd[3857]: time="2019-01-17T12:58:51.054211198+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
Jan 17 12:58:51 crazy-geek dockerd[3857]: time="2019-01-17T12:58:51.862330252+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
Jan 17 12:58:52 crazy-geek dockerd[3857]: time="2019-01-17T12:58:52.565811076+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
Jan 17 12:58:53 crazy-geek dockerd[3857]: time="2019-01-17T12:58:53.283330959+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
Jan 17 12:58:54 crazy-geek dockerd[3857]: time="2019-01-17T12:58:54.011132735+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
Jan 17 12:58:54 crazy-geek dockerd[3857]: time="2019-01-17T12:58:54.695183727+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
Jan 17 12:58:55 crazy-geek dockerd[3857]: time="2019-01-17T12:58:55.437976456+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
Jan 17 12:58:56 crazy-geek dockerd[3857]: time="2019-01-17T12:58:56.063518104+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"

I have tried few things now. Let me explain:

  1. complete rebuild of the cloud-server. Installed apache, it´s accessable
  2. afterwards, deactivated apache, installed discourse standard docker install. Not accessable
  3. complete rebuild of the cloud server. Installed discourse standard docker install. Not accessable

I am out of order now :smiley:

You can test it locally on the host with

curl http://localhost/
curl http://172.17.0.2/

One or both of those should return a bunch of html. If they don’t, go look at the log files in /var/discourse/shared/standalone/log/var-log/nginx/ and /var/discourse/shared/standalone/log/rails/production.log for clues about what could be wrong

You could try ./launcher enter app in the discourse directory and running the top command to verify that nginx, redis, postmaster and ruby are all running. curl is available to test inside the container too.

Thanks @ssvenn,

I tried curl inside the container both adresses:

root@crazy-geek:~# cd /var/discourse
root@crazy-geek:/var/discourse# ./launcher enter app
root@crazy-geek-app:/var/www/discourse# curl http://localhost/
curl: (7) Failed to connect to localhost port 80: Connection refused
root@crazy-geek-app:/var/www/discourse# curl http://172.17.0.2/
curl: (7) Failed to connect to 172.17.0.2 port 80: Connection refused

Outside the container:

root@crazy-geek:/var/discourse# curl http://localhost/
curl: (56) Recv failure: Connection reset by peer
root@crazy-geek:/var/discourse# curl http://172.17.0.2/
curl: (7) Failed to connect to 172.17.0.2 port 80: Connection refused

Error Logs from inside the container:

Nginx (whole error.log is full of the same message):

2019/01/21 12:42:09 [emerg] 16765#16765: PEM_read_bio_X509_AUX("/shared/ssl/crazy-geek.de.cer") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE)

Production Log is empty.

So what does that mean to you?

Perhaps let’s encrypt failed to get the certs? Maybe rebuild again? How did you enable let’s encrypt?

Thanks a lot. That was a noob mistake actually. I needed to deactivate ssl templates in app.yml and rebuild new. Problem was that letsencrypt couldn´t verify the cert for the domain, as the domain is still pointed to the old server :slight_smile:
Sorry for my mistakes and thx a lot for the provided help!

저도 이 문제로 몇 시간을 낭비했습니다. discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub 의 설치 지침에는 Let’s Encrypt 항목에서 그냥 Enter 키를 누르면 해당 단계가 건너뛰어지는 것처럼 되어 있습니다. 하지만 실제로는 그렇지 않습니다. 여전히 me@example.com 으로 이메일을 받아 SSL 인증서를 발급받으려 하지만, 이를 할 수 없는 상태로 설정됩니다.

이후 app.yml 파일에 들어가서 Let’s Encrypt 이메일 줄과 SSL 템플릿을 주석 처리한 뒤 launcher rebuild를 실행해야 합니다. 저는 이것이 discourse-setup의 버그로 간주되어야 한다고 생각합니다. 또한, discourse-setup은 처음부터 다른 인증 기관에서 발급받은 자체 SSL 인증서를 설치할 수 있도록 지원해야 하며, 이렇게 해야 다시 빌드할 필요가 없게 됩니다.

이는 의도된 것입니다. Discourse는 기본적으로 https를 사용하여 안전하게 설치됩니다. 해당 이메일 필드는 갱신 문제가 발생했을 때 알림을 보내기 위한 용도입니다.

다른 CA의 인증서를 사용하는 데 어떤 이점이 있을까요? EV 인증서는 더 이상 많이 사용되지 않으며, Discourse는 자체 인증서를 자동으로 관리할 수 있습니다.

Discourse의 setup은 가장 표준적인 설치에만 해당합니다. 자신의 인증서를 발급받을 수 있을 정도의 능력이 있다면, 해당 인증서를 설치하는 책임도 본인에게 있습니다. Let’s Encrypt가 기본적으로 설치되는 것이 다소 혼란스러울 수 있다는 점에는 동의하지만, 이는 더 안전하며, 아주 오랜 기간 동안 이러한 방식으로 유지되어 왔고 문제 보고도 매우 적었습니다.

그렇다면 Let’s Encrypt 관련 프롬프트에는 'SKIP’이라고 표시하면 안 됩니다. ENTER 키를 누르면 실제로는 건너뛰지 않으므로 말이죠. 아니면 Let’s Encrypt를 사용하지 않을 경우 무엇을 해야 하는지에 대한 힌트를 제공해야 합니다.

하지만 제 생각에는 SKIP을 지원해야 합니다. SKIP이 선택되면, Discourse는 SSL 없이 설정되어 포트 80에서만 작동해야 합니다. 위 게시물에서 보여지듯 전혀 작동하지 않는, 매우 미스터리하고 디버깅하기 어려운 상태가 아니라서입니다.

자동으로 제공되는 인증서를 사용할 수 없는 이유나, 왜 열등한지에 대해 실제로 설명하지 않으셨습니다.

여기에는 기술적인 문제가 없어 보이며, 아무리 좋게 봐줘야 개인적인 선호의 문제일 뿐입니다.

더 자세히 살펴봐야겠지만, 말씀이 맞는 것 같습니다. 개발자 이메일 주소를 Let’s Encrypt에 그대로 사용하도록 아무것도 묻지 않는 것이 적절할 것 같습니다. 다만, 개발자 이메일에는 여러 주소를 포함할 수 있지만 Let’s Encrypt에는 그럴 수 없기 때문에 다소 번거롭지만 가능한 작업입니다.

@Stephen 글쎄요, 이 스레드의 시작 부분에서 언급했듯이, "자동"으로 설정된 부분이 제대로 작동하지 않았습니다. 시스템은 80번 포트나 443번 포트에서 웹 페이지를 전혀 제공하지 않는 상태였습니다. ssl 템플릿을 주석 처리하고 다시 빌드한 후에는 80번 포트에서 정상적으로 작동했습니다.

아마도 아주 쉽게 해결될 수 있을 것 같습니다. 수천 건의 설치 사례에서 문제 없이 설정이 완료되었기 때문입니다.

Cloudflare를 사용 중이신가요?

해당 호스트네임으로 Let’s Encrypt를 활성화한 상태에서 Discourse 설치를 몇 번이나 시도하셨나요?

동의 없이 이메일을 제3자와 공유할 수 없습니다.

정확한 문구는 다음과 같습니다.

      read -p "Optional email address for Let's Encrypt warnings? ($letsencrypt_status) [$letsencrypt_account_email]: " new_value

이메일을 제공하지 않으면 건너뛰는 것입니다. 다른 요구 사항이 있다면 yaml 파일을 수동으로 편집하여 맞게 설정할 수 있습니다.