YunoHost-Apps / lemmy_ynh

A link aggregator for the fediverse.
https://join.lemmy.ml
GNU General Public License v3.0
19 stars 12 forks source link

Services lemmy-pict-rs and lemmy-ui will not start after upgrading to 0.18.2~ynh3.. #82

Open FatherMcGruder opened 6 months ago

FatherMcGruder commented 6 months ago

Describe the bug

Services lemmy-pict-rs and lemmy-ui will not start after upgrading to 0.18.2~ynh3 from 0.18.2~ynh1.

Context

Steps to reproduce

Expected behavior

All of the Lemmy services should start normally following an upgrade.

Logs

bone187 commented 5 months ago

Same here. Here are the logs from my system: https://paste.yunohost.org/osiyetosoy

csolisr commented 5 months ago

In related issues, it turns out that the latest versions of lemmy-ui have moved from Yarn to PNPM for building (cf. https://github.com/LemmyNet/lemmy-ui/commit/140ff8271c03f544ed8420b2dde77d9a614b9fa6 ). So we would need to replace the installer instructions with:

pnpm i
pnpm prebuild:prod
pnpm build:prod
retiolus commented 5 months ago

I tried making the upgrade, without backup, now the service doesn't start, any way to fix it?

Looks like lemmy service start, but not lemmy-ui.

lemmy-ui :

LOGFILE: journalctl
-- Journal begins at Mon 2024-02-05 18:02:57 UTC, ends at Mon 2024-02-05 18:08:28 UTC. --
Feb 05 18:08:15 systemd[1]: Started Lemmy: UI Daemon.
Feb 05 18:08:15 systemd[1]: lemmy-ui.service: Main process exited, code=exited, status=1/FAILURE
Feb 05 18:08:15 systemd[1]: lemmy-ui.service: Failed with result 'exit-code'.

LOGFILE: /var/log/lemmy/lemmy-ui.log
    at Module.load (node:internal/modules/cjs/loader:1207:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/var/www/lemmy/lemmy-ui/dist/js/server.js' ]
}

Node.js v20.10.0
node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module '@babel/runtime/helpers/extends'
Require stack:
- /var/www/lemmy/lemmy-ui/dist/js/server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at /var/www/lemmy/lemmy-ui/dist/js/server.js:2:97563
    at /var/www/lemmy/lemmy-ui/dist/js/server.js:2:1203165
    at Object.<anonymous> (/var/www/lemmy/lemmy-ui/dist/js/server.js:2:1203169)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/var/www/lemmy/lemmy-ui/dist/js/server.js' ]
}

Node.js v20.10.0
node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module '@babel/runtime/helpers/extends'
Require stack:
- /var/www/lemmy/lemmy-ui/dist/js/server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at /var/www/lemmy/lemmy-ui/dist/js/server.js:2:97563
    at /var/www/lemmy/lemmy-ui/dist/js/server.js:2:1203165
    at Object.<anonymous> (/var/www/lemmy/lemmy-ui/dist/js/server.js:2:1203169)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/var/www/lemmy/lemmy-ui/dist/js/server.js' ]
}

Node.js v20.10.0
FatherMcGruder commented 5 months ago

Did you intentionally disable the backup step when you ran the upgrade? A Lemmy backup should have been automatically generated when you ran the upgrade unless you disabled that step. In my case, I had to disable the back up step during the upgrade, but I just made the back up separately beforehand. -- Sent from my Android device with K-9 Mail.

On February 5, 2024 1:09:47 PM EST, retiolus @.***> wrote:

I tried making the upgrade, without backup, now the service doesn't start, any way to fix it?

Looks like lemmy service start, but not lemmy-ui.

lemmy-ui :

LOGFILE: journalctl
-- Journal begins at Mon 2024-02-05 18:02:57 UTC, ends at Mon 2024-02-05 18:08:28 UTC. --
Feb 05 18:08:15 systemd[1]: Started Lemmy: UI Daemon.
Feb 05 18:08:15 systemd[1]: lemmy-ui.service: Main process exited, code=exited, status=1/FAILURE
Feb 05 18:08:15 systemd[1]: lemmy-ui.service: Failed with result 'exit-code'.

LOGFILE: /var/log/lemmy/lemmy-ui.log
   at Module.load (node:internal/modules/cjs/loader:1207:32) {
 code: 'MODULE_NOT_FOUND',
 requireStack: [ '/var/www/lemmy/lemmy-ui/dist/js/server.js' ]
}

Node.js v20.10.0
node:internal/modules/cjs/loader:1147
 throw err;
 ^

Error: Cannot find module ***@***.***/runtime/helpers/extends'
Require stack:
- /var/www/lemmy/lemmy-ui/dist/js/server.js
   at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
   at Module._load (node:internal/modules/cjs/loader:985:27)
   at Module.require (node:internal/modules/cjs/loader:1235:19)
   at require (node:internal/modules/helpers:176:18)
   at /var/www/lemmy/lemmy-ui/dist/js/server.js:2:97563
   at /var/www/lemmy/lemmy-ui/dist/js/server.js:2:1203165
   at Object.<anonymous> (/var/www/lemmy/lemmy-ui/dist/js/server.js:2:1203169)
   at Module._compile (node:internal/modules/cjs/loader:1376:14)
   at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
   at Module.load (node:internal/modules/cjs/loader:1207:32) {
 code: 'MODULE_NOT_FOUND',
 requireStack: [ '/var/www/lemmy/lemmy-ui/dist/js/server.js' ]
}

Node.js v20.10.0
node:internal/modules/cjs/loader:1147
 throw err;
 ^

Error: Cannot find module ***@***.***/runtime/helpers/extends'
Require stack:
- /var/www/lemmy/lemmy-ui/dist/js/server.js
   at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
   at Module._load (node:internal/modules/cjs/loader:985:27)
   at Module.require (node:internal/modules/cjs/loader:1235:19)
   at require (node:internal/modules/helpers:176:18)
   at /var/www/lemmy/lemmy-ui/dist/js/server.js:2:97563
   at /var/www/lemmy/lemmy-ui/dist/js/server.js:2:1203165
   at Object.<anonymous> (/var/www/lemmy/lemmy-ui/dist/js/server.js:2:1203169)
   at Module._compile (node:internal/modules/cjs/loader:1376:14)
   at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
   at Module.load (node:internal/modules/cjs/loader:1207:32) {
 code: 'MODULE_NOT_FOUND',
 requireStack: [ '/var/www/lemmy/lemmy-ui/dist/js/server.js' ]
}

Node.js v20.10.0

-- Reply to this email directly or view it on GitHub: https://github.com/YunoHost-Apps/lemmy_ynh/issues/82#issuecomment-1927672332 You are receiving this because you authored the thread.

Message ID: @.***>

retiolus commented 5 months ago

I had to disable the backup, and I did not make a backup separately. I confirm lemmy service is working correctly, and I can connect to it using a third-party front-end or app.

Is just lemmy-ui that does not work.

retiolus commented 5 months ago

Actually, lemmy service stopped after a while:

LOGFILE: journalctl
-- Journal begins at Mon 2024-02-05 18:02:57 UTC, ends at Mon 2024-02-05 21:37:27 UTC. --
Feb 05 18:07:58 systemd[1]: Started Lemmy: Link aggregator.
Feb 05 19:00:01 systemd[1]: Stopping Lemmy: Link aggregator...
Feb 05 19:00:03 systemd[1]: lemmy.service: Succeeded.
Feb 05 19:00:03 systemd[1]: Stopped Lemmy: Link aggregator.
Feb 05 19:00:03 systemd[1]: lemmy.service: Consumed 4min 11.417s CPU time.
Feb 05 19:00:03 systemd[1]: Started Lemmy: Link aggregator.
Feb 05 20:00:01 systemd[1]: Stopping Lemmy: Link aggregator...
Feb 05 20:00:01 systemd[1]: lemmy.service: Succeeded.
Feb 05 20:00:01 systemd[1]: Stopped Lemmy: Link aggregator.
Feb 05 20:00:01 systemd[1]: lemmy.service: Consumed 3min 41.374s CPU time.
Feb 05 20:00:01 systemd[1]: Started Lemmy: Link aggregator.
Feb 05 20:00:01 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Feb 05 20:00:01 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Feb 05 21:00:01 systemd[1]: Started Lemmy: Link aggregator.
Feb 05 21:00:01 systemd[1]: lemmy.service: Main process exited, code=exited, status=1/FAILURE
Feb 05 21:00:01 systemd[1]: lemmy.service: Failed with result 'exit-code'.

LOGFILE: /var/log/lemmy/lemmy.log
2024-02-05T19:59:59.613139Z  INFO actix_web::middleware::logger: 139.99.135.30 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.19.3; +https://aussie.zone' 0.009872    
2024-02-05T19:59:59.847064Z  INFO actix_web::middleware::logger: 135.181.143.221 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.18.5; +https://lemmy.world' 0.015572    
2024-02-05T19:59:59.899104Z  INFO actix_web::middleware::logger: 139.99.135.30 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.19.3; +https://aussie.zone' 0.010033    
2024-02-05T20:00:00.115494Z  INFO actix_web::middleware::logger: 135.181.143.221 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.18.5; +https://lemmy.world' 0.009217    
2024-02-05T20:00:00.163105Z  INFO actix_web::middleware::logger: 165.140.24.43 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.18.5; +https://sh.itjust.works' 0.009444    
2024-02-05T20:00:00.178696Z  INFO actix_web::middleware::logger: 139.99.135.30 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.19.3; +https://aussie.zone' 0.006526    
2024-02-05T20:00:00.265731Z  INFO actix_web::middleware::logger: 135.181.143.221 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.18.5; +https://lemmy.world' 0.007218    
2024-02-05T20:00:00.378710Z  INFO actix_web::middleware::logger: 165.140.24.43 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.18.5; +https://sh.itjust.works' 0.008383    
2024-02-05T20:00:00.463861Z  INFO actix_web::middleware::logger: 139.99.135.30 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.19.3; +https://aussie.zone' 0.008344    
2024-02-05T20:00:00.584460Z  INFO lemmy_server::scheduled_tasks: Updating active site and community aggregates ...
2024-02-05T20:00:00.667945Z  INFO actix_web::middleware::logger: 165.140.24.43 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.18.5; +https://sh.itjust.works' 0.013490    
2024-02-05T20:00:00.746699Z  INFO actix_web::middleware::logger: 139.99.135.30 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.19.3; +https://aussie.zone' 0.007892    
2024-02-05T20:00:00.776630Z  INFO actix_web::middleware::logger: 2a01:4f9:c010:8eff::1 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.18.4-kt.2; +https://lemmy.blahaj.zone' 0.007761    
2024-02-05T20:00:01.031153Z  INFO actix_web::middleware::logger: 139.99.135.30 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.19.3; +https://aussie.zone' 0.009181    
2024-02-05T20:00:01.320069Z  INFO actix_web::middleware::logger: 139.99.135.30 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.19.3; +https://aussie.zone' 0.015082    
2024-02-05T20:00:01.349629Z  INFO actix_web::middleware::logger: 135.181.143.221 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.18.5; +https://lemmy.world' 0.007626    
2024-02-05T20:00:01.611700Z  INFO actix_web::middleware::logger: 139.99.135.30 'POST /inbox HTTP/1.0' 200 0 '-' 'Lemmy/0.19.3; +https://aussie.zone' 0.008587    
2024-02-05T20:00:01.657368Z  INFO actix_server::server: SIGTERM received; starting graceful shutdown
2024-02-05T20:00:01.657407Z  INFO actix_server::accept: Accept thread stopped
2024-02-05T20:00:01.657413Z  INFO actix_server::worker: Shutting down idle worker
2024-02-05T20:00:01.657426Z  INFO actix_server::worker: Shutting down idle worker
2024-02-05T20:00:01.657438Z  INFO actix_server::worker: Shutting down idle worker
2024-02-05T20:00:01.657412Z  INFO actix_server::worker: Shutting down idle worker
2024-02-05T20:00:01.657459Z  INFO actix_server::worker: Shutting down idle worker
2024-02-05T20:00:01.658154Z  INFO actix_server::worker: Shutting down idle worker
connection error: db error: FATAL: terminating connection due to administrator command
2024-02-05T20:00:01.705323Z ERROR lemmy_server::scheduled_tasks: Failed to update community stats: terminating connection due to administrator command
2024-02-05T20:00:01.705354Z ERROR lemmy_server::scheduled_tasks: Failed to update site stats: no connection to the server

2024-02-05T20:00:01.705362Z ERROR lemmy_server::scheduled_tasks: Failed to update community stats: no connection to the server

2024-02-05T20:00:01.705368Z ERROR lemmy_server::scheduled_tasks: Failed to update site stats: no connection to the server

2024-02-05T20:00:01.705373Z ERROR lemmy_server::scheduled_tasks: Failed to update community stats: no connection to the server

2024-02-05T20:00:01.705377Z  INFO lemmy_server::scheduled_tasks: Done.
2024-02-05T20:00:01.705382Z  INFO lemmy_server::scheduled_tasks: Updating banned column if it expires ...
2024-02-05T20:00:01.705397Z ERROR lemmy_server::scheduled_tasks: Failed to update person.banned when expires: no connection to the server

2024-02-05T20:00:01.705409Z ERROR lemmy_server::scheduled_tasks: Failed to remove community_ban expired rows: no connection to the server

thread '<unnamed>' panicked at 'could not establish connection: BadConnection("FATAL:  the database system is shutting down\nFATAL:  the database system is shutting down\n")', src/scheduled_tasks.rs:48:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Error connecting to postgres://lemmy:9dwRMNXeMh63yPatlgegajy6SgrA1j@localhost:5432/lemmy: FATAL:  the database system is shutting down
FATAL:  the database system is shutting down
', crates/db_schema/src/utils.rs:217:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-02-05T21:00:01.398676Z  INFO lemmy_db_schema::utils: Running Database migrations (This may take a long time)...
2024-02-05T21:00:01.403276Z  INFO lemmy_db_schema::utils: Database migrations complete.
Error: LemmyError { message: None, inner: Error occurred while creating a new object: the database system is shutting down, context: SpanTrace [] }
FatherMcGruder commented 5 months ago

Vidmid on the Yunohost forums reports that fresh installs work, but upgrades do not. I have too much data on my Lemmy instance to just throw it away for a fresh install. Is there a way to import the data from an old instance to a new one?

Kurt