{"record":{"id":"49caadb96b76507b","repo":"jeessy2/ddns-go","slug":"interface-s-not-found-v","errorCode":null,"errorMessage":"interface %s not found: %v","messagePattern":"interface (.+?) not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"util/http_client_util.go","lineNumber":15,"sourceCode":"package util\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc getLocalAddrFromInterfaceByNetwork(ifaceName, network string) (string, error) {\n\tiface, err := net.InterfaceByName(ifaceName)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"interface %s not found: %v\", ifaceName, err)\n\t}\n\taddrs, err := iface.Addrs()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get interface %s addresses failed: %v\", ifaceName, err)\n\t}\n\n\thasGlobalUnicast := false\n\tfor _, addr := range addrs {\n\t\tipNet, ok := addr.(*net.IPNet)\n\t\tif !ok || !ipNet.IP.IsGlobalUnicast() {\n\t\t\tcontinue\n\t\t}\n\t\thasGlobalUnicast = true\n\t\tif isIPMatchedNetwork(ipNet.IP, network) {\n\t\t\treturn ipNet.IP.String(), nil\n\t\t}\n\t}\n\tif hasGlobalUnicast && (network == \"tcp4\" || network == \"tcp6\") {","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/jeessy2/ddns-go/blob/5874c2e6667c69357ab95079421131104bd3fcae/util/http_client_util.go#L1-L33","documentation":"Returned by getLocalAddrFromInterfaceByNetwork (util/http_client_util.go:15) when net.InterfaceByName(ifaceName) fails, i.e. the configured network interface name does not exist on this machine. CreateBoundNoProxyHTTPClient calls it to bind an HTTP client to a specific interface; on failure it logs and silently falls back to the default (no-proxy) client, so callers usually only see the log line, not a hard error.","triggerScenarios":"Calling CreateBoundNoProxyHTTPClient(network, ifaceName) with an interface name that is absent or misspelled (e.g. \"eth0\" on a system using \"enp0s3\" or \"ens192\", or \"en0\" on Linux); interface removed/renamed after config was written; running in a container that only has eth0 while config references a host NIC.","commonSituations":"Config copied from another machine; Windows/macOS interface names (\"Ethernet\", \"en0\") used on Linux or vice versa; Docker/Kubernetes environments where the host NIC is not visible; NIC renamed by predictable-network-interface-names after a kernel update.","solutions":["Check the actual interface name with `ip link` (Linux), `ifconfig` (macOS) or `ipconfig` (Windows) and fix the configured name","Remove/clear the interface binding setting to fall back to the default client","If in a container, use the container's own interface (usually eth0) instead of the host's","Re-check after NIC renames or driver updates on the host"],"exampleFix":"// before\nclient := util.CreateBoundNoProxyHTTPClient(\"tcp4\", \"eth0\")\n// after\n// run `ip link` first; if the NIC is enp3s0:\nclient := util.CreateBoundNoProxyHTTPClient(\"tcp4\", \"enp3s0\")","handlingStrategy":"validation","validationCode":"// Go: check the interface exists before configuring the binding\nifaceName := \"eth0\" // value from your config\nif _, err := net.InterfaceByName(ifaceName); err != nil {\n    log.Printf(\"interface %q not available, using default client\", ifaceName)\n    // fall back to util.CreateNoProxyHTTPClient(network)\n}","typeGuard":"func interfaceExists(name string) bool {\n    _, err := net.InterfaceByName(name)\n    return err == nil\n}","tryCatchPattern":"// Go: the library already falls back internally; guard your own binding path\nclient, err := bindToInterface(cfg.IfaceName, cfg.Network) // wrapper you control\nif err != nil {\n    log.Printf(\"binding to %q failed (%v), using default client\", cfg.IfaceName, err)\n    client = util.CreateNoProxyHTTPClient(cfg.Network)\n}","preventionTips":["Validate the configured interface name at startup with net.InterfaceByName and fail config-load fast","Use OS-appropriate names: `ip link` on Linux, `ifconfig` on macOS, `ipconfig` on Windows","In containers, bind to the container's interface (eth0), not the host NIC","Re-validate the name after kernel updates or NIC renames"],"tags":["network","interface","configuration","go"],"backgroundTag":"network-interface-not-found","analyzedSha":"5874c2e6667c69357ab95079421131104bd3fcae","analyzedAt":"2026-09-03T15:41:16.799Z","contentChangedAt":"2026-09-03T15:41:16.799Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}