{"record":{"id":"3373a96ca1a4b856","repo":"hashicorp/nomad","slug":"dev-connect-uses-network-namespaces-v","errorCode":null,"errorMessage":"-dev=connect uses network namespaces: %v","messagePattern":"-dev=connect uses network namespaces: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/config.go","lineNumber":1755,"sourceCode":"func (mode *devModeConfig) networkConfig() error {\n\tif runtime.GOOS == \"windows\" {\n\t\tmode.bindAddr = \"127.0.0.1\"\n\t\tmode.iface = \"Loopback Pseudo-Interface 1\"\n\t\treturn nil\n\t}\n\tif runtime.GOOS == \"darwin\" {\n\t\tmode.bindAddr = \"127.0.0.1\"\n\t\tmode.iface = \"lo0\"\n\t\treturn nil\n\t}\n\tif mode != nil && mode.connectMode {\n\t\t// if we hit either of the errors here we're in a weird situation\n\t\t// where syscalls to get the list of network interfaces are failing.\n\t\t// rather than throwing errors, we'll fall back to the default.\n\t\tifAddrs, err := sockaddr.GetDefaultInterfaces()\n\t\terrMsg := \"-dev=connect uses network namespaces: %v\"\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(errMsg, err)\n\t\t}\n\t\tif len(ifAddrs) < 1 {\n\t\t\treturn fmt.Errorf(errMsg, \"could not find public network interface\")\n\t\t}\n\t\tiface := ifAddrs[0].Name\n\t\tmode.iface = iface\n\t\tmode.bindAddr = \"0.0.0.0\" // allows CLI to \"just work\"\n\t\treturn nil\n\t}\n\tmode.bindAddr = \"127.0.0.1\"\n\tmode.iface = \"lo\"\n\treturn nil\n}\n\n// DevConfig is a Config that is used for dev mode of Nomad.\nfunc DevConfig(mode *devModeConfig) *Config {\n\tif mode == nil {\n\t\tmode = &devModeConfig{defaultMode: true}","sourceCodeStart":1737,"sourceCodeEnd":1773,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/config.go#L1737-L1773","documentation":"In -dev-connect mode Nomad determines the public network interface via sockaddr.GetDefaultInterfaces() to bind the namespaced network. If that call fails, this (typo'd \"-dev=connect\") error message wraps the underlying error.","triggerScenarios":"GetDefaultInterfaces returns an error during devModeConfig.networkConfig() — failing netlink/socket syscalls when enumerating interfaces (broken network stack, restricted namespaces).","commonSituations":"Containers with broken network namespace setup; seccomp/apparmor policies blocking interface enumeration; broken host networking.","solutions":["Inspect the wrapped error for the failing syscall and fix the host/container network setup.","Run with security profiles (seccomp/apparmor) that permit netlink socket calls.","Fall back to regular -dev mode if the environment cannot expose interfaces."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"ifAddrs, err := sockaddr.GetDefaultInterfaces()\nif err != nil {\n  // fall back to non-connect dev mode\n}","typeGuard":null,"tryCatchPattern":"ifAddrs, err := sockaddr.GetDefaultInterfaces()\nif err != nil {\n  return fmt.Errorf(\"could not detect default interface: %w\", err)\n}","preventionTips":["Verify `ip addr` works in the target environment first","Avoid hardened seccomp profiles for dev agents","Keep at least one routable interface on the host"],"tags":["network","dev-connect","linux","interfaces"],"backgroundTag":"network-interface-detection-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}