postgres datastore initiate failed `# encoding: ut...
# spicedb
y
postgres datastore initiate failed
Copy code
# encoding: utf-8
version: '3'
services:
  spicedb:
    image: authzed/spicedb:v1.24.0
    container_name: spicedb
    command: >
      serve
      --grpc-preshared-key "youling"
      --grpc-tls-cert-path "/home/certs/server.crt"
      --grpc-tls-key-path "/home/certs/server.key"
      --log-level trace
      --dashboard-addr :8081
      --datastore-engine=postgres
      --datastore-conn-uri="postgres://spicedb:spicedb@<remoteAddr>:5432/spicedb"
    volumes:
      - ./certs/:/home/certs/:ro
    ports:
      - 50051:50051
      - 9090:9090
      - 8081:8081 # 8080被占了
    depends_on:
      - postgreSQL
    network_mode: bridge

  postgreSQL:
    image: postgres:15.4
    container_name: postgres
    command: postgres --track_commit_timestamp=on 
    restart: always
    environment:
      POSTGRES_USER: spicedb
      POSTGRES_PASSWORD: spicedb
    volumes:
      - ./pgdata:/var/lib/postgresql/data
    ports:
      - 5433:5432
    network_mode: bridge
postgres runs well, while spiceDB panic
Copy code
{"level":"debug","time":"2023-08-28T07:30:29Z","message":"initializing telemetry collector"}
{"level":"debug","module":"pgx","pgx":{"args":[],"commandTag":"BEGIN","pid":47,"sql":"begin isolation level repeatable read read only","time":0.748464},"time":"2023-08-28T07:30:29Z","message":"Query"}
{"level":"error","module":"pgx","pgx":{"args":[],"err":"ERROR: relation \"metadata\" does not exist (SQLSTATE 42P01)","pid":47,"sql":"SELECT unique_id FROM metadata","time":0.93924},"time":"2023-08-28T07:30:29Z","message":"Query"}
{"level":"debug","module":"pgx","pgx":{"args":[],"commandTag":"ROLLBACK","pid":47,"sql":"rollback","time":0.682102},"time":"2023-08-28T07:30:29Z","message":"Query"}
{"level":"error","error":"unable to initialize telemetry collector: unable to query DB stats: unable to query unique ID: ERROR: relation \"metadata\" does not exist (SQLSTATE 42P01)","time":"2023-08-28T07:30:29Z","message":"terminated with errors"}
6 Views