flat-rose-25983
12/07/2023, 8:27 PMStarting PostgreSQL **
2023-12-07 14:56:37.602 GMT [1] LOG: pgaudit extension initialized
2023-12-07 14:56:37.610 GMT [1] LOG: starting PostgreSQL 14.4 on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2023-12-07 14:56:37.610 GMT [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-12-07 14:56:37.610 GMT [1] LOG: listening on IPv6 address "::", port 5432
2023-12-07 14:56:37.619 GMT [1] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2023-12-07 14:56:37.625 GMT [131] LOG: database system was shut down at 2023-12-07 14:56:37 GMT
2023-12-07 14:56:37.634 GMT [1] LOG: database system is ready to accept connections
2023-12-07 14:56:46.323 GMT [145] FATAL: database "identity" does not exist
2023-12-07 14:56:46.556 GMT [146] FATAL: database "identity" does not exist
2023-12-07 14:56:55.601 GMT [154] FATAL: database "identity" does not exist
2023-12-07 14:56:56.104 GMT [155] FATAL: database "identity" does not exist
2023-12-07 14:57:17.114 GMT [184] FATAL: database "identity" does not exist
Kratos logs:
kubectl logs kratos-86f7b57998-fxwwx -c kratos-automigrate -n auth-default
time=2023-12-07T15:06:57Z level=info msg=No tracer configured - skipping tracing setup audience=application service_name=Ory Kratos service_version=v1.0.0
time=2023-12-07T15:06:57Z level=debug msg=Connecting to SQL Database audience=application connMaxLifetime=0s idlePool=2 pool=4 service_name=Ory Kratos service_version=v1.0.0
time=2023-12-07T15:06:58Z level=warning msg=Unable to ping database, retrying. audience=application error=map[message:failed to connect to `host=postgres user=postgres database=identity`: server error (FATAL: database "identity" does not exist (SQLSTATE 3D000)) stack_trace:
<http://github.com/ory/kratos/persistence/sql.(*Persister).Ping|github.com/ory/kratos/persistence/sql.(*Persister).Ping>
chilly-king-10285
12/07/2023, 8:27 PMchilly-king-10285
12/07/2023, 8:28 PMbash createdb kratos
If you want to use a database named "identity", you should create it using the command createdb identity
. After creating the database, you need to update the dsn
configuration in your kratos.yml
file to use the newly created database. Here is an example of how to do it: yaml - dsn: memory + dsn: <postgres://kratos:[email> protected]:5432/identity?sslmode=disable&max_conns=20&max_idle_conns=4
Also, ensure that you have run the SQL migrations as mentioned in the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/guides/docker#running-migrations). This is required for new installations and when upgrading. Here is the command to run the migrations: bash docker -e DSN="{your database URL}" run oryd/kratos:<version> migrate sql -e
Please replace {your database URL}
with your actual database URL and <version>
with the version of Kratos you are using.