r/selfhosted • • 7d ago

Need Help Errors setting up Jellyglances/Postgres

Hey, I'm trying to set up Jellyglance. I feel like I'm banging my head against the wall because I can't get it to start properly. It seems to be an issue with the password, but I've checked and double checked, and the password is accurate. I've changed the password and secret for the sake of security in this post. Not sure what I could do differently to get this app to launch... I'm setting this up with Portainer on a Raspberry Pi 4 running Raspberry Pi OS. I changed the port from 3000 to 6000 because I'm already running a different app on port 3000. If you have advice, I'd really appreciate it.

Docker Compose

services:
  jellyglance-db:
    image: postgres:16-alpine
    container_name: jellyglance-db
    restart: unless-stopped
    shm_size: "1gb"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: Z4vQLPL92dGqL2fBZatvHx1SgiP1JYtE
      POSTGRES_DB: jellyglance
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready --dbname=jellyglance --username=postgres"]
      interval: 10s
      timeout: 5s
      retries: 5

  jellyglance:
    image: ghcr.io/nerdy-technician/jellyglance:latest
    container_name: jellyglance
    restart: unless-stopped
    depends_on:
      jellyglance-db:
        condition: service_healthy
    ports:
      - "6000:6000"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: Z4vQLPL92dGqL2fBZatvHx1SgiP1JYtE
      POSTGRES_IP: jellyglance-db
      POSTGRES_PORT: 5432
      POSTGRES_DB: jellyglance
      JWT_SECRET: cac0c70d9fde982b
      TZ: Europe/London
      CONFIG_DIR: /app/config
      BACKUP_DIR: /app/backups
    volumes:
      - ./config:/app/config
      - ./backups:/app/backups

volumes:
  postgres-data:

Error from logs

[MIGRATIONS] Waiting for database (27/30): password authentication failed for user "postgres"
Acquire connection error: error: password authentication failed for user "postgres"
    at parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:306:11)
    at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:143:27)
    at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:37:38)
    at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:12:42)
    at Socket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:568:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:519:3)
    at Readable.push (node:internal/streams/readable:399:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)

From postgres

admin@xanthtastic:/etc/postgresql/17/main $ sudo -u postgres psql
psql (17.12 (Debian 17.12-0+deb13u1))
Type "help" for help.

postgres=# ALTER USER postgres PASSWORD 'Z4vQLPL92dGqL2fBZatvHx1SgiP1JYtE';
ALTER ROLE
postgres-# \q
2 Upvotes

6 comments sorted by

•

u/asimovs-auditor 7d ago edited 7d ago

Expand the replies to this comment to learn how AI was used in this post/project.

→ More replies (1)

4

u/Zarathustra7890 7d ago

I just went through setting this up. I used ai to help diagnose my problems. So this is from ai, and it all makes sense to me. It’s just so good at these things.

You changed the password on the wrong Postgres. That psql session is the Postgres 17 installed on the Pi itself. JellyGlance is talking to the jellyglance-db container (Postgres 16), which is a totally separate database.

The reason your password is "right" but still fails: the postgres image only reads POSTGRES_PASSWORD the very first time it creates the data volume. If you ever started the stack with a different password (like the change-me placeholder), the volume still has the old one, and editing the compose afterwards does nothing.

Easiest fix since it's a fresh install: stop/remove the stack in Portainer, go to Volumes and delete the one ending in postgres-data, then redeploy. It'll initialize with your current password.

If you'd rather keep the volume:

docker exec -it jellyglance-db psql -U postgres -c "ALTER USER postgres PASSWORD 'your-compose-password';"
docker restart jellyglance

Also, your port mapping is going to get you next. It's host:container, and the app listens on 3000 inside the container, so only change the left side. And don't use 6000, Chrome and Firefox block it as an unsafe port (X11), so the page won't load even if everything's working. Something like "6080:3000" will do.

One more thing: I think the image moved to ghcr.io/jellyglance/server:latest as of v1.3.2, so worth switching while you're in there.

3

u/xanthreborn 7d ago

IT WORKS! Thanks so much! :)

1

u/alexwbaule 6d ago

Two things usually cause this with Postgres in Docker. First, if the postgres-data volume was already created during an earlier failed attempt, Postgres ignores any later changes to POSTGRES_PASSWORD in your compose file and keeps the old password until you wipe the volume (docker compose down -v). Second, double-check your volume mount path: Postgres 16 expects /var/lib/postgresql/data rather than /var/lib/postgresql/, and if the password contains special characters, some apps fail to parse it if they build a connection URI without URL-encoding it first.

1

u/WhimsicalChuckler 5d ago

Postgres password errors are maddening because the compose file isn't the only place the password lives. The postgres-data volume keeps whatever value it was first initialized with, so a password that looks right can still be rejected.