Skip to content

docker部署时候报错:Failed to initialize price table from seed: #358

@aantior

Description

@aantior

报错内容:

2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 hostname=883867b18c71 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 hostname=883867b18c71 error=Invariant: static generation store missing in revalidatePath /settings/prices 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 hostname=883867b18c71 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 hostname=883867b18c71 error=Invariant: static generation store missing in revalidatePath /settings/prices msg=❌ Failed to initialize price table from seed:
2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 hostname=883867b18c71 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 hostname=883867b18c71 err={"type":"Error","message":"Invariant: static generation store missing in revalidatePath /settings/prices","stack":"Error: Invariant: static generation store missing in revalidatePath /settings/prices\n    at m (/app/.next/server/chunks/_0d49f33f._.js:22:43489)\n    at g (/app/.next/server/chunks/_0d49f33f._.js:22:43347)\n    at c (/app/.next/server/chunks/_0d49f33f._.js:22:78110)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async s (/app/.next/server/chunks/[root-of-the-server]__8e2a802c._.js:84:1511)\n    at async n (/app/.next/server/chunks/[root-of-the-server]__8e2a802c._.js:84:2050)\n    at async Module.t (/app/.next/server/chunks/[root-of-the-server]__5ecd8170._.js:1:933)\n    at async registerInstrumentation (/app/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js:63:13)\n    at async NextNodeServer.runInstrumentationHookIfAvailable (/app/node_modules/next/dist/server/next-server.js:625:9)\n    at async NextNodeServer.prepareImpl (/app/node_modules/next/dist/server/next-server.js:622:9)"} 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 hostname=883867b18c71 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR 2025-12-17T14:21:32.085Z 2025-12-17T14:21:32.085Z ERR pid=1 hostname=883867b18c71 err={"type":"Error","message":"Invariant: static generation store missing in revalidatePath /settings/prices","stack":"Error: Invariant: static generation store missing in revalidatePath /settings/prices\n    at m (/app/.next/server/chunks/_0d49f33f._.js:22:43489)\n    at g (/app/.next/server/chunks/_0d49f33f._.js:22:43347)\n    at c (/app/.next/server/chunks/_0d49f33f._.js:22:78110)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async s (/app/.next/server/chunks/[root-of-the-server]__8e2a802c._.js:84:1511)\n    at async n (/app/.next/server/chunks/[root-of-the-server]__8e2a802c._.js:84:2050)\n    at async Module.t (/app/.next/server/chunks/[root-of-the-server]__5ecd8170._.js:1:933)\n    at async registerInstrumentation (/app/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js:63:13)\n    at async NextNodeServer.runInstrumentationHookIfAvailable (/app/node_modules/next/dist/server/next-server.js:625:9)\n    at async NextNodeServer.prepareImpl (/app/node_modules/next/dist/server/next-server.js:622:9)"} msg=处理价格表失败:

使用的docker compose(在portainer上部署):

services:
  postgres:
    image: postgres:18
    container_name: claude-code-hub-db
    restart: unless-stopped
    # 不对外暴露数据库端口,仅允许容器内部网络访问
    # 如需调试,可取消注释下行(仅绑定本机):
    # ports:
    #   - "127.0.0.1:35432:5432"
    # env_file:
    #   - ./.env
    environment:
      POSTGRES_USER: ${DB_USER:-user}
      POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
      POSTGRES_DB: ${DB_NAME:-claude_code_hub}
      # 使用自定义数据目录
      PGDATA: /data/pgdata
      # 设置时区为上海
      TZ: Asia/Shanghai
      PGTZ: Asia/Shanghai
    volumes:
      # 持久化数据库数据到本地 ./data/postgres 目录
      # 挂载到 /data 而不是 /var/lib/postgresql/data 避免权限冲突
      - /volume1/Docker/claude-code-hub/data/postgres:/data/pgdata
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-claude_code_hub}"]
      interval: 5s
      timeout: 5s
      retries: 10
      start_period: 10s
    user: "1000:1000"
    networks:
      - network-bridge

  redis:
    image: redis:7-alpine
    container_name: claude-code-hub-redis
    restart: unless-stopped
    volumes:
      # 持久化 Redis 数据到本地 ./data/redis 目录
      # 使用 AOF 持久化模式,确保数据不丢失
      - /volume1/Docker/claude-code-hub/data/redis:/data
    command: redis-server --appendonly yes
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 5
      start_period: 5s
    networks:
      - network-bridge

  app:
    image: ghcr.nju.edu.cn/ding113/claude-code-hub:latest
    container_name: claude-code-hub-app
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
    # env_file:
    #   - ./.env
    environment:
      NODE_ENV: production
      # 容器内使用 Dockerfile 默认端口 3000,对外通过 APP_PORT 暴露(默认 23000)
      DSN: postgresql://${DB_USER:-user}:${DB_PASSWORD:-password}@postgres:5432/${DB_NAME:-claude_code_hub}
      REDIS_URL: redis://redis:6379
      AUTO_MIGRATE: ${AUTO_MIGRATE:-true}
      ENABLE_RATE_LIMIT: ${ENABLE_RATE_LIMIT:-true}
      SESSION_TTL: ${SESSION_TTL:-300}
      # 设置时区为上海
      TZ: Asia/Shanghai
    # ports:
    #   - "${APP_PORT:-23000}:3000"
    expose:
      - 3000
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:3000/api/actions/health || exit 1"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 30s
    networks:
      - network-bridge
      - traefik
    labels:
      # 初始化 traefik
      - "traefik.enable=true"
      - "traefik.docker.network=traefik"
      - "traefik.http.services.${AppName}-backend.loadbalancer.server.scheme=http"
      - "traefik.http.services.${AppName}-backend.loadbalancer.server.port=3000"
      - "traefik.http.routers.${AppName}-ssl.tls.certresolver=le"
      # 设置中间件
      - "traefik.http.middlewares.${AppName}-redir-https.redirectscheme.scheme=https"
      - "traefik.http.middlewares.${AppName}-redir-https.redirectscheme.permanent=false"

      # http80
      - "traefik.http.routers.${AppName}-web.entrypoints=http"
      - "traefik.http.routers.${AppName}-web.rule=Host(`${DOMAIN}`)"
      - "traefik.http.routers.${AppName}-web.middlewares=${AppName}-redir-https, gzip"

      # https443
      - "traefik.http.routers.${AppName}-ssl.entrypoints=https"
      - "traefik.http.routers.${AppName}-ssl.tls=true"
      - "traefik.http.routers.${AppName}-ssl.rule=Host(`${DOMAIN}`)"
      - "traefik.http.routers.${AppName}-ssl.middlewares=gzip"

      # https8443
      - "traefik.http.routers.${AppName}-ssl8443.entrypoints=https8443"
      - "traefik.http.routers.${AppName}-ssl8443.tls=true"
      - "traefik.http.routers.${AppName}-ssl8443.rule=Host(`${DOMAIN}`)"
      - "traefik.http.routers.${AppName}-ssl8443.middlewares=gzip"

networks:
  network-bridge:
    driver: bridge
  traefik:
    external: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions