{"record":{"id":"1ade2ef62ccaf81f","repo":"t8y2/dbx","slug":"no-etcd-endpoint-configured","errorCode":null,"errorMessage":"No etcd endpoint configured","messagePattern":"No etcd endpoint configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"agents/drivers/etcd-go/client.go","lineNumber":333,"sourceCode":"\tvar lastFailure error\n\tfor _, endpoint := range endpoints {\n\t\tctx, cancel := context.WithTimeout(context.Background(), rpcTimeoutSeconds*time.Second)\n\t\t_, err := client.Maintenance.Status(ctx, endpoint)\n\t\tcancel()\n\t\tif err == nil {\n\t\t\treturn map[string]any{\"ok\": true, \"endpoint\": endpoint}, nil\n\t\t}\n\t\t// A restricted etcd user may not be allowed to call Maintenance.Status.\n\t\t// PERMISSION_DENIED still proves that the channel reached an etcd server.\n\t\tif status.Code(err) == codes.PermissionDenied {\n\t\t\treturn map[string]any{\"ok\": true, \"endpoint\": endpoint, \"limited\": true}, nil\n\t\t}\n\t\tlastFailure = err\n\t}\n\tif lastFailure != nil {\n\t\treturn nil, lastFailure\n\t}\n\treturn nil, errors.New(\"No etcd endpoint configured\")\n}\n\nfunc connectionEndpoints(connection connectionParams) []string {\n\tconfigured := firstNonBlank(connection.EtcdEndpoints, connection.Endpoints, connection.ConnectionString)\n\tvar result []string\n\tif configured != \"\" {\n\t\tfor _, endpoint := range strings.FieldsFunc(configured, func(r rune) bool { return r == ',' || r == '\\n' }) {\n\t\t\tnormalized := normalizeEndpoint(strings.TrimSpace(endpoint), connection.SSL)\n\t\t\tif normalized != \"\" {\n\t\t\t\tresult = append(result, normalized)\n\t\t\t}\n\t\t}\n\t}\n\tif len(result) == 0 {\n\t\thost := connection.Host\n\t\tif host == \"\" {\n\t\t\thost = \"127.0.0.1\"\n\t\t}","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/etcd-go/client.go#L315-L351","documentation":"probeClient returns this error when it exhausted all configured endpoints without recording a failure — which only happens when the endpoint list was empty to begin with. The library refuses to dial etcd with zero endpoints, so an empty or unparsable endpoint configuration surfaces here from connect or validateConnection.","triggerScenarios":"connectionEndpoints finds no value in EtcdEndpoints, Endpoints, or ConnectionString (all blank), so probeClient iterates zero endpoints and falls through to this error; also reached if every attempt returned nil but lastFailure logic ran on an empty list.","commonSituations":"Missing ETCD_ENDPOINTS environment variable; empty connection string in config file; whitespace-only endpoint value; config struct built programmatically without setting endpoints.","solutions":["Set the etcd endpoints (e.g. ETCD_ENDPOINTS=http://127.0.0.1:2379) in the connection config.","Check that ConnectionString or Endpoints fields are populated if not using EtcdEndpoints.","Verify the config file/env is actually loaded (no silent defaults overriding).","Then confirm the endpoints are reachable, since empty vs. unreachable produce different errors."],"exampleFix":"// before\nconnection := connectionParams{} // no endpoints\nclient, err := connect(connection) // No etcd endpoint configured\n// after\nconnection := connectionParams{EtcdEndpoints: \"http://127.0.0.1:2379\"}\nclient, err := connect(connection)","handlingStrategy":"validation","validationCode":"eps := connectionEndpoints(conn)\nif len(eps) == 0 {\n\treturn errors.New(\"no etcd endpoints: set EtcdEndpoints, Endpoints, or ConnectionString\")\n}\nfor _, ep := range eps {\n\tif u, err := url.Parse(ep); err != nil || u.Host == \"\" {\n\t\treturn fmt.Errorf(\"invalid etcd endpoint %q\", ep)\n\t}\n}","typeGuard":"func hasEndpoints(conn connectionParams) bool {\n\treturn firstNonBlank(conn.EtcdEndpoints, conn.Endpoints, conn.ConnectionString) != \"\"\n}","tryCatchPattern":"client, err := connect(conn)\nif err != nil {\n\tif strings.Contains(err.Error(), \"No etcd endpoint configured\") {\n\t\treturn nil, fmt.Errorf(\"etcd endpoints missing: set ETCD_ENDPOINTS (e.g. http://127.0.0.1:2379): %w\", err)\n\t}\n\treturn nil, err\n}","preventionTips":["Set ETCD_ENDPOINTS (or the connection string) in every environment/deployment.","Fail fast at startup by calling validateConnection before serving requests.","Log the resolved endpoint list at startup to catch silent empty configs.","Use a config library with required-field validation instead of blank defaults."],"tags":["etcd","configuration","endpoints","missing-config"],"backgroundTag":"missing-endpoint-configuration","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}