Instalación de Discourse en intranet - bootstrap falló con código de salida 17

Hola,

Estoy instalando Discourse en un entorno de Intranet. A veces me encuentro con este error durante el proceso de reconstrucción:

> Pups::ExecError: cd /var/www/discourse &amp

¿Recibes algún otro mensaje de error anteriormente en tu registro de compilación?

3 Me gusta

I, [2024-03-29T14:58:21.260866 #1] INFO – :
I, [2024-03-29T14:58:21.261079 #1] INFO – : > su postgres -c ‘createdb discourse’ || true
2024-03-29 14:58:21.298 UTC [55] postgres@postgres ERROR: database “discourse” already exists
2024-03-29 14:58:21.298 UTC [55] postgres@postgres STATEMENT: CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR: database “discourse” already exists
I, [2024-03-29T14:58:21.299606 #1] INFO – :
I, [2024-03-29T14:58:21.299710 #1] INFO – : > su postgres -c ‘psql discourse -c “create user discourse;”’ || true
2024-03-29 14:58:21.334 UTC [59] postgres@discourse ERROR: role “discourse” already exists
2024-03-29 14:58:21.334 UTC [59] postgres@discourse STATEMENT: create user discourse;
ERROR: role “discourse” already exists

y luego otro error antes del bloqueo …

[2024-03-29T14:59:48.410149 #1] INFO – : > cd /var/www/discourse && su discourse -c ‘bundle install --retry 3 --jobs 4’
Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn’t have the CA certificates needed for verification. For information about OpenSSL certificates, see OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps.
Retrying fetcher due to error (3/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn’t have the CA certificates needed for verification. For information about OpenSSL certificates, see OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps.
Retrying fetcher due to error (4/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn’t have the CA certificates needed for verification. For information about OpenSSL certificates, see OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps.
Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most
likely your system doesn’t have the CA certificates needed for verification. For
information about OpenSSL certificates, see
OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps.
I, [2024-03-29T14:59:49.328710 #1] INFO – : Fetching source index from https://rubygems.org/

Este es el problema. Parece que tu internet está bloqueando el acceso a rubygems.

Discourse requiere https y la instalación estándar necesita ser accesible a través de una IP pública para obtener un certificado. Probablemente tendrás problemas por esto también.

1 me gusta

Ok, he realizado una solicitud interna para abrir esta URL… ya que en un entorno de intranet todas las URL están cerradas por defecto.

Tan pronto como esto se haga, te informaré del resultado. Gracias.

Mismo error con la URL https://rubygems.org/ abierta…

Si no puedes abrir el servidor a todos los sitios, tendrás que leer los mensajes tú mismo y abrir cada sitio que se cargue uno por uno. Con un ciclo de entrega de 6 días, esperaría que tardara uno o dos meses.

Hacer que Discourse funcione en una intranet privada que no puede acceder a Internet no está realmente soportado. Es posible que puedas compilar una imagen en otro lugar e intentar lanzarla en tu intranet. Aún así, tendrás que encontrar tu propia manera de obtener certificados https.

1 me gusta

Hola,

Esto es lo que hice:

  • Creé una imagen desde fuera de la intranet en mi PC
  • La subí a un repositorio
  • Descargué la imagen en la VM de la Intranet y luego inicié un contenedor
    ./launcher start app --run-image mi imagen

El contenedor funciona bien, pero parece que los puertos 80/443 no son accesibles (¡los he comprobado con nmap y están abiertos!). No puedo acceder a la aplicación desde el navegador. Cuando escribo: curl -v localhost:80 obtengo este error.

* Usa la variable de entorno proxy no_proxy == 'localhost,127.0.0.1,.laposte.fr'
*   Intentando 127.0.0.1:80...
* Conectado a localhost (127.0.0.1) puerto 80 (#0)

> GET / HTTP/1.1
> Host: localhost
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Fallo al recibir: Conexión reiniciada por el par
* Cerrando conexión 0
curl: (56) Fallo al recibir: Conexión reiniciada por el par

Mi suposición es que no tienes certificados y nginx está fallando. Necesitas eliminar las plantillas de ssl y let’s encrypt y crear una nueva imagen. Luego necesitarás un proxy inverso que tenga un certificado.

Alternativamente, podrías usar un certificado que hayas generado tú mismo. Creo que todavía hay un tema sobre cómo hacer eso (de antes de que existiera let’s encrypt).

Puedes mirar los logs de nginx para ver los errores.

No he activado la plantilla letsencrypt en mi archivo app.yml, así que no debería preocuparme por esta solicitud de eliminación, ¿verdad? Uso un VIP de front-end con su propio certificado.