Hi :wave: I’m trying to run the Hydra docker imag...
# talk-hydra
b
Hi 👋 I’m trying to run the Hydra docker image but it seems to fail to boot up with
Unable to locate the table
after the migrations have been run… and I can connect to the DB and run the failed query without an issue.
Copy code
20221109000010000000   fix_foreign_key                                   Applied   
20221109000010000001   fix_foreign_key                                   Applied   
Successfully applied migrations!
exit code: 0
podman start -a yoco-auth_hydra_1
{
  "audience": "application",
  "level": "info",
  "msg": "No tracer configured - skipping tracing setup",
  "service_name": "Ory Hydra",
  "service_version": "v2.0.3",
  "time": "2023-01-11T14:09:48.847558207Z"
}
2023-01-11 14:09:48.880 UTC [255] ERROR:  relation "networks" does not exist at character 67
2023-01-11 14:09:48.880 UTC [255] STATEMENT:  SELECT networks.created_at, networks.id, networks.updated_at FROM networks AS networks ORDER BY created_at ASC LIMIT 1
{
  "audience": "application",
  "error": {
    "debug": "",
    "message": "Unable to locate the table",
    "reason": "",
    "status": "Internal Server Error",
    "status_code": 500
  },
  "level": "warning",
  "msg": "Unable to determine network, retrying.",
  "service_name": "Ory Hydra",
  "service_version": "v2.0.3",
  "time": "2023-01-11T14:09:48.88072664Z"
}
{
  "audience": "application",
  "error": {
    "debug": "",
    "message": "Unable to locate the table",
    "reason": "",
    "status": "Internal Server Error",
    "status_code": 500
  },
  "level": "error",
  "msg": "Unable to create service registry.",
  "service_name": "Ory Hydra",
  "service_version": "v2.0.3",
  "time": "2023-01-11T14:09:48.880765973Z"
}
Error: Unable to locate the table
Unable to locate the table
Usage:
  hydra serve all [flags]

Flags:
  -h, --help   help for all

Global Flags:
  -c, --config strings   Path to one or more .json, .yaml, .yml, .toml config files. Values are loaded in the order provided, meaning that the last config file overwrites values from the previous config file.
      --dev              Disables critical security checks to improve local development experience. Do not use in production.
      --sqa-opt-out      Disable anonymized telemetry reports - for more information please visit <https://www.ory.sh/docs/ecosystem/sqa>

exit code: 255
everything is in the public schema
m
Are you following this guide https://www.ory.sh/docs/hydra/5min-tutorial ?
b
pretty much…
Copy code
services:
  db:
    container_name: yoco-auth-db
    image: postgres:15-alpine
    ports:
      - 5435:5432
    environment:
      POSTGRES_PASSWORD: password
      POSTGRES_USER: yoco
      POSTGRES_DB: ory_kratos
    volumes:
      - db-data:/var/lib/postgresql/data
      - ./ory/initdb:/docker-entrypoint-initdb.d/
    networks:
      - yoco

  kratos:
    image: oryd/kratos:v0.11.0
    depends_on:
      - db
    ports:
      - 4433:4433
      - 4434:4434
    environment:
      DSN: <postgres://yoco:password@yoco-auth-db:5432/ory_kratos?sslmode=disable&max_conns=20&max_idle_conns=4>
    volumes:
      - ./ory/kratos:/usr/local/conf/kratos
    command: serve all --config /usr/local/conf/kratos/config.yml
    networks:
      - yoco

  hydra-migrate:
    image: oryd/hydra:v2.0.3
    depends_on:
      - db
    environment:
      DSN: <postgres://yoco:password@yoco-auth-db:5432/ory_hydra?sslmode=disable&max_conns=20&max_idle_conns=4>
    restart: on-failure
    volumes:
      - ./ory/hydra:/usr/local/conf/hydra
    command: migrate -c /usr/local/conf/hydra/config.yml sql -e --yes
    networks:
      - yoco

  hydra:
    image: oryd/hydra:v2.0.3
    depends_on:
      - db
      - hydra-migrate
    ports:
      - 4444:4444
      - 4445:4445
    environment:
      DSN: <postgres://yoco:password@yoco-auth-db:5432/ory_hydra?sslmode=disable&max_conns=20&max_idle_conns=4>
    volumes:
      - ./ory/hydra:/usr/local/conf/hydra
    command: serve all --config /usr/local/conf/hydra/config.yml
    networks:
      - yoco

volumes:
  db-data:

networks:
  yoco:
    name: yoco
194 Views