YunoHost-Apps / lemmy_ynh

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

Lemmy fails to start up automatically after server boots #72

Open FatherMcGruder opened 1 year ago

FatherMcGruder commented 1 year ago

Describe the bug

This issue is a crosspost from Lemmy fails to start up automatically after server boots. Basically, every time I (re)start my server, I have to start Lemmy manually, either from the services page in the Yunohost admin or the command line. It does not start automatically. It has been at least three weeks since it has started automatically. Start on boot is enabled; at least, that's what it says on the Lemmy service page.

Context

Steps to reproduce

Expected behavior

The Lemmy service should start on boot just like the other services.

Logs

Here's an updated log, compared to what I originally shared on the Yunohost forms. I actually restored a 9/20 backup because I was having stability issues since then if you noticed the discrepancy in the dates. Not sure if that problem is related. Anyway, I think this part is the relevant sequence:

-- Boot 56a8946f82314737a3d20ad163f4419f --
Oct 02 19:53:09 systemd[1]: Started Lemmy: Link aggregator.
Oct 02 19:53:16 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Oct 02 19:53:16 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Oct 02 20:04:27 systemd[1]: Started Lemmy: Link aggregator.
D4llo commented 11 months ago

Same issue here

When I boot my Yunohost server, all my services start but lemmy

01

Note that Start on boot option is Enabled but the configuration is unknown:

image

Here is the journalctl:

-- Journal begins at Mon 2023-11-13 22:01:45 CET, ends at Wed 2023-12-06 14:03:18 CET. --
Nov 23 15:41:51 systemd[1]: Started Lemmy: Link aggregator.
-- Boot 5f40bb46303f4eecabc902ea46cae8d9 --
Nov 30 14:16:06 systemd[1]: Started Lemmy: Link aggregator.
Nov 30 14:16:17 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Nov 30 14:16:17 systemd[1]: lemmy.service: Failed with result 'exit-code'.
-- Boot 80f241e7108743bdb6906dd217d01539 --
Nov 30 15:30:20 systemd[1]: Started Lemmy: Link aggregator.
Nov 30 15:30:28 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Nov 30 15:30:28 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 01 19:22:57 systemd[1]: Started Lemmy: Link aggregator.
Dec 01 19:23:13 systemd[1]: Stopping Lemmy: Link aggregator...
Dec 01 19:23:13 systemd[1]: lemmy.service: Succeeded.
Dec 01 19:23:13 systemd[1]: Stopped Lemmy: Link aggregator.
Dec 01 19:23:13 systemd[1]: Started Lemmy: Link aggregator.
-- Boot ce0cd6ae78134726a779582b936422c5 --
Dec 03 01:59:17 systemd[1]: Started Lemmy: Link aggregator.
Dec 03 01:59:27 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 03 01:59:27 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 03 02:17:13 systemd[1]: Started Lemmy: Link aggregator.
-- Boot d2c066ae16d341fca8cfcb75bdb270d4 --
Dec 03 02:35:32 systemd[1]: Started Lemmy: Link aggregator.
Dec 03 02:35:42 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 03 02:35:42 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 03 02:48:13 systemd[1]: Started Lemmy: Link aggregator.
-- Boot 12bdfed048f44185b7deda5cd1004834 --
Dec 03 20:08:54 systemd[1]: Started Lemmy: Link aggregator.
Dec 03 20:09:05 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 03 20:09:05 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 03 20:11:13 systemd[1]: Started Lemmy: Link aggregator.
Dec 03 20:11:14 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 03 20:11:14 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 03 20:13:49 systemd[1]: Started Lemmy: Link aggregator.
-- Boot 6bd85beb13844edcb9dff1f8b80c57e6 --
Dec 03 23:31:39 systemd[1]: Started Lemmy: Link aggregator.
Dec 03 23:31:48 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 03 23:31:48 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 04 00:52:24 systemd[1]: Started Lemmy: Link aggregator.
-- Boot d1e45b92f2c44aa090d224c4b0028aeb --
Dec 04 18:18:57 systemd[1]: Started Lemmy: Link aggregator.
Dec 04 18:19:08 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 04 18:19:08 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 04 18:21:55 systemd[1]: Started Lemmy: Link aggregator.
-- Boot 7b15b80934e74329a0784f770e5552bd --
Dec 05 00:55:56 systemd[1]: Started Lemmy: Link aggregator.
Dec 05 00:56:07 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 05 00:56:07 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 05 01:01:01 systemd[1]: Started Lemmy: Link aggregator.
-- Boot 21f0bbad9532411f866c7ae53a010908 --
Dec 05 15:30:04 systemd[1]: Started Lemmy: Link aggregator.
Dec 05 15:30:14 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 05 15:30:14 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 05 15:34:44 systemd[1]: Started Lemmy: Link aggregator.
-- Boot 5cda4b41c9354b86bff5a832c4f2e255 --
Dec 05 21:56:08 systemd[1]: Started Lemmy: Link aggregator.
Dec 05 21:56:19 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 05 21:56:19 systemd[1]: lemmy.service: Failed with result 'exit-code'.
Dec 05 21:59:12 systemd[1]: Started Lemmy: Link aggregator.
-- Boot 0881b0d6727d49919be858e9c30b51fd --
Dec 06 13:52:55 systemd[1]: Started Lemmy: Link aggregator.
Dec 06 13:53:05 systemd[1]: lemmy.service: Main process exited, code=exited, status=101/n/a
Dec 06 13:53:05 systemd[1]: lemmy.service: Failed with result 'exit-code'.

and the /var/log/lemmy/lemmy.log:

[2m2023-12-06T08:57:41.167333Z  WARN Error encountered while processing the incoming HTTP request: lemmy_server::root_span_builder: Domain is not in allowlist
   0: lemmy_apub::activities::verify_person_in_community
             at crates/apub/src/activities/mod.rs:50
   1: lemmy_apub::activities::voting::vote::verify
             at crates/apub/src/activities/voting/vote.rs:57
   2: lemmy_apub::activities::community::announce::receive
             at crates/apub/src/activities/community/announce.rs:141
   3: lemmy_server::root_span_builder::HTTP request
           with http.method=POST http.scheme="http" http.host=lemmy.kiois.net http.target=/inbox otel.kind="server" request_id=97be452c-0c55-4964-ab38-dccae3f19d5d http.status_code=400 otel.status_code="OK"
             at src/root_span_builder.rs:16
LemmyError { message: None, inner: Domain is not in allowlist, context: SpanTrace [{ target: "lemmy_apub::activities", name: "verify_person_in_community", file: "crates/apub/src/activities/mod.rs", line: 50 }, { target: "lemmy_apub::activities::voting::vote", name: "verify", file: "crates/apub/src/activities/voting/vote.rs", line: 57 }, { target: "lemmy_apub::activities::community::announce", name: "receive", file: "crates/apub/src/activities/community/announce.rs", line: 141 }, { target: "lemmy_server::root_span_builder", name: "HTTP request", fields: "\u{1b}[3mhttp.method\u{1b}[0m\u{1b}[2m=\u{1b}[0mPOST \u{1b}[3mhttp.scheme\u{1b}[0m\u{1b}[2m=\u{1b}[0m\"http\" \u{1b}[3mhttp.host\u{1b}[0m\u{1b}[2m=\u{1b}[0mlemmy.kiois.net \u{1b}[3mhttp.target\u{1b}[0m\u{1b}[2m=\u{1b}[0m/inbox \u{1b}[3motel.kind\u{1b}[0m\u{1b}[2m=\u{1b}[0m\"server\" \u{1b}[3mrequest_id\u{1b}[0m\u{1b}[2m=\u{1b}[0m97be452c-0c55-4964-ab38-dccae3f19d5d \u{1b}[3mhttp.status_code\u{1b}[0m\u{1b}[2m=\u{1b}[0m400 \u{1b}[3motel.status_code\u{1b}[0m\u{1b}[2m=\u{1b}[0m\"OK\"", file: "src/root_span_builder.rs", line: 16 }] }
2023-12-06T08:57:41.167476Z  INFO actix_web::middleware::logger: 135.181.143.221 'POST /inbox HTTP/1.0' 400 26 '-' 'Lemmy/0.18.5; +https://lemmy.world' 0.072485    
2023-12-06T08:57:49.620953Z  INFO HTTP request{http.method=POST http.scheme="http" http.host=lemmy.kiois.net http.target=/inbox otel.kind="server" request_id=d2912337-bf22-4cc8-90eb-89e034bab07e}:receive:verify: activitypub_federation::fetch: Fetching remote object https://lemmy.dbzer0.com/comment/5721770
2023-12-06T08:57:50.182890Z  INFO HTTP request{http.method=POST http.scheme="http" http.host=lemmy.kiois.net http.target=/inbox otel.kind="server" request_id=d2912337-bf22-4cc8-90eb-89e034bab07e}:receive:verify:verify:verify: activitypub_federation::fetch: Fetching remote object https://lemmy.world/comment/5838736
2023-12-06T08:57:50.333738Z  WARN Error encountered while processing the incoming HTTP request: lemmy_server::root_span_builder: Response body limit was reached during fetch
   0: lemmy_apub::objects::comment::verify
             at crates/apub/src/objects/comment.rs:124
   1: lemmy_apub::fetcher::post_or_comment::verify
             at crates/apub/src/fetcher/post_or_comment.rs:68
   2: lemmy_apub::activities::voting::vote::verify
             at crates/apub/src/activities/voting/vote.rs:57
   3: lemmy_apub::activities::community::announce::receive
             at crates/apub/src/activities/community/announce.rs:141
   4: lemmy_server::root_span_builder::HTTP request
           with http.method=POST http.scheme="http" http.host=lemmy.kiois.net http.target=/inbox otel.kind="server" request_id=d2912337-bf22-4cc8-90eb-89e034bab07e http.status_code=400 otel.status_code="OK"
             at src/root_span_builder.rs:16
LemmyError { message: None, inner: Response body limit was reached during fetch, context: SpanTrace [{ target: "lemmy_apub::objects::comment", name: "verify", file: "crates/apub/src/objects/comment.rs", line: 124 }, { target: "lemmy_apub::fetcher::post_or_comment", name: "verify", file: "crates/apub/src/fetcher/post_or_comment.rs", line: 68 }, { target: "lemmy_apub::activities::voting::vote", name: "verify", file: "crates/apub/src/activities/voting/vote.rs", line: 57 }, { target: "lemmy_apub::activities::community::announce", name: "receive", file: "crates/apub/src/activities/community/announce.rs", line: 141 }, { target: "lemmy_server::root_span_builder", name: "HTTP request", fields: "\u{1b}[3mhttp.method\u{1b}[0m\u{1b}[2m=\u{1b}[0mPOST \u{1b}[3mhttp.scheme\u{1b}[0m\u{1b}[2m=\u{1b}[0m\"http\" \u{1b}[3mhttp.host\u{1b}[0m\u{1b}[2m=\u{1b}[0mlemmy.kiois.net \u{1b}[3mhttp.target\u{1b}[0m\u{1b}[2m=\u{1b}[0m/inbox \u{1b}[3motel.kind\u{1b}[0m\u{1b}[2m=\u{1b}[0m\"server\" \u{1b}[3mrequest_id\u{1b}[0m\u{1b}[2m=\u{1b}[0md2912337-bf22-4cc8-90eb-89e034bab07e \u{1b}[3mhttp.status_code\u{1b}[0m\u{1b}[2m=\u{1b}[0m400 \u{1b}[3motel.status_code\u{1b}[0m\u{1b}[2m=\u{1b}[0m\"OK\"", file: "src/root_span_builder.rs", line: 16 }] }
2023-12-06T08:57:50.333890Z  INFO actix_web::middleware::logger: 135.181.143.221 'POST /inbox HTTP/1.0' 400 44 '-' 'Lemmy/0.18.5; +https://lemmy.world' 0.735640    
2023-12-06T08:57:51.250802Z  WARN Error encountered while processing the incoming HTTP request: lemmy_server::root_span_builder: Domain is not in allowlist
   0: lemmy_apub::activities::verify_person_in_community
             at crates/apub/src/activities/mod.rs:50
   1: lemmy_apub::activities::voting::vote::verify
             at crates/apub/src/activities/voting/vote.rs:57
   2: lemmy_apub::activities::community::announce::receive
             at crates/apub/src/activities/community/announce.rs:141
   3: lemmy_server::root_span_builder::HTTP request
           with http.method=POST http.scheme="http" http.host=lemmy.kiois.net http.target=/inbox otel.kind="server" request_id=f5c7762a-2966-489e-95b0-ab560925d99e http.status_code=400 otel.status_code="OK"
             at src/root_span_builder.rs:16
LemmyError { message: None, inner: Domain is not in allowlist, context: SpanTrace [{ target: "lemmy_apub::activities", name: "verify_person_in_community", file: "crates/apub/src/activities/mod.rs", line: 50 }, { target: "lemmy_apub::activities::voting::vote", name: "verify", file: "crates/apub/src/activities/voting/vote.rs", line: 57 }, { target: "lemmy_apub::activities::community::announce", name: "receive", file: "crates/apub/src/activities/community/announce.rs", line: 141 }, { target: "lemmy_server::root_span_builder", name: "HTTP request", fields: "\u{1b}[3mhttp.method\u{1b}[0m\u{1b}[2m=\u{1b}[0mPOST \u{1b}[3mhttp.scheme\u{1b}[0m\u{1b}[2m=\u{1b}[0m\"http\" \u{1b}[3mhttp.host\u{1b}[0m\u{1b}[2m=\u{1b}[0mlemmy.kiois.net \u{1b}[3mhttp.target\u{1b}[0m\u{1b}[2m=\u{1b}[0m/inbox \u{1b}[3motel.kind\u{1b}[0m\u{1b}[2m=\u{1b}[0m\"server\" \u{1b}[3mrequest_id\u{1b}[0m\u{1b}[2m=\u{1b}[0mf5c7762a-2966-489e-95b0-ab560925d99e \u{1b}[3mhttp.status_code\u{1b}[0m\u{1b}[2m=\u{1b}[0m400 \u{1b}[3motel.status_code\u{1b}[0m\u{1b}[2m=\u{1b}[0m\"OK\"", file: "src/root_span_builder.rs", line: 16 }] }
2023-12-06T08:57:51.250936Z  INFO actix_web::middleware::logger: 165.140.24.43 'POST /inbox HTTP/1.0' 400 26 '-' 'Lemmy/0.18.5; +https://sh.itjust.works' 0.066794    
2023-12-06T08:57:52.061655Z  INFO actix_web::middleware::logger: 54.36.148.184 'GET /api/v3/site HTTP/1.1' 200 11340 '-' 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)' 0.013860    
2023-12-06T08:57:52.074279Z  INFO actix_web::middleware::logger: 54.36.148.184 'GET /api/v3/user?username=konalt%40lemmy.world&sort=New&page=1&limit=20 HTTP/1.1' 200 9411 '-' 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)' 0.005098    
thread 'main' panicked at 'Error connecting to postgres://lemmy:5ab634c9f6dbb1deb1299bd8@localhost:5432/lemmy: could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
', crates/db_schema/src/utils.rs:217:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace