ubergeek77 / Lemmy-Easy-Deploy

Deploy Lemmy the easy way!
MIT License
133 stars 14 forks source link

Using object storage then signing into android app breaks lemmy-ui #55

Closed web110010 closed 1 year ago

web110010 commented 1 year ago

Did you check the FAQ & Troubleshooting section for answers to common questions and issues?

Yes

Describe the issue

What happened? Post any relevant log snippets.

Have a customPictrs.env with following parameters

PICTRS__STORE__TYPE=object_storage
PICTRS__STORE__ENDPOINT=https://<redacted>.vultrobjects.com/
PICTRS__STORE__BUCKET_NAME=lemmy-pictrs
PICTRS__STORE__REGION=<redacted>
PICTRS__STORE__USE_PATH_STYLE=false
PICTRS__STORE__ACCESS_KEY=<redacted>
PICTRS__STORE__SECRET_KEY=<redacted>

run ./deploy.sh everything works. I changed the icon, did not test without changing the icon yet but will update it soon. Everything works right now. Login to android app (I have tried with Liftoff and Jerboa)

try opening the website with url, url doesn't load and instead get server error.

lemmy is running, can access from android app, can sign into another app. also tested alexandrite, its working.

Just lemmy-ui is having issue.

lemmy-ui log from docker compose -p lemmy-easy-deploy logs -f:

the image to be fetched is there when opening the link

lemmy-easy-deploy-lemmy-ui-1  | FetchError: request to https://my-domain.com/pictrs/image/a0391ca9-a32b-42fe-bd97-33c2a9a053d0.png failed, reason: connect ETIMEDOUT 139.84.166.119:443
lemmy-easy-deploy-lemmy-ui-1  |     at ClientRequest.<anonymous> (/app/node_modules/node-fetch/lib/index.js:1505:11)
lemmy-easy-deploy-lemmy-ui-1  |     at ClientRequest.emit (node:events:514:28)
lemmy-easy-deploy-lemmy-ui-1  |     at TLSSocket.socketErrorListener (node:_http_client:495:9)
lemmy-easy-deploy-lemmy-ui-1  |     at TLSSocket.emit (node:events:514:28)
lemmy-easy-deploy-lemmy-ui-1  |     at emitErrorNT (node:internal/streams/destroy:151:8)
lemmy-easy-deploy-lemmy-ui-1  |     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
lemmy-easy-deploy-lemmy-ui-1  |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
lemmy-easy-deploy-lemmy-ui-1  |   type: 'system',
lemmy-easy-deploy-lemmy-ui-1  |   errno: 'ETIMEDOUT',
lemmy-easy-deploy-lemmy-ui-1  |   code: 'ETIMEDOUT'
lemmy-easy-deploy-lemmy-ui-1  | }

Diagnostic Information

Run ./deploy.sh -d and paste the output below:


==== Docker Information ====
Detected runtime: docker (Docker version 24.0.5, build ced0996)
Detected compose: docker compose (Docker Compose version v2.20.2)
Runtime state: OK

==== System Information ==== OS: Linux KERNEL: 6.1.0-9-amd64 (x86_64) HOSTNAME: OK SHELL: bash MEMORY: total used free shared buff/cache available Mem: 1.9Gi 600Mi 529Mi 17Mi 1.0Gi 1.3Gi Swap: 4.8Gi 17Mi 4.8Gi

DISTRO:

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_CODENAME=bookworm

==== Lemmy-Easy-Deploy Information ==== Version: 1.2.8

IMAGE CREATED STATUS caddy:latest 5 minutes ago Up 5 minutes ghcr.io/ubergeek77/lemmy-ui:0.18.3 5 minutes ago Up 5 minutes ghcr.io/ubergeek77/lemmy:0.18.3 5 minutes ago Up 5 minutes asonix/pictrs:0.4.0 5 minutes ago Up 5 minutes postgres:15-alpine 5 minutes ago Up 5 minutes

Integrity: 074ae41957936daac883c66bcac0ca12093343ef5e923752689b936b3c6b1b25 ./deploy.sh 1e9b0c0988998dcc33cb0fbfdb0e1679229424e724f898b797380adc7d102446 ./templates/Caddy-Dockerfile.template c1202e70662dd2228da36a35a0f38ec8fc81bec8964d7315d02e8671a58dd7d7 ./templates/Caddyfile.template 2537678c7971df36c1ed95f4228d3cfcb15bb4a28a60d939eaf8dd75b5d64a36 ./templates/cloudflare.snip c9cb4c5fee12930e17798a02ae1bd12e2dc69e149a394c24511bc9d4e6b776d4 ./templates/compose-email.snip c494a610bcb4cd1cfc0a4fe4fb0f6d437b2a84a0ad1625daee240e6dd6f1c910 ./templates/compose-email-volumes.snip f5325a9e26b29da51c6d3295aa278ff08ce71ffd2cd63dc4bebf00e54c468899 ./templates/docker-compose.yml.template 1c202b1b6e87c65b2fcda6035c9fe3f8631d76662907ffd38f24b14686e30647 ./templates/lemmy-email.snip c834cdce9eaf77f38155b404724fdfe66845575386ee516987452aa715642a6f ./templates/lemmy.hjson.template

Custom Files: total 4.0K -rw-r--r-- 1 0 0 305 Jul 31 11:51 customPictrs.env

==== Settings ==== CLOUDFLARE: No CADDY_DISABLE_TLS: false CADDY_HTTP_PORT: 80 CADDY_HTTPS_PORT: 443 LEMMY_TLS_ENABLED: true ENABLE_EMAIL: true SMTP_PORT: 587 ENABLE_POSTFIX: false POSTGRES_POOL_SIZE: 5

==== Generated Files ==== Deploy Version: 0.18.3;0.18.3

total 40K drwxr-xr-x 2 0 0 4.0K Jul 31 11:36 caddy -rw-r--r-- 1 0 0 26 Jul 31 11:51 caddy.env -rw-r--r-- 1 0 0 305 Jul 31 11:51 customPictrs.env -rw-r--r-- 1 0 0 1.7K Jul 31 11:51 docker-compose.yml -rw-r--r-- 1 0 0 50 Jul 31 11:36 lemmy.env -rw-r--r-- 1 0 0 702 Jul 31 11:51 lemmy.hjson -rw-r--r-- 1 0 0 49 Jul 31 11:36 pictrs.env -rw-r--r-- 1 0 0 30 Jul 31 11:51 postfix.env -rw-r--r-- 1 0 0 51 Jul 31 11:36 postgres.env -rw-r--r-- 1 0 0 14 Jul 31 11:52 version

web110010 commented 1 year ago

An update, it seems to be working right now?

Edit: this did not work, it worked for a few minutes then back to the same problem

I tried to do something slightly different this time. The deployment process did not change. What changed was I tried to do something else afterwards:

My Steps:

  1. login to lemmy at website using url.
  2. login to alexandrite.
  3. check if lemmy-ui is working, it works.
  4. login to jerboa.
  5. check if lemmy-ui is working, it works.
  6. create community and post
  7. lemmy-ui works
  8. creat post with image
  9. lemmy-ui works
  10. change icon in lemmy-ui, this time a different icon
  11. lemmy-ui works
  12. add banner image
  13. lemmy-ui still works
  14. change back icon to the one I wanted
  15. lemmy-ui still works
  16. login to liftoff, lemmy-ui works

I think the important change here was that I logged into other ui before adding any image. All the images are being stored in my bucket, I checked.

Is this the solution? Or will this break lemmy-ui when I update?

ubergeek77 commented 1 year ago

Unfortunately this isn't a Lemmy Easy Deploy issue, you are being affected by this bug:

https://www.github.com/LemmyNet/lemmy-ui/issues/1530

Lemmy UI doesn't have even basic error handling for the server side rendering, and it gives up at the first sign of trouble. In this case, it can't access pict-rs for some reason. There seems to be a secondary bug regarding how that URL is calculated sometimes, but you can check that issue for some workarounds.