Can someone please shed a light, (Related to ory-...
# ory-selfhosting
c
Can someone please shed a light, (Related to ory-kratos) I am getting following error, when I add Phone number to identity schema with recovery and verfication via
sms
, is this expected or documentation isn't clear? PFA - schema, schema is copied from kratos documentation - link fyi: @magnificent-energy-493 @high-optician-2097 @fast-lunch-54279
Copy code
| I[#] S[#/allOf/1] allOf failed
                      |   I[#/properties/traits/properties/phone] S[#/allOf/1/properties/properties/properties/traits/properties/properties/patternProperties/.%2A/allOf/0] allOf failed
                      |     I[#/properties/traits/properties/phone] S[#/allOf/1/properties/properties/properties/traits/properties/properties/patternProperties/.%2A/allOf/0/$ref] doesn't validate with "<ory://identity-extension#>"
                      |       I[#/properties/traits/properties/phone] S[#/allOf/0] allOf failed
                      |         I[#/properties/traits/properties/phone/ory.sh~1kratos/recovery/via] S[#/allOf/0/properties/ory.sh~1kratos/properties/recovery/properties/via/enum] value must be "email"
 exited with code 1
                      | time=2024-12-20T05:25:48Z level=debug msg=Adding config files. func=github.com/ory/x/configx.(*Provider).createProviders file=/go/pkg/mod/github.com/ory/x@v0.0.660/configx/provider.go:144 audience=application files=[/etc/config/kratos/kratos.yml] service_name=Ory Kratos service_version=v1.3.1
                      | 
                      | The configuration contains values or keys which are invalid:
                      | The configuration contains values or keys which are invalid:
                      | properties.traits.properties.phone: map[format:tel minLength:3 ory.sh/kratos:map[credentials:map[code:map[identifier:true via:sms] passkey:map[display_name:true] password:map[identifier:true] totp:map[account_name:true]] recovery:map[via:sms] verification:map[via:sms]] title:Phone type:string]
                      |                                     ^-- allOf failed
                      | 
                      | The configuration contains values or keys which are invalid:
                      | properties.traits.properties.phone: map[format:tel minLength:3 ory.sh/kratos:map[credentials:map[code:map[identifier:true via:sms] passkey:map[display_name:true] password:map[identifier:true] totp:map[account_name:true]] recovery:map[via:sms] verification:map[via:sms]] title:Phone type:string]
                      |                                     ^-- doesn't validate with "<ory://identity-extension#>"
                      | 
                      | The configuration contains values or keys which are invalid:
                      | properties.traits.properties.phone: map[format:tel minLength:3 ory.sh/kratos:map[credentials:map[code:map[identifier:true via:sms] passkey:map[display_name:true] password:map[identifier:true] totp:map[account_name:true]] recovery:map[via:sms] verification:map[via:sms]] title:Phone type:string]
                      |                                     ^-- allOf failed
                      | 
                      | The configuration contains values or keys which are invalid:
                      | properties.traits.properties.phone.ory\.sh/kratos.recovery.via: sms
                      |                                                                 ^-- value must be "email"
Copy code
"recovery": {
              "via": "sms"
            },
recovery via "sms" is causing the problem
m
Oh thanks for pointing that out! There is probably either a mismatch between versions or the schema is just outdated 😬 There are plans to add some tests to this part of documentation.
c
@magnificent-energy-493 I am running this on latest version(1.3.1) by checking out the kratos github repo and in
quickstart.yml
all images are pointing to 1.3.1, could you please point out what could be mismatch here? PFA
Copy code
version: '3.7'
services:
  kratos-migrate:
    image: oryd/kratos:v1.3.1
    environment:
      - DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true&mode=rwc
    volumes:
      - type: volume
        source: kratos-sqlite
        target: /var/lib/sqlite
        read_only: false
      - type: bind
        source: ./contrib/quickstart/kratos/email-password
        target: /etc/config/kratos
    command: -c /etc/config/kratos/kratos.yml migrate sql -e --yes
    restart: on-failure
    networks:
      - intranet
  kratos-selfservice-ui-node:
    image: oryd/kratos-selfservice-ui-node:v1.3.1
    environment:
      - KRATOS_PUBLIC_URL=<http://kratos:4433/>
      - KRATOS_BROWSER_URL=<http://127.0.0.1:4433/>
      - COOKIE_SECRET=changeme
      - CSRF_COOKIE_NAME=ory_csrf_ui
      - CSRF_COOKIE_SECRET=changeme
    networks:
      - intranet
    restart: on-failure
  kratos:
    depends_on:
      - kratos-migrate
    image: oryd/kratos:v1.3.1
    ports:
      - '4433:4433' # public
      - '4434:4434' # admin
    restart: unless-stopped
    environment:
      - DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true
      - LOG_LEVEL=trace
    command: serve -c /etc/config/kratos/kratos.yml --dev --watch-courier
    volumes:
      - type: volume
        source: kratos-sqlite
        target: /var/lib/sqlite
        read_only: false
      - type: bind
        source: ./contrib/quickstart/kratos/email-password
        target: /etc/config/kratos
    networks:
      - intranet
  mailslurper:
    image: oryd/mailslurper:latest-smtps
    ports:
      - '4436:4436'
      - '4437:4437'
    networks:
      - intranet
networks:
  intranet:
volumes:
  kratos-sqlite:
I opened the issue for the same - https://github.com/ory/kratos/issues/4262