{"record":{"id":"34dff0ff83dc9c77","repo":"apache/pulsar","slug":"unknown-auth-provider-s","errorCode":null,"errorMessage":"unknown auth provider: %s","messagePattern":"unknown auth provider: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pulsar-function-go/pf/instance.go","lineNumber":231,"sourceCode":"\t\tTLSValidateHostname:        ic.tlsHostnameVerification,\n\t}\n\n\tswitch ic.authPlugin {\n\tcase authPluginToken:\n\t\tswitch {\n\t\tcase strings.HasPrefix(ic.authParams, \"file://\"):\n\t\t\tclientOpts.Authentication = pulsar.NewAuthenticationTokenFromFile(ic.authParams[7:])\n\t\tcase strings.HasPrefix(ic.authParams, \"token:\"):\n\t\t\tclientOpts.Authentication = pulsar.NewAuthenticationToken(ic.authParams[6:])\n\t\tcase ic.authParams == \"\":\n\t\t\treturn fmt.Errorf(\"auth plugin %s given, but authParams is empty\", authPluginToken)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(`unknown token format - expecting \"file://\" or \"token:\" prefix`)\n\t\t}\n\tcase authPluginNone:\n\t\tclientOpts.Authentication, _ = pulsar.NewAuthentication(\"\", \"\") // ret: auth.NewAuthDisabled()\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown auth provider: %s\", ic.authPlugin)\n\t}\n\n\tclient, err := pulsar.NewClient(clientOpts)\n\tif err != nil {\n\t\tlog.Errorf(\"create client error:%v\", err)\n\t\tgi.stats.incrTotalSysExceptions(err)\n\t\treturn err\n\t}\n\tgi.client = client\n\treturn nil\n}\n\nfunc (gi *goInstance) setupProducer() error {\n\tif gi.context.instanceConf.funcDetails.Sink.Topic != \"\" && len(gi.context.instanceConf.funcDetails.Sink.Topic) > 0 {\n\t\tlog.Debugf(\"Setting up producer for topic %s\", gi.context.instanceConf.funcDetails.Sink.Topic)\n\t\tproducer, err := gi.getProducer(gi.context.instanceConf.funcDetails.Sink.Topic)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Failed to create producer: %v\", err)","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-function-go/pf/instance.go#L213-L249","documentation":"setupClient only recognizes authPluginToken and authPluginNone. Any other AuthenticationPlugin value reaches the default branch and returns this error naming the unknown provider, preventing client creation.","triggerScenarios":"Setting AuthenticationPlugin to a plugin name not supported by pulsar-function-go (e.g. an OAuth2 or SASL plugin identifier accepted by the Java client but not here, or a typo like \"tokon\").","commonSituations":"Porting function configs from Java/Python function workers; typos in the plugin name; assuming parity of auth plugins across Pulsar clients.","solutions":["Use the supported token plugin or the none plugin for the function's Go instance.","Implement OAuth2 separately if needed, or file/track upstream support for the plugin.","Correct any typo in the plugin name in the function config."],"exampleFix":"// before\n--auth_plugin org.apache.pulsar.client.impl.auth.AuthenticationToken // unknown provider\n// after\n--auth_plugin auth.AuthenticationToken","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"token\": true, \"none\": true, \"\": true}\nif !allowed[authPlugin] {\n    return fmt.Errorf(\"unsupported auth plugin for Go functions: %s\", authPlugin)\n}","typeGuard":null,"tryCatchPattern":"if err := runInstance(); err != nil && strings.HasPrefix(err.Error(), \"unknown auth provider\") {\n    log.Fatalf(\"use the token or none auth plugin for Go functions, got: %v\", err)\n}","preventionTips":["Only use auth plugins supported by pulsar-function-go (token, none).","Don't copy Java/Python function auth plugin identifiers into Go function configs.","Keep an allowlist of plugin names in deployment tooling."],"tags":["go","authentication","configuration","unsupported-feature"],"backgroundTag":"unknown-auth-provider","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}