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

docker compose files using invalid migrate syntax #773

Closed
Uli-Tiger opened this issue Oct 15, 2021 · 3 comments · Fixed by #800
Closed

docker compose files using invalid migrate syntax #773

Uli-Tiger opened this issue Oct 15, 2021 · 3 comments · Fixed by #800
Labels
bug Something is not working. good first issue A good issue to tackle when being a novice to the project. help wanted We are looking for help on this one.
Milestone

Comments

@Uli-Tiger
Copy link

Uli-Tiger commented Oct 15, 2021

migrate sql postgres://dbuser:secret@postgresd:5432/accesscontroldb?sslmode=disable

According to the CLI reference (https://www.ory.sh/keto/docs/cli/keto-migrate) this not valid syntax for migrate. As a consequence the keto-migrate service will not do anything.
With 0.7 this docker compose file will not work out of the box anymore, because duse to the invalid migrate the keto service will fail to start with Migrations were not applied yet, please apply them first.ketopoc_keto_1 exited with code 255

should this be better migrate up --yes? and the whole block

  keto-migrate:
    image:  oryd/keto:v0.7.0-alpha.0
    links:
      - postgresd:postgresd
    volumes:
      - type: bind
        source: .
        target: /home/ory
    environment:
      - LOG_LEVEL=debug
      - DSN=postgres://dbuser:secret@postgresd:5432/accesscontroldb?sslmode=disable
    command:
      migrate up --yes

or did i missed here something?

@zepatrik
Copy link
Member

True, would you be up for a fix?

@zepatrik zepatrik added bug Something is not working. good first issue A good issue to tackle when being a novice to the project. help wanted We are looking for help on this one. labels Oct 18, 2021
@Bhautik0110
Copy link

In oryd/keto:v0.6.0-alpha.1 works correctly, but in v0.7.x It fail with

keto_1  | time=2021-10-19T12:37:57Z level=info msg=No tracer configured - skipping tracing setup audience=application service_name=ORY Keto service_version=v0.7.0-alpha.0
keto_1  | time=2021-10-19T12:37:57Z level=debug msg=Ignoring migration file 20150100000001000000_networks.sqlite3.down.sql because dialect is not supported: unsupported dialect sqlite3 audience=application service_name=ORY Keto service_version=v0.7.0-alpha.0
keto_1  | time=2021-10-19T12:37:57Z level=debug msg=Ignoring migration file 20150100000001000000_networks.sqlite3.up.sql because dialect is not supported: unsupported dialect sqlite3 audience=application service_name=ORY Keto service_version=v0.7.0-alpha.0
db_1    | 2021-10-19 12:37:57.729 UTC [56] ERROR:  relation "schema_migration" does not exist at character 47
db_1    | 2021-10-19 12:37:57.729 UTC [56] STATEMENT:  SELECT EXISTS (SELECT schema_migration.* FROM schema_migration AS schema_migration WHERE version = $1)
keto_1  | Migrations were not applied yet, please apply them first.cat-videos-example_keto_1 exited with code 255

@zepatrik zepatrik added this to the v0.8.0 milestone Dec 10, 2021
ogomezm added a commit to ogomezm/keto that referenced this issue Dec 22, 2021
Align the docker-compose with the ENTRYPOINT and CMD of the Dockerfile
Use exec form in docker-compose as in the Dockerfile.
ogomezm added a commit to ogomezm/keto that referenced this issue Dec 22, 2021
Use `docker-compose -f docker-compose-postgres.yml up` to test it
@ogomezm
Copy link
Contributor

ogomezm commented Dec 22, 2021

I had the same issue and created a pull request for fixing it.

The issue is related to the ENTRYPONT and the CMD within the Dockerfile, both are using the exec format ["keto"] and ["serve"]. That forces the usage of exec form instead of the bash form into the docker-compose command ["migrate", "up", "-y"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working. good first issue A good issue to tackle when being a novice to the project. help wanted We are looking for help on this one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants