{"record":{"id":"a5d21fe997314b79","repo":"gastownhall/beads","slug":"externaldoltconfig-socket-q-is-not-absolute","errorCode":null,"errorMessage":"ExternalDoltConfig: Socket %q is not absolute","messagePattern":"ExternalDoltConfig: Socket %q is not absolute","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/configfile/external_dolt_config.go","lineNumber":60,"sourceCode":"\thasSocket := c.Socket != \"\"\n\n\tswitch {\n\tcase hasSocket && (hasHost || hasPort):\n\t\treturn errors.New(\"ExternalDoltConfig: set either Socket OR (Host, Port), not both\")\n\tcase !hasSocket && !hasHost && !hasPort:\n\t\treturn errors.New(\"ExternalDoltConfig: must set Socket or (Host, Port)\")\n\tcase hasHost && !hasPort:\n\t\treturn errors.New(\"ExternalDoltConfig: Host requires Port\")\n\tcase !hasHost && hasPort:\n\t\treturn errors.New(\"ExternalDoltConfig: Port requires Host\")\n\t}\n\n\tif hasHost && (c.Port < 1 || c.Port > 65535) {\n\t\treturn fmt.Errorf(\"ExternalDoltConfig: Port %d out of range [1, 65535]\", c.Port)\n\t}\n\n\tif hasSocket && !filepath.IsAbs(c.Socket) {\n\t\treturn fmt.Errorf(\"ExternalDoltConfig: Socket %q is not absolute\", c.Socket)\n\t}\n\n\tswitch {\n\tcase c.TLSCert != \"\" && c.TLSKey == \"\":\n\t\treturn errors.New(\"ExternalDoltConfig: TLSCert set without TLSKey\")\n\tcase c.TLSCert == \"\" && c.TLSKey != \"\":\n\t\treturn errors.New(\"ExternalDoltConfig: TLSKey set without TLSCert\")\n\t}\n\n\tif c.TLSCert != \"\" && !filepath.IsAbs(c.TLSCert) {\n\t\treturn fmt.Errorf(\"ExternalDoltConfig: TLSCert %q is not absolute\", c.TLSCert)\n\t}\n\tif c.TLSKey != \"\" && !filepath.IsAbs(c.TLSKey) {\n\t\treturn fmt.Errorf(\"ExternalDoltConfig: TLSKey %q is not absolute\", c.TLSKey)\n\t}\n\tif c.TLSCACert != \"\" && !filepath.IsAbs(c.TLSCACert) {\n\t\treturn fmt.Errorf(\"ExternalDoltConfig: TLSCACert %q is not absolute\", c.TLSCACert)\n\t}","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/configfile/external_dolt_config.go#L42-L78","documentation":"ExternalDoltConfig.Validate rejects a Socket path that is not an absolute filesystem path. The external Dolt server connection uses unix domain sockets, which the Go MySQL driver can only dial via an absolute path; a relative path would resolve unpredictably depending on the process working directory. Validate is invoked when constructing the external Dolt server client, so this fails fast at configuration load time.","triggerScenarios":"Calling NewExternalDoltServer, NewExternalDoltServerUOWProvider, or buildProxiedServerClientInfo with ExternalDoltConfig.Socket set to a relative path (e.g. \"dolt.sock\" or \"./run/dolt.sock\") while Host is unset. Any config file or env-derived value like \"$HOME/...\" left unexpanded also triggers it.","commonSituations":"Hand-writing a config with a relative socket path; using an environment variable (e.g. $DOLT_SOCKET) that is empty or relative; copying a config between machines where the socket lives in a different absolute location.","solutions":["Set Socket to an absolute path, e.g. \"/run/dolt/dolt.sock\" or an expanded \"$HOME/.dolt/dolt.sock\".","In a shell-launched config, expand variables before use: use $(echo $HOME)/.dolt/dolt.sock or the expanded literal path.","If you meant a TCP connection, remove Socket and set Host/Port instead."],"exampleFix":"// before\nsocket: \"dolt.sock\"\n// after\nsocket: \"/run/user/1000/dolt/dolt.sock\"","handlingStrategy":"validation","validationCode":"func validSocket(cfg configfile.ExternalDoltConfig) error {\n    if cfg.Socket != \"\" && !filepath.IsAbs(cfg.Socket) {\n        abs, err := filepath.Abs(cfg.Socket)\n        if err != nil {\n            return err\n        }\n        cfg.Socket = abs\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always store socket paths as absolute paths in config files","Expand ~ and $VARS before persisting config values","Prefer Host/Port for TCP instead of Socket when unsure","Run bd config validation early at startup, not at first connection"],"tags":["config","validation","unix-socket","path"],"backgroundTag":"invalid-config-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}