CyferShepard / Jellystat

Jellystat is a free and open source Statistics App for Jellyfin
MIT License
921 stars 29 forks source link

Black Screen On First Startup #225

Open mark-monteiro opened 2 weeks ago

mark-monteiro commented 2 weeks ago

Describe the bug After starting up the docker containers, navigating to the website shows a black screen.

Environment Details (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Start up docker containers
  2. Navigate to website
  3. See black screen

Expected Behavior Website displays as normal

Screenshots image

Task Logs N/A

Container Logs

jellystat-1  |
jellystat-1  | > jfstat@1.1.0 start
jellystat-1  | > cd backend && node server.js
jellystat-1  |
jellystat-1  | Error: Postgres details not defined
jellystat-1  | [JELLYSTAT] Database created
jellystat-1  | FS-related option specified for migration configuration. This resets migrationSource to default FsMigrations
jellystat-1  | FS-related option specified for migration configuration. This resets migrationSource to default FsMigrations
jellystat-1  | [JELLYSTAT] Server listening on http://127.0.0.1:3000
jellystat-1  | Error Cleaning up Sync Tasks: TypeError: db.query is not a function
jellystat-1  | Error Cleaning up Sync Tasks: TypeError: db.query is not a function
jellystat-1  | Error Cleaning up Backup Tasks: TypeError: db.query is not a function
jellystat-1  | Sync Task Settings Error: TypeError: db.query is not a function
jellystat-1  | TypeError: db.query is not a function
jellystat-1  |     at Timeout.intervalCallback (/app/backend/tasks/FullSyncTask.js:77:39)
jellystat-1  |     at listOnTimeout (node:internal/timers:573:17)
jellystat-1  |     at process.processTimers (node:internal/timers:514:7)
jellystat-1  | TypeError: db.query is not a function
jellystat-1  |     at Timeout.intervalCallback (/app/backend/tasks/RecentlyAddedItemsSyncTask.js:59:41)
jellystat-1  |     at listOnTimeout (node:internal/timers:573:17)
jellystat-1  |     at process.processTimers (node:internal/timers:514:7)
jellystat-db-1  |
jellystat-db-1  | Data page checksums are disabled.
jellystat-db-1  |
jellystat-db-1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
jellystat-db-1  | creating subdirectories ... ok
jellystat-db-1  | selecting dynamic shared memory implementation ... posix
jellystat-db-1  | selecting default max_connections ... 100
jellystat-db-1  | selecting default shared_buffers ... 128MB
jellystat-db-1  | selecting default time zone ... Etc/UTC
jellystat-db-1  | creating configuration files ... ok
jellystat-db-1  | running bootstrap script ... ok
jellystat-db-1  | performing post-bootstrap initialization ... ok
jellystat-db-1  | initdb: warning: enabling "trust" authentication for local connections
jellystat-db-1  | initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
jellystat-db-1  | syncing data to disk ... ok
jellystat-db-1  |
jellystat-db-1  |
jellystat-db-1  | Success. You can now start the database server using:
jellystat-db-1  |
jellystat-db-1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
jellystat-db-1  |
jellystat-db-1  | waiting for server to start....2024-07-10 23:59:21.416 UTC [38] LOG:  starting PostgreSQL 15.7 (Debian 15.7-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
jellystat-db-1  | 2024-07-10 23:59:21.420 UTC [38] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
jellystat-db-1  | 2024-07-10 23:59:21.449 UTC [41] LOG:  database system was shut down at 2024-07-10 23:59:13 UTC
jellystat-db-1  | 2024-07-10 23:59:21.462 UTC [38] LOG:  database system is ready to accept connections
jellystat-db-1  |  done
jellystat-db-1  | server started
jellystat-db-1  | CREATE DATABASE
jellystat-db-1  |
jellystat-db-1  |
jellystat-db-1  | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
jellystat-db-1  |
jellystat-db-1  | 2024-07-10 23:59:21.972 UTC [38] LOG:  received fast shutdown request
jellystat-db-1  | waiting for server to shut down....2024-07-10 23:59:21.988 UTC [38] LOG:  aborting any active transactions
jellystat-db-1  | 2024-07-10 23:59:21.991 UTC [38] LOG:  background worker "logical replication launcher" (PID 44) exited with exit code 1
jellystat-db-1  | 2024-07-10 23:59:21.992 UTC [39] LOG:  shutting down
jellystat-db-1  | 2024-07-10 23:59:21.998 UTC [39] LOG:  checkpoint starting: shutdown immediate
jellystat-db-1  | ...2024-07-10 23:59:25.796 UTC [39] LOG:  checkpoint complete: wrote 918 buffers (5.6%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.021 s, sync=3.743 s, total=3.805 s; sync files=301, longest=0.356 s, average=0.013 s; distance=4222 kB, estimate=4222 kB
jellystat-db-1  | 2024-07-10 23:59:25.807 UTC [38] LOG:  database system is shut down
jellystat-db-1  |  done
jellystat-db-1  | server stopped
jellystat-db-1  |
jellystat-db-1  | PostgreSQL init process complete; ready for start up.
jellystat-db-1  |
jellystat-db-1  | 2024-07-10 23:59:25.927 UTC [1] LOG:  starting PostgreSQL 15.7 (Debian 15.7-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
jellystat-db-1  | 2024-07-10 23:59:25.928 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
jellystat-db-1  | 2024-07-10 23:59:25.928 UTC [1] LOG:  listening on IPv6 address "::", port 5432
jellystat-db-1  | 2024-07-10 23:59:25.937 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
jellystat-db-1  | 2024-07-10 23:59:25.958 UTC [54] LOG:  database system was shut down at 2024-07-10 23:59:25 UTC
jellystat-db-1  | 2024-07-10 23:59:25.972 UTC [1] LOG:  database system is ready to accept connections
jellystat-db-1  | 2024-07-11 00:03:55.400 UTC [76] ERROR:  database "jfstat" already exists
jellystat-db-1  | 2024-07-11 00:03:55.400 UTC [76] STATEMENT:  CREATE DATABASE jfstat
jellystat-db-1  | 2024-07-11 00:04:26.055 UTC [52] LOG:  checkpoint starting: time

Additional context There are no console errors on the website, just a single failed request to http://192.168.0.115:3000/api/getconfig with 403 Forbidden

Here is my docker compose file (with some minor details redacted)

services:

  jellystat-db:
    image: postgres:15.7
    restart: unless-stopped
    user: xxx:xxx
    secrets:
      - POSTGRES_USER
      - POSTGRES_PASSWORD
    environment:
      POSTGRES_USER_FILE: /run/secrets/POSTGRES_USER
      POSTGRES_PASSWORD_FILE: /run/secrets/POSTGRES_PASSWORD
    volumes:
    - xxxxx:/var/lib/postgresql/data

  jellystat:
    image: cyfershepard/jellystat:1.1.0
    restart: unless-stopped
    depends_on:
      - jellystat-db
    secrets:
      - POSTGRES_USER
      - POSTGRES_PASSWORD
      - JELLYSTAT_JWT_SECRET
    environment:
      POSTGRES_IP: jellystat-db
      FILE__POSTGRES_USER: /run/secrets/POSTGRES_USER
      FILE__POSTGRES_PASSWORD: /run/secrets/POSTGRES_PASSWORD
      FILE__JWT_SECRET: /run/secrets/JELLYSTAT_JWT_SECRET
    ports:
      - xxx:3000
    volumes:
      - xxx:/app/backend/backup-data

secrets:
  POSTGRES_USER:
    file: xxx
  POSTGRES_PASSWORD:
    file: xxx
  JELLYSTAT_JWT_SECRET:
    file: xxx
CyferShepard commented 2 weeks ago

This seems like an issue with how your using docker secrets, right away i can see some incorrect variable names, EG JELLYSTAT_JWT_SECRET needs to be JWT_SECRET, you can reference the readme about variable names. Il try and duplicate your setup to confirm if thats the only issue

mark-monteiro commented 2 weeks ago

Thanks for looking into it.

I don't think that environment variable is going to be an issue, you can see I have the actual environment variable set to FILE__JWT_SECRET. JELLYSTAT_JWT_SECRET is just the name of the file containing the secret

DizzieNight commented 2 weeks ago

I've got the same issue. Using k3s and made a deployment yaml. Using all the same variable names as the wiki mentioned. I did notice on 'getconfig' the browser is getting 403

image

I am also getting this error, I know it's kubernetes but wasn't sure what this meant

image