Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL migration can't be applied #778

Closed
suquant opened this issue Oct 19, 2020 · 12 comments
Closed

SQL migration can't be applied #778

suquant opened this issue Oct 19, 2020 · 12 comments

Comments

@suquant
Copy link

suquant commented Oct 19, 2020

Describe the bug
SQL migration can't be applied.

kratos version
Version:                        v0.5.0-alpha.1
Build Commit:   557d37d1139adb14a25abe40d0174d47d4e18fee
Build Timestamp:        2020-10-15T14:01:09Z

Reproducing the bug

kratos  migrate sql "postgres://xxx:yyy@127.0.0.1:5532/kratos?sslmode=disable"
...

WARN[2020-10-19T22:21:10+04:00] Unable to initialize persister, retrying.     audience=application error=map[message:unsupported dialect sqlite3] service_name=ORY Kratos service_version=
WARN[2020-10-19T22:21:10+04:00] Unable to initialize persister, retrying.     audience=application error=map[message:unsupported dialect sqlite3] service_name=ORY Kratos service_version=
WARN[2020-10-19T22:21:11+04:00] Unable to initialize persister, retrying.     audience=application error=map[message:unsupported dialect sqlite3] service_name=ORY Kratos service_version=
...

I suppose the official image oryd/kratos:v0.5.0-alpha.1 was built without a flag "-tags sqlite".
Could someone push a new image with the support of "sqlite" since it is mandatory?

Thank you.

@zepatrik
Copy link
Member

There is an sqlite image, oryd/kratos:v0.5.0-alpha.1-sqlite
The issue also already got fixed gobuffalo/pop#601

@suquant
Copy link
Author

suquant commented Oct 20, 2020

@zepatrik thank you. I see, but it isn’t obvious. I thought that image with postfix “sqlite” it is something for sqlite and it shouldn’t be used for instance for postgresql.

One of the way is to do quick fix for instance try to handle that type of errors and skip it with some logs about it. This will help people avoid stuck at the same problem and might no spend times to figure out in what’s going there...

@caquillo07
Copy link

caquillo07 commented Oct 20, 2020

I am getting the same issue from the oryd/kratos:v0.5.0-alpha.1 image.

I was following the instructions on the get started flow, and got the same error without using sqllite

➜  kratos git:(master) ✗ docker run --rm -it --mount type=bind,source="$(pwd)"/contrib/quickstart/kratos/email-password,target=/home/ory oryd/kratos migrate sql "postgres://postgres:root@localhost:5432/identity?sslmode=disable"
INFO[2020-10-20T05:25:08Z] Config file loaded successfully.              audience=application path=/home/ory/.kratos.yaml service_name=kratos service_version=
WARN[2020-10-20T05:25:08Z] Unable to initialize persister, retrying.     audience=application error=map[message:unsupported dialect sqlite3] service_name=ORY Kratos service_version=```

@aeneasr
Copy link
Member

aeneasr commented Oct 20, 2020

This is resolved on master and will be released today. In the meanwhile, use oryd/kratos:v0.5.0-alpha.1-sqlite as a workaround! Sorry about the inconveniences.

@aeneasr aeneasr closed this as completed Oct 20, 2020
@aeneasr
Copy link
Member

aeneasr commented Oct 20, 2020

The release is now in the pipeline!

@suquant
Copy link
Author

suquant commented Oct 20, 2020

@aeneasr 👍🏼 Thank you

@caquillo07
Copy link

@aeneasr thank you!!!!

@pereslava
Copy link

@aeneasr
I'm getting this error while running image v0.5.1-alpha.1 with postgress.
I'm sure i'm not using sqlite image.

docker image ls
REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE
oryd/kratos                       v0.5.1-alpha.1      79433e228b0b        31 hours ago        37.8MB
oryd/kratos-selfservice-ui-node   v0.5.0-alpha.1      697d470f70c1        6 days ago          227MB
postgres                          9.6                 bb00980cabc0        8 days ago          200MB
oryd/mailslurper                  latest-smtps        c7f0b210ead4        8 months ago        670MB

I run the following from just pulled kartos repository:

docker-compose -f quickstart.yml -f quickstart-standalone.yml quickstart-postgress.yml up --build --force-recreate

And got the error from migrations and kratos containers:

time=2020-10-21T14:28:21Z level=warning msg=Unable to initialize persister, retrying. func=github.com/ory/kratos/driver.(*RegistryDefault).Init.func1 file=/home/ory/driver/registry_default.go:504 audience=application error=map[message:unsupported dialect sqlite3 trace:

Thanks for making this stack.

@suquant
Copy link
Author

suquant commented Oct 21, 2020

@pereslava Hi
I'd recommend using v0.5.1-alpha.1-sqlite that image support SQLite, meanwhile buffalo/pop contributors fixing issues that you've faced.

@pereslava
Copy link

@suquant
Thank you.
It took time to understand that image *-sqlite can connect to postgresql as well.

@aeneasr
Copy link
Member

aeneasr commented Oct 23, 2020

Looks like this is still an issue with 0.5.2

@aeneasr aeneasr reopened this Oct 23, 2020
aeneasr added a commit that referenced this issue Oct 23, 2020
Skips sqlite3 migrations when support is lacking.

Closes #778
@suquant
Copy link
Author

suquant commented Oct 27, 2020

@pereslava That's what I'm talking about it's a bit confusing... Hope it will be fixed soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants