Repository: ghostfolio/ghostfolio

Issue #4018: [BUG] NEither apiKEy nor config.authenticator provided
Created: 2024-11-03T12:46:40Z
Bug Description
Just updated to the newest version and got this error
ghostfolio   | Error: Neither apiKey nor config.authenticator provided
ghostfolio   |     at Stripe._setAuthenticator (/ghostfolio/apps/api/node_modules/stripe/cjs/stripe.core.js:166:23)
ghostfolio   |     at new Stripe (/ghostfolio/apps/api/node_modules/stripe/cjs/stripe.core.js:102:14)
ghostfolio   |     at new SubscriptionService (/ghostfolio/apps/api/main.js:1:76274)
ghostfolio   |     at Injector.instantiateClass (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:365:19)
ghostfolio   |     at callback (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:65:45)
ghostfolio   |     at async Injector.resolveConstructorParams (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:144:24)
ghostfolio   |     at async Injector.loadInstance (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:70:13)
ghostfolio   |     at async Injector.loadProvider (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:97:9)
ghostfolio   |     at async /ghostfolio/apps/api/node_modules/@nestjs/core/injector/instance-loader.js:56:13
ghostfolio   |     at async Promise.all (index 3)
ghostfolio exited with code 1

To Reproduce


Update container via docker compose pull
start container via docker compose up -d

docker-compose.yml
services:
  ghostfolio:
    image: docker.io/ghostfolio/ghostfolio:latest
    container_name: ghostfolio
    init: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    env_file:
      - .env
    environment:
      DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?connect_timeout=300&sslmode=prefer
      REDIS_HOST: redis
      REDIS_PASSWORD: ${REDIS_PASSWORD}
    ports:
      - 3333:3333
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
    healthcheck:
      test:
        - CMD-SHELL
        - curl -f http://localhost:3333/api/v1/health
      interval: 10s
      timeout: 5s
      retries: 5
  postgres:
    image: docker.io/library/postgres:15
    container_name: gf-postgres
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - DAC_READ_SEARCH
      - FOWNER
      - SETGID
      - SETUID
    security_opt:
      - no-new-privileges:true
    env_file:
      - .env
    healthcheck:
      test:
        - CMD-SHELL
        - pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - postgres:/var/lib/postgresql/data
  redis:
    image: docker.io/library/redis:alpine
    container_name: gf-redis
    user: 999:1000
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    env_file:
      - .env
    command:
      - redis-server
      - --requirepass
      - $REDIS_PASSWORD
    healthcheck:
      test:
        - CMD-SHELL
        - redis-cli --pass "$REDIS_PASSWORD" ping | grep PONG
      interval: 10s
      timeout: 5s
      retries: 5
volumes:
  postgres: null

Expected behavior
Start normal
Screenshots

Logs
See above
Environment


Ghostfolio Version 2.121.0
unfortunately I dont know the last working version
self hosted
no experimental features

Additional context

Duplicate issue #4042: [BUG] Neither apiKey nor config.authenticator provided
Created: 2024-11-12T23:56:25Z
Bug Description
Container fails to initialize with Error: Neither apiKey nor config.authenticator provided
To Reproduce
Just initialize the container: docker-compose up. More details (logs) later.
Expected behavior
Container initializes.
Logs
ghostfolio    | + echo Running database migrations
ghostfolio    | + npx prisma migrate deploy
ghostfolio    | Running database migrations
ghostfolio    | Prisma schema loaded from prisma/schema.prisma
ghostfolio    | Datasource "db": PostgreSQL database "ghostfolio", schema "public" at "<redacted-url>"
ghostfolio    |
ghostfolio    | 91 migrations found in prisma/migrations
ghostfolio    |
ghostfolio    |
ghostfolio    | No pending migrations to apply.
ghostfolio    | npm notice
ghostfolio    | npm notice New minor version of npm available! 10.8.2 -> 10.9.0
ghostfolio    | npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.9.0
ghostfolio    | npm notice To update run: npm install -g npm@10.9.0
ghostfolio    | npm notice
ghostfolio    | + echo Seeding the database
ghostfolio    | + npx prisma db seed
ghostfolio    | Seeding the database
ghostfolio    | Running seed command `node prisma/seed.js` ...
ghostfolio    |
ghostfolio    | 🌱  The seed command has been executed.
ghostfolio    | ┌─────────────────────────────────────────────────────────┐
ghostfolio    | │  Update available 5.21.1 -> 5.22.0                      │
ghostfolio    | │  Run the following to update                            │
ghostfolio    | │    npm i --save-dev prisma@latest                       │
ghostfolio    | │    npm i @prisma/client@latest                          │
ghostfolio    | └─────────────────────────────────────────────────────────┘
ghostfolio    | Starting the server
ghostfolio    | + echo Starting the server
ghostfolio    | + node main
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [NestFactory] Starting Nest application...
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] ApiModule dependencies initialized +39ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] ConfigurationModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] CryptocurrencyModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] TransformDataSourceInRequestModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] TransformDataSourceInResponseModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] RedactValuesInResponseModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] JwtModule dependencies initialized +2ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] JwtModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] DiscoveryModule dependencies initialized +1ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] PerformanceLoggingModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] ConfigHostModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] SitemapModule dependencies initialized +15ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] ServeStaticModule dependencies initialized +4ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] EventEmitterModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] ScheduleModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] ConfigModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] PrismaModule dependencies initialized +1ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] DataEnhancerModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] PropertyModule dependencies initialized +1ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] SymbolProfileModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] ImpersonationModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] TagModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM     LOG [InstanceLoader] MarketDataModule dependencies initialized +0ms
ghostfolio    | [Nest] 233  - 11/12/2024, 11:42:12 PM   ERROR [ExceptionHandler] Neither apiKey nor config.authenticator provided
ghostfolio    | Error: Neither apiKey nor config.authenticator provided
ghostfolio    |     at Stripe._setAuthenticator (/ghostfolio/apps/api/node_modules/stripe/cjs/stripe.core.js:166:23)
ghostfolio    |     at new Stripe (/ghostfolio/apps/api/node_modules/stripe/cjs/stripe.core.js:102:14)
ghostfolio    |     at new SubscriptionService (/ghostfolio/apps/api/main.js:1:76274)
ghostfolio    |     at Injector.instantiateClass (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:365:19)
ghostfolio    |     at callback (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:65:45)
ghostfolio    |     at async Injector.resolveConstructorParams (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:144:24)
ghostfolio    |     at async Injector.loadInstance (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:70:13)
ghostfolio    |     at async Injector.loadProvider (/ghostfolio/apps/api/node_modules/@nestjs/core/injector/injector.js:97:9)
ghostfolio    |     at async /ghostfolio/apps/api/node_modules/@nestjs/core/injector/instance-loader.js:56:13
ghostfolio    |     at async Promise.all (index 3)

Environment

Ghostfolio Version: Latest (ghostfolio/ghostfolio:latest) - which I assume is 2.122.0
Self-hosted
Experimental Features disabled
Browser: Chrome Version 130.0.6723.92 (Official Build) (x86_64) - but irrelevant as it's server-side
OS: Ubuntu 22.04.5 LTS - but running on a container.

docker-compose.yaml
services:
  ghostfolio:
    image: ghostfolio/ghostfolio:latest
    container_name: ghostfolio
    restart: unless-stopped
    env_file:
      - secrets.env
    labels:
      - "traefik.enable=true"
      - <traefik-labels>

secrets.env
COMPOSE_PROJECT_NAME=ghostfolio

# CACHE
REDIS_HOST=<redacted>
REDIS_PORT=<redacted>
REDIS_PASSWORD="<redacted>"

# POSTGRES
POSTGRES_DB=<redacted>
POSTGRES_USER=<redacted>
POSTGRES_PASSWORD="<redacted>"
DATABASE_URL="<redacted>"

# GHOSTFOLIO
NODE_ENV=production

# API KEYS
ACCESS_TOKEN_SALT="<redacted>"
ALPHA_VANTAGE_API_KEY=""  # Empty
JWT_SECRET_KEY="<redacted>"

Additional context
I had Ghostfolio running for a long time. This started happening recently, but I don't know when exactly.
Seems related to this bug.

Closing comment (2024-11-13T06:42:24Z): Duplicate of #4018.