'Cannot open database because the directory does not exist' #1887

Closed
opened 2026-04-05 19:42:51 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @sidelkins on 1/7/2025

Upon executing docker compose up, receiving the following output

Attaching to gerbil, pangolin, traefik
pangolin  | 
pangolin  | > @fosrl/pangolin@1.0.0-beta.1 start
pangolin  | > NODE_OPTIONS=--enable-source-maps NODE_ENV=development ENVIRONMENT=prod sh -c 'node dist/migrations.mjs && node dist/server.mjs'
pangolin  | 
pangolin  | /app/node_modules/better-sqlite3/lib/database.js:65
pangolin  |             throw new TypeError('Cannot open database because the directory does not exist');
pangolin  |                   ^
pangolin  | 
pangolin  | TypeError: Cannot open database because the directory does not exist
pangolin  |     at new Database (/app/node_modules/better-sqlite3/lib/database.js:65:9)
pangolin  |     at <anonymous> (/app/server/db/index.ts:11:16)
pangolin  | 
pangolin  | Node.js v20.18.1
Gracefully stopping... (press Ctrl+C again to force)
dependency failed to start: container pangolin is unhealthy

My docker-compose.yml is the default:

services:
  pangolin:
    image: fosrl/pangolin:1.0.0-beta.1
    container_name: pangolin
    restart: unless-stopped
    ports:
      - 3001:3001
      - 3000:3000
    volumes:
      - ./config:/app/config
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3001/api/v1/"]
      interval: "3s"
      timeout: "3s"
      retries: 5

  gerbil:
    image: fosrl/gerbil:1.0.0-beta.1
    container_name: gerbil
    restart: unless-stopped
    depends_on:
      pangolin:
        condition: service_healthy
    command:
      - --reachableAt=http://gerbil:3003
      - --generateAndSaveKeyTo=/var/config/key
      - --remoteConfig=http://pangolin:3001/api/v1/gerbil/get-config
      - --reportBandwidthTo=http://pangolin:3001/api/v1/gerbil/receive-bandwidth
    volumes:
      - ./config/:/var/config
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    ports:
      - 51820:51820/udp
      - 8080:8080 # Port for traefik because of the network_mode
      - 443:443 # Port for traefik because of the network_mode
      - 80:80 # Port for traefik because of the network_mode

  traefik:
    image: traefik:v3.1
    container_name: traefik
    restart: unless-stopped
    network_mode: service:gerbil # Ports appear on the gerbil service
    depends_on:
      pangolin:
        condition: service_healthy
    command:
      - --configFile=/etc/traefik/traefik_config.yml
    volumes:
      - ./traefik:/etc/traefik:ro # Volume to store the Traefik configuration
      - ./letsencrypt:/letsencrypt # Volume to store the Let's Encrypt certificates
*Originally created by @sidelkins on 1/7/2025* Upon executing `docker compose up`, receiving the following output ``` Attaching to gerbil, pangolin, traefik pangolin | pangolin | > @fosrl/pangolin@1.0.0-beta.1 start pangolin | > NODE_OPTIONS=--enable-source-maps NODE_ENV=development ENVIRONMENT=prod sh -c 'node dist/migrations.mjs && node dist/server.mjs' pangolin | pangolin | /app/node_modules/better-sqlite3/lib/database.js:65 pangolin | throw new TypeError('Cannot open database because the directory does not exist'); pangolin | ^ pangolin | pangolin | TypeError: Cannot open database because the directory does not exist pangolin | at new Database (/app/node_modules/better-sqlite3/lib/database.js:65:9) pangolin | at <anonymous> (/app/server/db/index.ts:11:16) pangolin | pangolin | Node.js v20.18.1 Gracefully stopping... (press Ctrl+C again to force) dependency failed to start: container pangolin is unhealthy ``` My docker-compose.yml is the default: ``` services: pangolin: image: fosrl/pangolin:1.0.0-beta.1 container_name: pangolin restart: unless-stopped ports: - 3001:3001 - 3000:3000 volumes: - ./config:/app/config healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3001/api/v1/"] interval: "3s" timeout: "3s" retries: 5 gerbil: image: fosrl/gerbil:1.0.0-beta.1 container_name: gerbil restart: unless-stopped depends_on: pangolin: condition: service_healthy command: - --reachableAt=http://gerbil:3003 - --generateAndSaveKeyTo=/var/config/key - --remoteConfig=http://pangolin:3001/api/v1/gerbil/get-config - --reportBandwidthTo=http://pangolin:3001/api/v1/gerbil/receive-bandwidth volumes: - ./config/:/var/config cap_add: - NET_ADMIN - SYS_MODULE ports: - 51820:51820/udp - 8080:8080 # Port for traefik because of the network_mode - 443:443 # Port for traefik because of the network_mode - 80:80 # Port for traefik because of the network_mode traefik: image: traefik:v3.1 container_name: traefik restart: unless-stopped network_mode: service:gerbil # Ports appear on the gerbil service depends_on: pangolin: condition: service_healthy command: - --configFile=/etc/traefik/traefik_config.yml volumes: - ./traefik:/etc/traefik:ro # Volume to store the Traefik configuration - ./letsencrypt:/letsencrypt # Volume to store the Let's Encrypt certificates ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#1887