Hi, I try to setup Kratos but I struggle with the ...
# talk-kratos
o
Hi, I try to setup Kratos but I struggle with the DSN for the database connection. I get this error log message:
Copy code
level=fatal msg=dsn must be set audience=application service_name=Ory Kratos service_version=v0.9.0-alpha.3
but it is hard for me to see what I should adjust to make it work. If I copy-paste those values and add them to the dsn, it just result in the same error message. I don't find any documentation about those
audience=application
values in the DSN, any suggestions?
j
the error message is
dsn must be set
- you can ignore
audience=application
as this is just an attribute for log filtering
o
Ok, that was good to know, but was hard to understand. Thanks. I have a DSN set but there must be something wrong with it, thanks anyway.
👍 1
j
then either your
kratos.yaml
is not being loaded, or the environment variable isn’t correct, don’t think there’s a third possibility 🙂
o
This was actually for kratos-migrate and I have not understood wether it needs an
kratos.yaml
or not yet, so I have not included it.
j
kratos-migrate needs all of the same configuration as kratos 🙂
o
oh, I see. But I really hope that an error message about "dsn must be set" is NOT related to missing
kratos.yaml
- that would make me cry.
It looks like that I actually has a kratos.yaml configured, so this is probably some DSN realted config that is wrong, but difficult to find out about.
s
can you maybe give your config file? and obfuscate secrets?
o
I have tried with this kubernetes container spec in a Job:
Copy code
- image: oryd/kratos:v0.9.0
        name: kratos-migrate
        command: ["kratos"]
        args:
        - migrate
        - sql
        - -e
        - --yes
        env:
          - name: DB_DSN
            value: <postgres://kratos:mypassword@127.0.0.1:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4>
I run it on GKE with Goolge SQL Auth Proxy (as recommended by GCP) .... If I run a pod with
postgres
image and the same config, that can connect to the database using the psql command..... It's hard to see what is wrong for me.
j
shouldn’t it only be
DSN
instead of
DB_DSN
?
o
thanks, good catch 🙏. I will try
Thank you @User 🙏 Now it works!!! 🎉 yesterday, I had an additional issue, with networking to the database, but after adding Public IP for the instance and this env-variable name change, now it finally works. Thank you all 🙂
🙌 2
171 Views