Después de la instalación de Discourse, no se puede acceder desde el navegador

Hola,

He configurado un nuevo servidor en la nube con Ubuntu 18 e instalado Discourse como lo hago siempre, con la configuración estándar de menos de 30 minutos. Ahora, cuando intento crear un administrador por primera vez, abro la instalación en mi navegador y recibo un error indicando que el servidor no es accesible. Dos cosas son diferentes en comparación con mis otros servidores: 1. He cambiado a Hetzner Cloud, y 2. Por el momento solo puedo acceder a la instalación mediante la dirección IP, ya que planeo migrar un servidor existente a este nuevo.

Creo que la imagen de Ubuntu de Hetzner es mínima y no tiene nada instalado. Me he quedado sin ideas y espero que alguien pueda indicarme el camino correcto :slight_smile:

Muchas gracias de antemano.
Saludos,
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.

2 Me gusta

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.

2 Me gusta

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!

4 Me gusta

Justo yo mismo perdí horas en esto. Las instrucciones de instalación en discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub sugieren que si simplemente presionas Enter en la línea de Let’s Encrypt, se omitirá. Pero no es así. Aun así configura las cosas para usar un certificado SSL que no puede obtener en el correo electrónico me@example.com.

Luego hay que ir a app.yml, comentar la línea del correo electrónico de Let’s Encrypt y las plantillas SSL, y luego reconstruir con launcher. Creo que esto debería considerarse un error en discourse-setup. Además, discourse-setup debería tener soporte para instalar tu propio certificado SSL obtenido de otra autoridad desde el principio, para que no tengas que reconstruir.

Es intencional: Discourse se instala de forma segura por defecto con HTTPS de forma nativa. Ese campo de correo electrónico es solo para notificarle sobre problemas de renovación.

¿Qué beneficio hay en usar el certificado de una CA diferente? Los certificados EV ya no son realmente una cosa, y Discourse puede gestionar su propio certificado automáticamente.

Discourse setup está pensado únicamente para la instalación más estándar. Si tienes la capacidad de obtener tu propio certificado, eres responsable de instalarlo. Estoy de acuerdo en que es un poco confuso que Let’s Encrypt se instale de forma predeterminada, pero es más seguro y ha sido así durante mucho tiempo con muy pocos informes de problemas.

Entonces, el mensaje en la sección de Let’s Encrypt no debería decir SKIP, ya que realmente no lo omite si presionas ENTER. O bien, debería darte alguna indicación sobre qué hacer si no vas a usar Let’s Encrypt.

Pero, en mi opinión, SKIP debería ser una opción válida. Si se omite, Discourse debería configurarse sin SSL en ese momento, funcionando solo en el puerto 80, en lugar de no funcionar en absoluto y quedar en un estado muy misterioso y difícil de depurar, como muestran los mensajes anteriores.

Realmente no has explicado por qué no puedes usar el certificado proporcionado automáticamente ni en qué es inferior.

No parece haber ningún problema técnico; en el mejor de los casos, se trata de una preferencia.

1 me gusta

Necesitaré revisarlo con más detenimiento, pero creo que tienes razón. Sospecho que lo que debería hacer es no preguntarte nada y simplemente usar la dirección de correo del desarrollador para Let’s Encrypt. El problema es que es legal incluir varias direcciones en los correos del desarrollador, pero no para Let’s Encrypt, así que sería un poco engorroso, aunque factible.

@Stephen Bueno, como se indica al inicio de este hilo, lo que supuestamente era “automático” no funcionó. El sistema estaba en un estado en el que no servía páginas web en absoluto en los puertos 80 ni 443. Una vez que comenté las plantillas SSL y reconstruí, funcionó perfectamente en el puerto 80.

Es probable que sea una solución muy sencilla; hay miles de instalaciones que se han configurado sin problemas.

¿Estás usando Cloudflare?

¿Cuántas veces intentaste configurar Discourse en ese nombre de host con Let’s Encrypt habilitado?

No se pueden compartir correos electrónicos con terceros sin consentimiento.

Las palabras exactas son

      read -p "¿Dirección de correo electrónico opcional para las advertencias de Let's Encrypt? ($letsencrypt_status) [$letsencrypt_account_email]: " new_value

Sí omite pedir tu correo electrónico. Si tienes necesidades diferentes, puedes editar manualmente el archivo yaml para adaptarlo.

2 Me gusta