{"record":{"id":"0d801904ebbc94e2","repo":"micro/go-micro","slug":"unknown-provider-s","errorCode":null,"errorMessage":"unknown provider: %s","messagePattern":"unknown provider: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"flow/flow.go","lineNumber":138,"sourceCode":"\n\t// A flow that dispatches to an agent doesn't run its own model — the\n\t// agent is the engine. Otherwise, set up the augmented LLM.\n\tif f.opts.Agent == \"\" {\n\t\tvar modelOpts []ai.Option\n\t\tif f.opts.APIKey != \"\" {\n\t\t\tmodelOpts = append(modelOpts, ai.WithAPIKey(f.opts.APIKey))\n\t\t}\n\t\tif f.opts.Model != \"\" {\n\t\t\tmodelOpts = append(modelOpts, ai.WithModel(f.opts.Model))\n\t\t}\n\t\tif f.opts.BaseURL != \"\" {\n\t\t\tmodelOpts = append(modelOpts, ai.WithBaseURL(f.opts.BaseURL))\n\t\t}\n\t\tmodelOpts = append(modelOpts, ai.WithTools(f.toolSet))\n\n\t\tf.model = ai.New(f.opts.Provider, modelOpts...)\n\t\tif f.model == nil {\n\t\t\treturn fmt.Errorf(\"unknown provider: %s\", f.opts.Provider)\n\t\t}\n\t}\n\n\tif f.opts.TriggerTopic != \"\" {\n\t\tsub, err := br.Subscribe(f.opts.TriggerTopic, func(p broker.Event) error {\n\t\t\tdata := string(p.Message().Body)\n\t\t\tctx := ai.WithRunInfo(context.Background(), ai.RunInfo{Dispatch: \"broker\", Trigger: f.opts.TriggerTopic})\n\t\t\tif err := f.Execute(ctx, data); err != nil {\n\t\t\t\tf.log.Logf(logger.ErrorLevel, \"Flow %s failed: %v\", f.name, err)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"subscribe to %s: %w\", f.opts.TriggerTopic, err)\n\t\t}\n\t\tf.sub = sub\n\t\tf.log.Logf(logger.InfoLevel, \"Flow %s subscribed to %s\", f.name, f.opts.TriggerTopic)\n","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/flow/flow.go#L120-L156","documentation":"During flow Register, the ai.New factory returned nil because the configured Provider name is not recognized by the AI package. The flow has no model and cannot operate, so registration fails immediately with the offending provider string.","triggerScenarios":"Creating a flow with Options.Provider set to a value ai.New does not support (typo like \"open-ai\", unsupported provider like \"mistral\" in this version, or empty casing mismatch).","commonSituations":"Typos in provider names; upgrading/downgrading the library so a provider was added or removed; environment-specific config files pointing at providers not compiled into the build.","solutions":["Check the ai package docs for supported provider strings and fix the Options.Provider value (e.g. \"openai\", \"anthropic\").","Print/inspect the config value feeding f.opts.Provider for typos or trailing whitespace.","Register a custom provider via the ai package's registry if you need a non-builtin provider.","If a provider was removed in a library update, pin the previous version or migrate to a supported one."],"exampleFix":"// before\nf, _ := flow.New(\"myflow\", flow.Provider(\"OpenAI\"))\n// after\nf, _ := flow.New(\"myflow\", flow.Provider(\"openai\"))","handlingStrategy":"validation","validationCode":"supported := map[string]bool{\"openai\": true, \"anthropic\": true}\nif !supported[strings.ToLower(cfg.Provider)] {\n\treturn fmt.Errorf(\"unsupported provider %q; must be one of openai, anthropic\", cfg.Provider)\n}","typeGuard":"func providerKnown(p string) bool { return ai.New(p) != nil }","tryCatchPattern":"if err := f.Register(ctx); err != nil {\n\tvar up *fmt.Errorf\n\tif strings.Contains(err.Error(), \"unknown provider\") {\n\t\tlog.Fatalf(\"fix provider name in config: %v\", err)\n\t}\n\treturn err\n}","preventionTips":["Centralize the provider whitelist and validate config at startup.","Use lowercase canonical provider names everywhere.","Add a config schema/linter that checks provider values against the compiled ai package."],"tags":["flow","ai","provider","configuration"],"backgroundTag":"unknown-provider","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}