{"record":{"id":"c828c4d56affaed9","repo":"Tencent/WeKnora","slug":"doris-connection-requires-addr-host-port","errorCode":null,"errorMessage":"doris connection requires addr (host:port)","messagePattern":"doris connection requires addr \\(host:port\\)","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"internal/container/engine_factory.go","lineNumber":333,"sourceCode":"\tclient, err := weaviate.NewClient(weaviateCfg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create weaviate client: %w\", err)\n\t}\n\trepo := weaviateRepo.NewWeaviateRetrieveEngineRepository(client, &store.IndexConfig)\n\treturn retriever.NewKVHybridRetrieveEngine(repo, types.WeaviateRetrieverEngineType), nil\n}\n\n// createDorisEngine 创建 Apache Doris 检索引擎服务。\n//\n// Doris 同时使用两个端口：\n//   - MySQL 协议（默认 9030）走 database/sql 做主链路读写；\n//   - HTTP（默认 FE 8030）走 Stream Load 做 partial update。\n//\n// Addr 字段承担 host:9030 的 MySQL 端点；HTTPPort + Addr 的 host 部分组成 HTTP base URL。\nfunc createDorisEngine(store types.VectorStore) (interfaces.RetrieveEngineService, error) {\n\tcc := store.ConnectionConfig\n\tif cc.Addr == \"\" {\n\t\treturn nil, fmt.Errorf(\"doris connection requires addr (host:port)\")\n\t}\n\tif cc.Database == \"\" {\n\t\treturn nil, fmt.Errorf(\"doris connection requires database\")\n\t}\n\n\tmc := mysql.NewConfig()\n\tmc.User = cc.Username\n\tmc.Passwd = cc.Password\n\tutils.RegisterMySQLSSRFDialer()\n\tmc.Net = utils.MySQLSSRFNetwork\n\tmc.Addr = cc.Addr\n\tmc.DBName = cc.Database\n\tmc.Params = map[string]string{\"charset\": \"utf8mb4\"}\n\tmc.ParseTime = true\n\tmc.Loc = time.Local\n\tdb, err := sql.Open(\"mysql\", mc.FormatDSN())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create doris client: %w\", err)","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/container/engine_factory.go#L315-L351","documentation":"A guard error from createDorisEngine: the Apache Doris connection requires ConnectionConfig.Addr to carry the FE MySQL-protocol endpoint in host:port form (default FE query port 9030). When Addr is empty the engine cannot build the MySQL DSN, so it fails fast with this message.","triggerScenarios":"Configuring a Doris vector store without setting cc.Addr — e.g. only HTTPPort or Database provided — then creating the engine via createEngineServiceFromStore.","commonSituations":"Users copying a MySQL/other store config that uses separate host+port fields instead of Addr; empty DORIS_ADDR env var; assuming the HTTP port (8030) config alone is sufficient.","solutions":["Set ConnectionConfig.Addr to \"<fe-host>:9030\" (the Doris FE MySQL query port)","Load the value from a correct env var and fail fast at startup if empty","Do not confuse Addr with the HTTP Stream Load endpoint (HTTPPort 8030); both are needed","Add a config lint/test that asserts Addr is non-empty for Doris stores"],"exampleFix":"// before\ncc := types.ConnectionConfig{HTTPPort: 8030, Database: \"doris_db\"}\n// after\ncc := types.ConnectionConfig{Addr: \"fe.example.com:9030\", HTTPPort: 8030, Database: \"doris_db\"}","handlingStrategy":"validation","validationCode":"func validateDorisConfig(cc types.ConnectionConfig) error {\n    if cc.Addr == \"\" { return errors.New(\"doris addr (host:port) required, e.g. fe:9030\") }\n    if _, _, err := net.SplitHostPort(cc.Addr); err != nil { return fmt.Errorf(\"doris addr must be host:port: %w\", err) }\n    return nil\n}","typeGuard":"func dorisAddrSet(cc types.ConnectionConfig) bool { _, _, err := net.SplitHostPort(cc.Addr); return cc.Addr != \"\" && err == nil }","tryCatchPattern":"engine, err := createEngineServiceFromStore(ctx, store)\nif err != nil && strings.Contains(err.Error(), \"requires addr\") {\n    return fmt.Errorf(\"set Doris FE MySQL endpoint as ConnectionConfig.Addr (host:9030): %w\", err)\n}","preventionTips":["Treat Addr as the MySQL FE endpoint (host:9030) and HTTPPort (8030) as a separate required field","Validate all required Doris fields at config load, before engine creation","Document required env vars and add a startup config dump (redacted)","Add unit tests asserting Doris config completeness"],"tags":["doris","config-validation","missing-config"],"backgroundTag":"missing-required-config-field","analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}