{"record":{"id":"18e5aad6156c844a","repo":"t8y2/dbx","slug":"unsupported-auth-scheme-q-expected-q-or-q","errorCode":null,"errorMessage":"Unsupported auth_scheme %q; expected %q or %q","messagePattern":"Unsupported auth_scheme %q; expected %q or %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/zookeeper/connection.go","lineNumber":154,"sourceCode":"}\n\nfunc (service *server) connectionInfo() (map[string]any, error) {\n\tif _, err := service.requireClient(); err != nil {\n\t\treturn nil, err\n\t}\n\tresult := map[string]any{}\n\tif info := databaseInfo(service.activeConfig); info != nil {\n\t\tresult[\"databaseInfo\"] = info\n\t}\n\treturn result, nil\n}\n\nfunc openClient(config connectionConfig) (*clientSession, error) {\n\tif hasTLSOptions(config) {\n\t\treturn nil, errors.New(\"ZooKeeper TLS is not supported\")\n\t}\n\tauthScheme := resolveAuthScheme(config)\n\tif authScheme != defaultAuthScheme && authScheme != saslDigestAuthScheme {\n\t\treturn nil, fmt.Errorf(\"Unsupported auth_scheme %q; expected %q or %q\", authScheme, defaultAuthScheme, saslDigestAuthScheme)\n\t}\n\tif authScheme == saslDigestAuthScheme {\n\t\tif strings.TrimSpace(config.Username) == \"\" {\n\t\t\treturn nil, errors.New(`username is required when auth_scheme = \"sasl_digest\"`)\n\t\t}\n\t\tif config.Password == \"\" {\n\t\t\treturn nil, errors.New(`password is required when auth_scheme = \"sasl_digest\"`)\n\t\t}\n\t}\n\tif config.BaseSleepTimeMS != nil && *config.BaseSleepTimeMS < 0 {\n\t\treturn nil, errors.New(\"base_sleep_time_ms must be non-negative\")\n\t}\n\tif config.MaxRetries != nil && *config.MaxRetries < 0 {\n\t\treturn nil, errors.New(\"max_retries must be non-negative\")\n\t}\n\tmaxBufferSize, err := resolveMaxBufferSize(config)\n\tif err != nil {","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/zookeeper/connection.go#L136-L172","documentation":"openClient validates auth_scheme after resolving it; only the default scheme and sasl_digest are supported. Any other value produces this formatted error naming the rejected scheme and the two accepted values.","triggerScenarios":"connectionConfig.AuthScheme resolves (via resolveAuthScheme) to something other than defaultAuthScheme or saslDigestAuthScheme — e.g. a typo like \"sasl-digest\" or an unsupported value like \"digest\" or \"kerberos\".","commonSituations":"Typo in auth_scheme in a connection file; copying a Kerberos/GSSAPI config from another ZooKeeper client; case-sensitivity mistakes in the scheme string.","solutions":["Set auth_scheme to the default scheme or exactly \"sasl_digest\"","Fix typos/spacing/case in the auth_scheme value","Remove auth_scheme entirely to use the default scheme","Verify the scheme against the driver's supported constants in the docs"],"exampleFix":"// before\ncfg := connectionConfig{AuthScheme: \"sasl-digest\"} // wrong separator\n// after\ncfg := connectionConfig{AuthScheme: \"sasl_digest\"}","handlingStrategy":"validation","validationCode":"switch cfg.AuthScheme {\ncase \"\", defaultAuthScheme, saslDigestAuthScheme:\n    // ok\ndefault:\n    return fmt.Errorf(\"auth_scheme %q unsupported; use %q or %q\", cfg.AuthScheme, defaultAuthScheme, saslDigestAuthScheme)\n}","typeGuard":null,"tryCatchPattern":"_, err := openClient(cfg)\nif err != nil && strings.HasPrefix(err.Error(), \"Unsupported auth_scheme\") {\n    return fmt.Errorf(\"fix auth_scheme in config: %w\", err)\n}","preventionTips":["Use the driver's exported constants instead of raw strings for auth_scheme","Add a config schema/enum check at load time","Watch for separators: it is \"sasl_digest\" (underscore), not \"sasl-digest\"","Validate connection configs in CI before deployment"],"tags":["zookeeper","authentication","configuration","validation"],"backgroundTag":"unsupported-auth-scheme","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}