ory/kratos · error
unable to find identity schema with id
Error message
unable to find identity schema with id: %s
What it means
FindSchemaByID did a linear scan over the configured identity schemas (Schemas slice) and none of them carried the requested ID. The schema id being looked up - commonly the identity's default schema - is absent from the identity.schemas configuration.
Solutions
- Add an entry with that id to the identity.schemas configuration
- Check for typos or whitespace in the schema id referenced by default_schema or the identity
- Ensure the config file actually loaded (watch for config path mistakes)
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at driver/config/config.go:389 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ory/kratos@b86338da04 (2026-09-07).
Data as JSON: /api/errors/32cba70196c98c05.
Report an issue: GitHub.
Appendix: source
Thrown at driver/config/config.go:389
const HookGlobal = "global"
func HookStrategyKey(key, strategy string) string {
if strategy == HookGlobal {
return fmt.Sprintf("%s.hooks", key)
} else {
return fmt.Sprintf("%s.%s.hooks", key, strategy)
}
}
func (s Schemas) FindSchemaByID(id string) (*Schema, error) {
for _, sc := range s {
if sc.ID == id {
return &sc, nil
}
}
return nil, errors.Errorf("unable to find identity schema with id: %s", id)
}
func MustNew(t testing.TB, l *logrusx.Logger, ctxer contextx.Contextualizer, opts ...configx.OptionModifier) *Config {
p, err := New(t.Context(), l, os.Stderr, ctxer, opts...)
require.NoError(t, err)
return p
}
func New(ctx context.Context, l *logrusx.Logger, stdOutOrErr io.Writer, ctxer contextx.Contextualizer, opts ...configx.OptionModifier) (*Config, error) {
var c *Config
opts = append([]configx.OptionModifier{
configx.WithStderrValidationReporter(),
configx.OmitKeysFromTracing("dsn", "courier.smtp.connection_uri", "secrets.default", "secrets.cookie", "secrets.cipher", "client_secret"),
configx.WithImmutables("serve", "profiling", "log"),
configx.WithExceptImmutables("serve.public.cors.allowed_origins"),
configx.WithLogrusWatcher(l),
configx.WithLogger(l),View on GitHub (pinned to b86338da04)