Closed flusflas closed 4 years ago
This is definitely a bug. We’re currently not running the tests against all DBs, only sqlite and then some basic persistence tests for MySQL etc. Looks like this has caused already two bugs so we probably should start doing that to avoid bugs like these in the future. PostgreSQL is the backend of choice for Kratos and a first class citizen :)
Field body in courier_messages table is a VARCHAR(255) which is not enough to store body message. I changed the type to TEXT and it works like a charm
Ah yeah, looks like the migrations generated TEXT in SQLite and VARCHAR in PostgreSQL. We'll update the migrations to use TEXT for that field.
I got the same case here
@zepatrik can you take this one?
Describe the bug
I am using PostgreSQL with Kratos. All worked fine, but now I am trying to add email verification and Kratos fails when registering a new user: the the user is created, but Kratos returns a 500 error (
"pq: value too long for type character varying(255)"
).I have tested the same scenario using SQLite and everything seems to work as expected. Is PostgreSQL fully supported or am I going too fast?
Reproducing the bug
This bug can be reproduced starting from the Quickstart sample project.
Steps to reproduce the behavior:
kratos/contrib/quickstart/kratos/email-password/identity.traits.schema.json
) to:Note that we are adding the email verification feature.
Run
docker-compose -f quickstart.yml up
In this scenario, Kratos is using the default SQLite database. If we navigate to http://127.0.0.1:4455/auth/registration and try to register an user, everything should work (including sending verification email).
Stop docker-compose. Run
docker-compose -f quickstart.yml down -v
Add a PostgreSQL database to
quickstart.yml
:Change DSN in
kratos-migrate
andkratos
containers to point to PostgreSQL:(Optional) Change
kratos-migrate
andkratos
containers images tolatest
(althoughlatest-sqlite
works exactly equal).At this point,
quickstart.yml
should look like this:docker-compose -f quickstart.yml up
"pq: value too long for type character varying(255)"
. The JSON error message (500) returned is:Server logs
Server configuration
Kratos configuration is the same as in the Quickstart demo project.
Environment