{"record":{"id":"668ecfda2bacb4d7","repo":"ory/kratos","slug":"unknown-courier-channel-type-s","errorCode":null,"errorMessage":"unknown courier channel type: %s","messagePattern":"unknown courier channel type: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"courier/courier_dispatcher.go","lineNumber":39,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, channel := range cs {\n\t\tif channel.ID != id {\n\t\t\tcontinue\n\t\t}\n\t\tswitch channel.Type {\n\t\tcase \"smtp\":\n\t\t\tcourierChannel, err := NewSMTPChannelWithCustomTemplates(c.deps, channel.SMTPConfig, c.newEmailTemplateFromMessage)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn courierChannel, nil\n\t\tcase \"http\":\n\t\t\treturn newHttpChannel(channel.ID, &channel.RequestConfig, c.deps), nil\n\t\tdefault:\n\t\t\treturn nil, errors.Errorf(\"unknown courier channel type: %s\", channel.Type)\n\t\t}\n\t}\n\n\treturn nil, errors.Errorf(\"no courier channels configured for: %s\", id)\n}\n\nfunc (c *courier) DispatchMessage(ctx context.Context, msg Message) (err error) {\n\tctx, span := c.deps.Tracer(ctx).Tracer().Start(ctx, \"courier.DispatchMessage\", trace.WithAttributes(\n\t\tattribute.Stringer(\"message.id\", msg.ID),\n\t\tattribute.Stringer(\"message.nid\", msg.NID),\n\t\tattribute.Stringer(\"message.type\", msg.Type),\n\t\tattribute.String(\"message.template_type\", string(msg.TemplateType)),\n\t\tattribute.Int(\"message.send_count\", msg.SendCount),\n\t))\n\tdefer otelx.End(span, &err)\n\tctx = semconv.ContextWithAttributes(ctx, semconv.AttrNID(msg.NID))\n\n\tlogger := c.deps.Logger().","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/ory/kratos/blob/b86338da04a040247a07f46100a86dcfb3875909/courier/courier_dispatcher.go#L21-L57","documentation":"The courier dispatcher resolves a configured channel by ID, switching on channel.Type. Only sms, email (implied cases) and \"http\" are supported; any other type string makes the channels method return this error. It signals an invalid channel type in the courier configuration.","triggerScenarios":"Courier config contains a channel whose type is not one of the recognized values (e.g. type: webhook or a typo like htpp/smss), and a message is dispatched to that channel ID.","commonSituations":"Typos in the YAML/JSON config channel type, copying config snippets from newer/older versions where a channel type was added or removed, or inventing a custom type expecting generic HTTP behavior.","solutions":["Set the channel type to a supported value: sms, email, or http.","Fix typos in the courier config's channels[].type field.","Check the docs/version for the exact set of supported channel types in your release.","Validate the config before startup to catch the bad type early."],"exampleFix":"// before (config.yaml)\ncourier:\n  channels:\n    - id: sms\n      type: smss\n// after\ncourier:\n  channels:\n    - id: sms\n      type: http\n      request_config: {...}","handlingStrategy":"validation","validationCode":"supported := map[string]bool{\"sms\": true, \"email\": true, \"http\": true}\nfor _, ch := range cfg.Courier.Channels {\n    if !supported[ch.Type] {\n        return fmt.Errorf(\"channel %q has unsupported type %q\", ch.ID, ch.Type)\n    }\n}","typeGuard":"func isSupportedChannelType(t string) bool {\n    switch t { case \"sms\", \"email\", \"http\": return true }\n    return false\n}","tryCatchPattern":"if err := courier.DispatchMessage(ctx, msg); err != nil {\n    if strings.Contains(err.Error(), \"unknown courier channel type\") {\n        log.Printf(\"config error: %v\", err) // fix courier.channels types\n        return nil // or dead-letter the message\n    }\n    return err\n}","preventionTips":["Validate courier config against the JSON schema at startup","Only use channel types documented for your release","Lint config files in CI to catch typos like smss/htpp"],"tags":["courier","config","channel-type","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"b86338da04a040247a07f46100a86dcfb3875909","analyzedAt":"2026-09-07T15:58:15.934Z","contentChangedAt":"2026-09-07T15:58:15.934Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}