{"record":{"id":"fafbab10ac77a550","repo":"router-for-me/CLIProxyAPI","slug":"home-invalid-address-host-q-port-d","errorCode":null,"errorMessage":"home: invalid address (host=%q port=%d)","messagePattern":"home: invalid address \\(host=%q port=(.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/home/client.go","lineNumber":494,"sourceCode":"\tif c == nil {\n\t\treturn ErrDisabled\n\t}\n\tif c.dispatchFenced.Load() {\n\t\treturn ErrDispatchFenced\n\t}\n\tif !c.Enabled() {\n\t\treturn ErrDisabled\n\t}\n\tc.waitForClientsClosed()\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tif c.dispatchFenced.Load() {\n\t\treturn ErrDispatchFenced\n\t}\n\n\taddr, ok := c.addrLocked()\n\tif !ok {\n\t\treturn fmt.Errorf(\"home: invalid address (host=%q port=%d)\", c.homeCfg.Host, c.homeCfg.Port)\n\t}\n\n\tif c.cmd == nil {\n\t\toptions, errOptions := c.redisOptionsLocked(addr)\n\t\tif errOptions != nil {\n\t\t\treturn errOptions\n\t\t}\n\t\tc.cmdOptions = cloneRedisOptions(options)\n\t\tc.cmd = redis.NewClient(options)\n\t}\n\tif c.sub == nil {\n\t\toptions, errOptions := c.redisOptionsLocked(addr)\n\t\tif errOptions != nil {\n\t\t\treturn errOptions\n\t\t}\n\t\tc.sub = redis.NewClient(options)\n\t}\n\treturn nil","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/home/client.go#L476-L512","documentation":"Returned by ensureClients in internal/home/client.go when addrLocked() fails: the home host is empty/whitespace or the port is <= 0. The message prints the offending host and port so you can see exactly which field is bad. The client needs a valid host:port before it can construct the Redis command/pubsub clients.","triggerScenarios":"Home enabled in config but host empty or port 0/unset (port field omitted so Go zero value 0 is used); host set only via env var that is not loaded; whitespace-pasted host; port parsed from a string that failed to unmarshal.","commonSituations":"Config yaml enables home but misses the address block; .env not in the working directory so HOME_HOST/HOME_PORT never load; port specified as a string ('6379') against an int field causing silent zero on some unmarshalers; staging config copied without the address section.","solutions":["Set a non-empty host and a positive integer port in the home config block","Verify env vars are actually exported / .env is in the process working directory","Check the config hot-reload watcher picked up the corrected file if running"],"exampleFix":"# before\nhome:\n  enabled: true\n\n# after\nhome:\n  enabled: true\n  host: home.internal\n  port: 6379","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(cfg.Home.Host) == \"\" || cfg.Home.Port <= 0 || cfg.Home.Port > 65535 {\n    return fmt.Errorf(\"home requires a valid host and 1-65535 port (got host=%q port=%d)\", cfg.Home.Host, cfg.Home.Port)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the home block whenever home is enabled, at config load time","Use YAML integers for ports (port: 6379, not \"6379\")"],"tags":["go","configuration","redis","home"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}