Problema al actualizar Discourse

Hola,

Estoy actualizando Discourse v2.3.0.beta8 +212 → 2.4.0.beta1.

Primero actualicé el gestor de Docker desde la interfaz web. Luego, la interfaz web me indicó que necesitaba realizar la actualización desde la línea de comandos, así que lo hice.

He tenido errores repetidos durante la actualización. Ejecuto:

cd /var/discourse
su ./launcher rebuild app

Se ejecuta durante unos minutos y luego falla en la actualización de la base de datos. Reinicié mi servidor, lo que trajo Discourse de nuevo (pero sin actualizar) e intenté de nuevo. El mismo error.

¿Alguna sugerencia para proceder?

Aquí está el último conjunto de líneas cuando ejecuto la reconstrucción.

Optimizando iconos del sitio...
I, [2019-07-09T01:22:18.589503 #13]  INFO -- : Terminando procesos asíncronos
I, [2019-07-09T01:22:18.589624 #13]  INFO -- : Enviando INT a HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 67
I, [2019-07-09T01:22:18.589816 #13]  INFO -- : Enviando TERM a exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 183
2019-07-09 01:22:18.589 UTC [67] LOG:  solicitud de apagado rápido recibida
183:signal-handler (1562635338) Received SIGTERM scheduling shutdown...
2019-07-09 01:22:18.593 UTC [67] LOG:  abortando cualquier transacción activa
2019-07-09 01:22:18.599 UTC [67] LOG:  proceso worker: lanzador de replicación lógica (PID 76) salió con código de salida 1
2019-07-09 01:22:18.599 UTC [71] LOG:  apagando
2019-07-09 01:22:18.629 UTC [67] LOG:  el sistema de base de datos se ha apagado
183:M 09 Jul 2019 01:22:18.645 # Apagado solicitado por el usuario...
183:M 09 Jul 2019 01:22:18.645 * Guardando la instantánea RDB final antes de salir.
183:M 09 Jul 2019 01:22:18.672 * DB guardada en disco
183:M 09 Jul 2019 01:22:18.672 # Redis ahora está listo para salir, adiós...


FALLÓ
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' falló con retorno #<Process::Status: pid 366 exit 1>
Ubicación del fallo: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec falló con los parámetros {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
cbaaf74d12f5c22faf7f054d391f3570b5e7d8dd3b8bce421c57ef17c4b43c55
** FALLO EN EL INICIO ** por favor, desplázate hacia arriba y busca mensajes de error anteriores, puede haber más de uno

Edición: Los únicos errores en el registro completo son estos:

I, [2019-07-09T01:21:35.162142 #13]  INFO -- : > su postgres -c 'createdb discourse' || true
2019-07-09 01:21:35.330 UTC [80] postgres@postgres ERROR:  la base de datos "discourse" ya existe
2019-07-09 01:21:35.330 UTC [80] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: fallo en la creación de la base de datos: ERROR:  la base de datos "discourse" ya existe
I, [2019-07-09T01:21:35.332706 #13]  INFO -- :
I, [2019-07-09T01:21:35.333101 #13]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2019-07-09 01:21:35.444 UTC [91] postgres@discourse ERROR:  el rol "discourse" ya existe
2019-07-09 01:21:35.444 UTC [91] postgres@discourse STATEMENT:  create user discourse;
ERROR:  el rol "discourse" ya existe

Noto que se detiene arriba después de “Optimizando iconos del sitio…” ¿quizás hay un problema aquí?

You might try searching for “error role discourse already exists”

searched by that term, didn’t find anything that helped

  • some posts mentioned plugins, I disabled plugins in app.yml
  • I had a message about deprecated version of docker, upgraded that
  • ran discourse doctor

same errors.

Attached is the output of launch rebuild.

Any suggestions for where to go next?

rebuild script.txt (140.9 KB)

It’s worth noting I have a relative url root in my app.xml. Could that be messing up the upgrade?

env:
  DISCOURSE_RELATIVE_URL_ROOT: /epicenter/support

run:
  - exec: echo "Beginning of custom commands"

  - exec:
        cd: $home
        cmd:
          - mkdir -p public/epicenter/support
          - cd public/epicenter/support && ln -s ../../uploads && ln -s ../../backups
          - rm public/uploads
          - rm public/backups
  - replace:
       global: true
       filename: /etc/nginx/conf.d/discourse.conf
       from: proxy_pass http://discourse;
       to: |
          rewrite ^/(.*)$ /epicenter/support/$1 break;
          proxy_pass http://discourse;
  - replace:
       filename: /etc/nginx/conf.d/discourse.conf
       from: etag off;
       to: |
          etag off;
          location /epicenter/support {
             rewrite ^/epicenter/support/?(.*)$ /$1;
          }
  - replace:
         filename: /etc/nginx/conf.d/discourse.conf
         from: $proxy_add_x_forwarded_for
         to: $http_fastly_client_ip
         global: true

Finally got this working on my third or fourth work session. The issue appeared to be missing images from “uploads” folder. The solution was to make a new installation, use the same “app.yml” file, and restore from backup with dummy files for missing images.

In parallel to the original problem, I noticed after a previous upgrade various icons and images disappeared. When I tried to rebuild, the logs showed that the it quites after “optimizing site images”. I think it must have gotten stuck on a missed image and quit without logging that specific error. (there was no indication that missing images was the problem or what image files were missing).

In the end, I made a new Discourse install with the latest version. I restored from backup following directions here. It took me three tries.

First, the backup script errored out looking for uploaded files, so I copied in the uploads/default folder from my previous backed up files.

I ran the restore script again. This time it gave error that it couldn’t find a specific image file. I made a fake image file, gave it the same name and put it in the specified spot.

Ran the restore script a third time. Voila! My site was restored from backup and on the latest version.

1 me gusta