There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Suddenly getting a server error on my instance

I don’t know when it started, I usually check my instance through the Voyager app and it never showed a problem, but I’m suddenly getting “server error” and 502 bad gateway errors on my instance on desktop. I haven’t made any major changes (read, any at all) since I last confirmed it worked on desktop.

Checking the logs I don’t see any obvious proxy issues but I am getting weird connection issues in lemmy-ui:


<span style="color:#323232;">TypeError: fetch failed
</span><span style="color:#323232;">lemmy-lemmy-ui-1  |     at Object.fetch (node:internal/deps/undici/undici:11730:11)
</span><span style="color:#323232;">lemmy-lemmy-ui-1  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
</span><span style="color:#323232;">lemmy-lemmy-ui-1  |   cause: ConnectTimeoutError: Connect Timeout Error
</span><span style="color:#323232;">lemmy-lemmy-ui-1  |       at onConnectTimeout (node:internal/deps/undici/undici:6869:28)
</span><span style="color:#323232;">lemmy-lemmy-ui-1  |       at node:internal/deps/undici/undici:6825:50
</span><span style="color:#323232;">lemmy-lemmy-ui-1  |       at Immediate._onImmediate (node:internal/deps/undici/undici:6857:13)
</span><span style="color:#323232;">lemmy-lemmy-ui-1  |       at process.processImmediate (node:internal/timers:478:21) {
</span><span style="color:#323232;">lemmy-lemmy-ui-1  |     code: 'UND_ERR_CONNECT_TIMEOUT'
</span><span style="color:#323232;">lemmy-lemmy-ui-1  |   }
</span><span style="color:#323232;">lemmy-lemmy-ui-1  | }
</span>

Where on earth can I even begin to address this?

penguin_ex_machina OP ,

So…it’s working now? I haven’t touched anything yet, but I just checked my instance again and it works perfectly fine on desktop now. It always worked through Voyager, so I was able to let people know there was an issue. If it comes back I’ll try some of these suggestions to find a more permanent fix.

ShellMonkey ,
@ShellMonkey@lemmy.socdojo.com avatar

I’ve had some similar issues in recent times and it largely seems to come down to timeouts when the containers are starting up amongst the other few dozen on the box. If I manually restart the lemmy containers after everything else is settled in it comes up fine.

stown ,
@stown@sedd.it avatar

This is an issue that has been present for a long time but recently came back worse with the 0.19 update. It is caused by lemmy-ui failing to load the site icon and it typically happens whenever the the docker container is started/restarted while you have a site icon set. The only fix at the moment is to manually delete the database entry which contains a link to the site image.

stown , (edited )
@stown@sedd.it avatar

Check this GitHub link for instructions. github.com/LemmyNet/lemmy-ui/issues/1530#issuecom…

Once I get home from work this afternoon I will post my docker-compose.yml which has an extra container that automatically deletes the database entry then resets it.

EDIT: Here is the extra container from my docker-compose.yml


<span style="color:#323232;">  icon-fix:
</span><span style="color:#323232;">    image: iconfix:latest
</span><span style="color:#323232;">    command:
</span><span style="color:#323232;">      - /bin/sh
</span><span style="color:#323232;">      - -c
</span><span style="color:#323232;">      - |
</span><span style="color:#323232;">        sleep 10
</span><span style="color:#323232;">        # Remove Site Icon - be sure to set your postgres password
</span><span style="color:#323232;">        PGPASSWORD=<POSTGRESS PASSWORD HERE> psql -U lemmy -h postgres -d lemmy -c "UPDATE site SET icon = NULL WHERE id = 1;"
</span><span style="color:#323232;">        # Refresh Site - replace example.com with your sites domain
</span><span style="color:#323232;">	curl -f -sS -H "Host: example.com" http://lemmy-ui:1234 > temp.html
</span><span style="color:#323232;">        # Reset Site Icon - Set your postgres password and replace the URL with one that points to your icon
</span><span style="color:#323232;"> 	PGPASSWORD=<POSTGRESS PASSWORD HERE> psql -U lemmy -h postgres -d lemmy -c "UPDATE site SET icon = 'https://example.com/pictrs/image/2cc85182-5739-4c86-b982-94fc913e80d3.webp' WHERE id = 1;"
</span><span style="color:#323232;">    depends_on:
</span><span style="color:#323232;">      - postgres
</span>

And here is the Dockerfile for building the iconfix image


<span style="color:#323232;">FROM docker.io/postgres:latest
</span><span style="color:#323232;">RUN apt update
</span><span style="color:#323232;">RUN apt install -y curl
</span>
haui_lemmy ,

I would start at the github repo and check if that issue has been documented.

If yes, follow the instructions. If not, check your dns since 502 often came from dns in my case.

If both doesnt reveal anything, you could open an issue in the repo and post your (sanitized) logs and wait for answers.

The error suggests a problem with the lemmy-lemmy-ui-1 container. Maybe it needs an update or has pulled a wrong update. When did you update last? Did you try restarting the stack?

Good luck.

Dave ,
@Dave@lemmy.nz avatar

If the error is with the UI, then trying a mobile app is a good place to start (since they should connect to the API directly).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines