https://www.ory.sh/ logo
#talk-kratos
Title
# talk-kratos
s

some-planet-21266

01/28/2022, 1:28 AM
hi all, I am getting the following error, when going through the kratos-quickstart.
Copy code
kratos-kratos-migrate-1              | time=2022-01-28T01:24:05Z level=info msg=No tracer configured - skipping tracing setup audience=application service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-migrate-1              | time=2022-01-28T01:24:05Z level=debug msg=Connecting to SQL Database audience=application connMaxLifetime=0s idlePool=6 pool=12 service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-migrate-1              | time=2022-01-28T01:24:05Z level=warning msg=Unable to connect to database, retrying. audience=application error=map[message:unsupported dialect 'sqlite3'] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-migrate-1              | time=2022-01-28T01:24:06Z level=debug msg=Connecting to SQL Database audience=application connMaxLifetime=0s idlePool=6 pool=12 service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-migrate-1              | time=2022-01-28T01:24:06Z level=warning msg=Unable to connect to database, retrying. audience=application error=map[message:unsupported dialect 'sqlite3'] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-1                      | time=2022-01-28T01:24:06Z level=debug msg=Adding config files. func=<http://github.com/ory/x/configx.(*Provider).createProviders|github.com/ory/x/configx.(*Provider).createProviders> file=/go/pkg/mod/github.com/ory/x@v0.0.300/configx/provider.go:154 audience=application files=[/etc/config/kratos/kratos.yml] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-1                      | time=2022-01-28T01:24:06Z level=info msg=No tracer configured - skipping tracing setup func=<http://github.com/ory/x/tracing.(*Tracer).setup|github.com/ory/x/tracing.(*Tracer).setup> file=/go/pkg/mod/github.com/ory/x@v0.0.300/tracing/tracer.go:168 audience=application service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-1                      | time=2022-01-28T01:24:06Z level=debug msg=Connecting to SQL Database func=<http://github.com/ory/kratos/driver.(*RegistryDefault).Init.func1|github.com/ory/kratos/driver.(*RegistryDefault).Init.func1> file=/home/ory/driver/registry_default.go:518 audience=application connMaxLifetime=0s idlePool=6 pool=12 service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-migrate-1              | time=2022-01-28T01:24:06Z level=debug msg=Connecting to SQL Database audience=application connMaxLifetime=0s idlePool=6 pool=12 service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-migrate-1              | time=2022-01-28T01:24:06Z level=warning msg=Unable to connect to database, retrying. audience=application error=map[message:unsupported dialect 'sqlite3'] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-1                      | time=2022-01-28T01:24:07Z level=warning msg=Unable to determine network, retrying. func=<http://github.com/ory/kratos/driver.(*RegistryDefault).Init.func1|github.com/ory/kratos/driver.(*RegistryDefault).Init.func1> file=/home/ory/driver/registry_default.go:565 audience=application error=map[debug: message:sqlite select one: no such table: networks: Unable to locate the table reason: status:Internal Server Error status_code:500 trace:
i tried switching to postgres configuration.
Copy code
docker-compose -f quickstart.yml -f quickstart-postgres.yml up --build --force-recreate
Now, I am getting the following error...
Copy code
kratos-kratos-1                      | time=2022-01-28T07:37:36Z level=debug msg=Adding config files. func=<http://github.com/ory/x/configx.(*Provider).createProviders|github.com/ory/x/configx.(*Provider).createProviders> file=/go/pkg/mod/github.com/ory/x@v0.0.300/configx/provider.go:154 audience=application files=[/etc/config/kratos/kratos.yml] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-1                      |
kratos-kratos-1                      | The configuration contains values or keys which are invalid:
kratos-kratos-1                      | identity.schemas.0: map[id:default url:file:///etc/contrib/quickstart/kratos/email-password/identity.schema.json]
kratos-kratos-1                      |                     ^-- not failed
kratos-kratos-1                      |
kratos-kratos-1                      | time=2022-01-28T07:37:36Z level=fatal msg=Unable to instantiate configuration. func=<http://github.com/ory/kratos/driver.NewWithoutInit|github.com/ory/kratos/driver.NewWithoutInit> file=/home/ory/driver/factory.go:26 audience=application error=map[message:I[#/identity/schemas/0] S[#/properties/identity/properties/schemas/items/not] not failed trace:stack trace could not be recovered from error type *jsonschema.ValidationError] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-1 exited with code 1
kratos-kratos-1                      | time=2022-01-28T07:37:38Z level=debug msg=Adding config files. func=<http://github.com/ory/x/configx.(*Provider).createProviders|github.com/ory/x/configx.(*Provider).createProviders> file=/go/pkg/mod/github.com/ory/x@v0.0.300/configx/provider.go:154 audience=application files=[/etc/config/kratos/kratos.yml] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-1                      |
kratos-kratos-1                      | The configuration contains values or keys which are invalid:
kratos-kratos-1                      | identity.schemas.0: map[id:default url:file:///etc/contrib/quickstart/kratos/email-password/identity.schema.json]
kratos-kratos-1                      |                     ^-- not failed
kratos-kratos-1                      |
kratos-kratos-1                      | time=2022-01-28T07:37:38Z level=fatal msg=Unable to instantiate configuration. func=<http://github.com/ory/kratos/driver.NewWithoutInit|github.com/ory/kratos/driver.NewWithoutInit> file=/home/ory/driver/factory.go:26 audience=application error=map[message:I[#/identity/schemas/0] S[#/properties/identity/properties/schemas/items/not] not failed trace:stack trace could not be recovered from error type *jsonschema.ValidationError] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos.yml
Copy code
version: v0.7.1-alpha.1

dsn: memory

serve:
  public:
    base_url: <http://127.0.0.1:4433/>
    cors:
      enabled: true
  admin:
    base_url: <http://kratos:4434/>

selfservice:
  default_browser_return_url: <http://127.0.0.1:4455/>
  whitelisted_return_urls:
    - <http://127.0.0.1:4455>

  methods:
    password:
      enabled: true

  flows:
    error:
      ui_url: <http://127.0.0.1:4455/error>

    settings:
      ui_url: <http://127.0.0.1:4455/settings>
      privileged_session_max_age: 15m

    recovery:
      enabled: true
      ui_url: <http://127.0.0.1:4455/recovery>

    verification:
      enabled: true
      ui_url: <http://127.0.0.1:4455/verification>
      after:
        default_browser_return_url: <http://127.0.0.1:4455/>

    logout:
      after:
        default_browser_return_url: <http://127.0.0.1:4455/login>

    login:
      ui_url: <http://127.0.0.1:4455/login>
      lifespan: 10m

    registration:
      lifespan: 10m
      ui_url: <http://127.0.0.1:4455/registration>
      after:
        password:
          hooks:
            -
              hook: session

log:
  level: debug
  format: text
  leak_sensitive_values: true

secrets:
  cookie:
    - PLEASE-CHANGE-ME-I-AM-VERY-INSECURE
  cipher:
    - 32-LONG-SECRET-NOT-SECURE-AT-ALL

ciphers:
  algorithm: xchacha20-poly1305

hashers:
  algorithm: bcrypt
  bcrypt:
    cost: 8

identity:
  default_schema_url: file:///etc/contrib/quickstart/kratos/email-password/identity.schema.json
  schemas:
    -
      id: default
      url: file:///etc/contrib/quickstart/kratos/email-password/identity.schema.json

courier:
  smtp:
    connection_uri: <smtps://test:test@mailslurper:1025/?skip_ssl_verify=true>
l

lively-soccer-24145

01/28/2022, 12:59 PM
I think you need to run the migration first ( set migrate to true in the config). The other way will be for you to create all the tables in the database required for kratos.
👍 1
m

magnificent-energy-493

01/28/2022, 3:18 PM
Hm I could not reproduce that and your config looks fine @User.
Did the quickstart work fine otherwise?
s

some-planet-21266

01/28/2022, 3:23 PM
@User are you saying the SQLite QuickStart worked fine?
m

magnificent-energy-493

01/28/2022, 3:25 PM
Yea it worked fine for me just now.
s

some-planet-21266

01/28/2022, 3:29 PM
Hmm. For SQLite the issue I had was related to ‘unsupported dialect sqlite3’
I didnot have any prior docker images download or installed
For Postgres, I see an error related to configuration validation when the service starts up. do you see any issues with my Kratos config? @User
m

magnificent-energy-493

01/28/2022, 3:34 PM
No the config looks fine! I think you can ignore the errors. Does the dashboard load correctly on http://127.0.0.1:4455/welcome after startup?
s

some-planet-21266

01/28/2022, 3:37 PM
Hmm, according to the QuickStart, I need to see a message like
Copy code
kratos_1 | time="2020-01-20T14:52:13Z" level=info msg="Starting the admin httpd on: 0.0.0.0:4434"
kratos_1 | time="2020-01-20T14:52:13Z" level=info msg="Starting the public httpd on: 0.0.0.0:4433"
I did not see any log message like this, so I didnot try checking if the dashboard was working
m

magnificent-energy-493

01/28/2022, 3:49 PM
Copy code
kratos-migrate_1              | Successfully applied SQL migrations!
kratos_kratos-migrate_1 exited with code 0
kratos-selfservice-ui-node_1  | Listening on <http://0.0.0.0:4455>
I see. I get the above output when starting. Maybe the log has changed there, will investigate a bit. Can you check if the dashboard works? On what OS are you?
s

some-planet-21266

01/28/2022, 3:50 PM
I am using macOS
it never worked
there is clearly a problem with the config, that i downloaded using the quick start...
Copy code
kratos-kratos-1                      | time=2022-01-28T17:05:46Z level=debug msg=Adding config files. func=<http://github.com/ory/x/configx.(*Provider).createProviders|github.com/ory/x/configx.(*Provider).createProviders> file=/go/pkg/mod/github.com/ory/x@v0.0.300/configx/provider.go:154 audience=application files=[/etc/config/kratos/kratos.yml] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-1                      |
kratos-kratos-1                      | The configuration contains values or keys which are invalid:
kratos-kratos-1                      | identity: map[default_schema_id:default schemas:[map[id:default schema:file:///etc/config/kratos/identity.schema.json]]]
kratos-kratos-1                      |           ^-- validation failed
kratos-kratos-1                      |
kratos-kratos-1                      | The configuration contains values or keys which are invalid:
kratos-kratos-1                      | identity.default_schema_url: <nil>
kratos-kratos-1                      |                              ^-- one or more required properties are missing
kratos-kratos-1                      |
kratos-kratos-1                      | The configuration contains values or keys which are invalid:
kratos-kratos-1                      | identity.schemas.0: map[id:default schema:file:///etc/config/kratos/identity.schema.json]
kratos-kratos-1                      |                     ^-- validation failed
kratos-kratos-1                      |
kratos-kratos-1                      | The configuration contains values or keys which are invalid:
kratos-kratos-1                      | identity.schemas.0: map[id:default schema:file:///etc/config/kratos/identity.schema.json]
kratos-kratos-1                      |                     ^-- not failed
kratos-kratos-1                      |
kratos-kratos-1                      | The configuration contains values or keys which are invalid:
kratos-kratos-1                      | identity.schemas.0.url: <nil>
kratos-kratos-1                      |                         ^-- one or more required properties are missing
kratos-kratos-1                      |
kratos-kratos-1                      | The configuration contains values or keys which are invalid:
kratos-kratos-1                      | identity: map[default_schema_id:default schemas:[map[id:default schema:file:///etc/config/kratos/identity.schema.json]]]
kratos-kratos-1                      |           ^-- additionalProperties "default_schema_id" not allowed
kratos-kratos-1                      |
kratos-kratos-1                      | time=2022-01-28T17:05:46Z level=fatal msg=Unable to instantiate configuration. func=<http://github.com/ory/kratos/driver.NewWithoutInit|github.com/ory/kratos/driver.NewWithoutInit> file=/home/ory/driver/factory.go:26 audience=application error=map[message:I[#/identity] S[#/properties/identity] validation failed
kratos-kratos-1                      |   I[#/identity] S[#/properties/identity/required] missing properties: "default_schema_url"
kratos-kratos-1                      |   I[#/identity/schemas/0] S[#/properties/identity/properties/schemas/items] validation failed
kratos-kratos-1                      |     I[#/identity/schemas/0] S[#/properties/identity/properties/schemas/items/not] not failed
kratos-kratos-1                      |     I[#/identity/schemas/0] S[#/properties/identity/properties/schemas/items/required] missing properties: "url"
kratos-kratos-1                      |   I[#/identity] S[#/properties/identity/additionalProperties] additionalProperties "default_schema_id" not allowed trace:stack trace could not be recovered from error type *jsonschema.ValidationError] service_name=Ory Kratos service_version=v0.8.0-alpha.3
kratos-kratos-1 exited with code 1
m

magnificent-energy-493

01/28/2022, 5:08 PM
are you on the correct branch?
v0.8.0-alpha.3
Hm there seems to be a problem with the config after all. This is my working kratos.yml
Copy code
version: v0.7.1-alpha.1

dsn: memory

serve:
  public:
    base_url: <http://127.0.0.1:4433/>
    cors:
      enabled: true
  admin:
    base_url: <http://kratos:4434/>

selfservice:
  default_browser_return_url: <http://127.0.0.1:4455/>
  whitelisted_return_urls:
    - <http://127.0.0.1:4455>

  methods:
    password:
      enabled: true

  flows:
    error:
      ui_url: <http://127.0.0.1:4455/error>

    settings:
      ui_url: <http://127.0.0.1:4455/settings>
      privileged_session_max_age: 15m

    recovery:
      enabled: true
      ui_url: <http://127.0.0.1:4455/recovery>

    verification:
      enabled: true
      ui_url: <http://127.0.0.1:4455/verification>
      after:
        default_browser_return_url: <http://127.0.0.1:4455/>

    logout:
      after:
        default_browser_return_url: <http://127.0.0.1:4455/login>

    login:
      ui_url: <http://127.0.0.1:4455/login>
      lifespan: 10m

    registration:
      lifespan: 10m
      ui_url: <http://127.0.0.1:4455/registration>
      after:
        password:
          hooks:
            -
              hook: session

log:
  level: debug
  format: text
  leak_sensitive_values: true

secrets:
  cookie:
    - PLEASE-CHANGE-ME-I-AM-VERY-INSECURE
  cipher:
    - 32-LONG-SECRET-NOT-SECURE-AT-ALL

ciphers:
  algorithm: xchacha20-poly1305

hashers:
  argon2:
    parallelism: 1
    memory: 128MB
    iterations: 2
    salt_length: 16
    key_length: 16

identity:
  default_schema_url: file:///etc/config/kratos/identity.schema.json

courier:
  smtp:
    connection_uri: <smtps://test:test@mailslurper:1025/?skip_ssl_verify=true>
s

some-planet-21266

01/28/2022, 5:12 PM
Let me use this config and I believe I am on branch
v0.8
I am not on
v0.8.0-alpha.3
Let me fix that and use the config you have given
m

magnificent-energy-493

01/28/2022, 5:15 PM
ok 🙂
where did you find the other config btw? on the older branch maybe?
for some minor releases the quickstart is not working correctly I believe, best use the branch as specified here: https://www.ory.sh/kratos/docs/next/quickstart/#clone-ory-kratos-and-run-it-in-docker
s

some-planet-21266

01/28/2022, 5:17 PM
The branch 0.8 was in available in remote/origin Commit hash => 1ba5a1a Looks it's relatively a new commit campared to the alpha one
message has been deleted
This is the branch. I was using
@User: Thanks it worked fine now!! sorry for the confusion!
m

magnificent-energy-493

01/29/2022, 4:05 AM
No problem 🙂 Glad you got it working, let me know how it goes!
235 Views