lemmyBB: 502 Bad Gateway

I have a lemmy-ui instance working correctly, fresh ansible install. I haven’t configured it yet, but it’s up and running and test posts work fine.

I’m mostly interested in lemmyBB, so I installed that according to “Alongside existing Lemmy instance (native)” install instructions.

Everything seems to work fine during install, systemctl status lemmy_bb.service shows:

Jan 17 06:51:57 vps-f7b29755 lemmy_bb[484]: [2023-01-17T06:51:57Z INFO  rocket::launch_] (FileServer: assets) GET /assets/<path..> [10]
Jan 17 06:51:57 vps-f7b29755 lemmy_bb[484]: [2023-01-17T06:51:57Z INFO  rocket::launch] 📡 Fairings:
Jan 17 06:51:57 vps-f7b29755 lemmy_bb[484]: [2023-01-17T06:51:57Z INFO  rocket::launch_] Templating (ignite, liftoff)
Jan 17 06:51:57 vps-f7b29755 lemmy_bb[484]: [2023-01-17T06:51:57Z INFO  rocket::launch_] Shield (liftoff, response, singleton)
Jan 17 06:51:57 vps-f7b29755 lemmy_bb[484]: [2023-01-17T06:51:57Z INFO  rocket::launch_] Site data fetcher (request)
Jan 17 06:51:57 vps-f7b29755 lemmy_bb[484]: [2023-01-17T06:51:57Z INFO  rocket::shield::shield] 🛡️ Shield:
Jan 17 06:51:57 vps-f7b29755 lemmy_bb[484]: [2023-01-17T06:51:57Z INFO  rocket_dyn_templates::fairing] 📐 Templating:
Jan 17 06:51:57 vps-f7b29755 lemmy_bb[484]: [2023-01-17T06:51:57Z INFO  rocket::launch] 🚀 Rocket has launched from http://127.0.0.1:8703

When checking in with a browser, I get 502 Bad Gateway.

error.log

2023/01/17 07:05:13 [error] 528#528: *33 connect() failed (111: Connection refused) while connecting to upstream, client: 205.178.101.86, server: forums.domain.com, request: "GET / HTTP/2.0"$2023/01/17 07:05:13 [error] 528#528: *33 connect() failed (111: Connection refused) while connecting to upstream, client: 205.178.101.86, server: forums.domain.com, request: "GET /favicon.ic$2023/01/17 07:05:32 [error] 528#528: *50 connect() failed (111: Connection refused) while connecting to upstream, client: 205.178.101.86, server: forums.domain.com, request: "GET / HTTP/2.0"$2023/01/17 07:05:32 [error] 528#528: *50 connect() failed (111: Connection refused) while connecting to upstream, client: 205.178.101.86, server: forums.domain.com, request: "GET /favicon.ic$

This will be impossible to debug without the nginx (or whatever reverse proxy you are using) configuration. Because it looks like lemmybb is running but it is not being served properly.

@sub_ubi
creator
link
fedilink
2
edit-2
2M

I’m using the config here: https://github.com/LemmyNet/lemmyBB/blob/main/docker/nginx.conf

the only difference is that $lemmybb_domain is replaced with the bb ui domain name. Again, the normal lemmy ui works great, ansible install so everything including config is default.

Is there something with the lemmy backend or UI I’m supposed to configure to let it know that lemmyBB exists?

Rocket has launched from http://127.0.0.1:8703

proxy_pass “http://0.0.0.0:8701”;

Make sure these ports are the same. Since your UI is running on 8703 you should use 8703 in the nginx config as well.

@sub_ubi
creator
link
fedilink
2
edit-2
2M

I appreciate all the help! New error, 500

systemctl status lemmy_bb.service

   Loaded: loaded (/etc/systemd/system/lemmy_bb.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2023-01-17 17:55:48 UTC; 3min 42s ago
 Main PID: 20609 (lemmy_bb)
    Tasks: 2 (limit: 2318)
   Memory: 2.8M
   CGroup: /system.slice/lemmy_bb.service
           └─20609 /opt/lemmyBB/target/release/lemmy_bb

Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: [2023-01-17T17:58:24Z INFO  rocket::server] GET / text/html:
Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: thread 'rocket-worker-thread' panicked at 'called `Option::unwrap()` on a `None` value', src/site_fairing.rs:62:53
Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: [2023-01-17T17:58:24Z ERROR _] Handler index panicked.
Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: [2023-01-17T17:58:24Z WARN  _] A panic is treated as an internal server error.
Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: [2023-01-17T17:58:24Z WARN  _] No 500 catcher registered. Using Rocket default.
Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: [2023-01-17T17:58:24Z WARN  lemmy_bb::site_fairing] error sending request for url (http://127.0.0.1:8536/api/v3/site): error trying to connect: tcp connect error: Connection refused (os error 111)
Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: [2023-01-17T17:58:24Z INFO  rocket::server] GET /favicon.ico image/avif:
Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: [2023-01-17T17:58:24Z ERROR _] No matching routes for GET /favicon.ico image/avif.
Jan 17 17:58:24 vps-f7b29755 lemmy_bb[20609]: [2023-01-17T17:58:24Z WARN  _] No 404 catcher registered. Using Rocket default.```


How are you running the lemmy backend? What port is it running on?

@sub_ubi
creator
link
fedilink
1
edit-2
2M

Here’s the config I use for the lemmy backend: https://github.com/LemmyNet/lemmy/blob/main/docker/prod/nginx.conf here’s my lemmy.hjson https://github.com/LemmyNet/lemmy/blob/main/docker/prod/lemmy.hjson

like I said, aside from domain name and required variables, everything is default, running a fresh vps. Ansible install for Lemmy, “install along other instance” instructions for lemmyBB.

No messing with ports. Fresh debian 10, debian 11, ubuntu 22, all with the same result:

Lemmy-UI works fine, lemmyBB returns a 502.

Are you using docker at all? If yes, can you share the output of docker ps?

Also, can you share your /etc/systemd/system/lemmy_bb.service file?

@sub_ubi
creator
link
fedilink
1
edit-2
2M

Thank you for sticking with me!

docker ps

CONTAINER ID   IMAGE                        COMMAND                  CREATED        STATUS          PORTS                                NAMES
88a017ba5903   dessalines/lemmy-ui:0.16.7   "docker-entrypoint.s…"   35 hours ago   Up 22 minutes   127.0.0.1:8601->1234/tcp             itsdomaincom_lemmy-ui_1
1299fcaeb678   dessalines/lemmy:0.16.7      "/app/lemmy"             35 hours ago   Up 22 minutes   127.0.0.1:30850->8536/tcp            itsdomaincom_lemmy_1
145c7d2f16f2   mwader/postfix-relay         "/root/run"              35 hours ago   Up 22 minutes   25/tcp                               itsdomaincom_postfix_1
737381a2939c   asonix/pictrs:0.3.1          "/sbin/tini -- /usr/…"   35 hours ago   Up 22 minutes   6669/tcp, 127.0.0.1:2112->8080/tcp   itsdomaincom_pictrs_1
0f907e51bb9d   postgres:12-alpine           "docker-entrypoint.s…"   35 hours ago   Up 22 minutes   5432/tcp                             itsdomaincom_postgres_1

lemmy_bb.service

[Unit]
Description=lemmy_bb
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/lemmyBB/
Environment="LEMMYBB_BACKEND=http://127.0.0.1:8536"
Environment="LEMMYBB_LISTEN_ADDRESS=127.0.0.1:8703"
Environment="LEMMYBB_INCREASED_RATE_LIMIT=1"
Environment="LD_PRELOAD=libjemalloc.so"
ExecStart=/opt/lemmyBB/target/release/lemmy_bb
Restart=always

[Install]
WantedBy=multi-user.target
Lemmy Support
!lemmy_support
Create a post

Support / questions about Lemmy.

  • 0 users online
  • 1 user / day
  • 6 users / week
  • 25 users / month
  • 99 users / 6 months
  • 848 subscribers
  • 448 Posts
  • 2.46K Comments
  • Modlog