{"record":{"id":"9df3aaa88887f763","repo":"hashicorp/nomad","slug":"invalid-bridge-network-subnet-w","errorCode":null,"errorMessage":"invalid bridge_network_subnet: %w","messagePattern":"invalid bridge_network_subnet: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/agent.go","lineNumber":1113,"sourceCode":"\t\t// Default no_host_uuid to true\n\t\tconf.NoHostUUID = true\n\t}\n\n\t// Setup the ACLs\n\tconf.ACLEnabled = agentConfig.ACL.Enabled\n\tconf.ACLTokenTTL = agentConfig.ACL.TokenTTL\n\tconf.ACLPolicyTTL = agentConfig.ACL.PolicyTTL\n\tconf.ACLRoleTTL = agentConfig.ACL.RoleTTL\n\n\t// Setup networking configuration\n\tconf.CNIPath = agentConfig.Client.CNIPath\n\tconf.CNIConfigDir = agentConfig.Client.CNIConfigDir\n\tconf.BridgeNetworkName = agentConfig.Client.BridgeNetworkName\n\tipv4Subnet := agentConfig.Client.BridgeNetworkSubnet\n\tif ipv4Subnet != \"\" {\n\t\tip, _, err := net.ParseCIDR(ipv4Subnet)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid bridge_network_subnet: %w\", err)\n\t\t}\n\t\t// it's a valid IP, so now make sure it is ipv4\n\t\tif ip.To4() == nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid bridge_network_subnet: not an IPv4 address: %s\", ipv4Subnet)\n\t\t}\n\t\tconf.BridgeNetworkAllocSubnet = ipv4Subnet\n\t}\n\tipv6Subnet := agentConfig.Client.BridgeNetworkSubnetIPv6\n\tif ipv6Subnet != \"\" {\n\t\tip, _, err := net.ParseCIDR(ipv6Subnet)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid bridge_network_subnet_ipv6: %w\", err)\n\t\t}\n\t\t// it's valid, so now make sure it's *not* ipv4\n\t\tif ip.To4() != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid bridge_network_subnet_ipv6: not an IPv6 address: %s\", ipv6Subnet)\n\t\t}\n\t\tconf.BridgeNetworkAllocSubnetIPv6 = ipv6Subnet","sourceCodeStart":1095,"sourceCodeEnd":1131,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/agent.go#L1095-L1131","documentation":"Nomad's convertClientConfig validates the client's bridge_network_subnet setting by parsing it with net.ParseCIDR. If the value is not a valid CIDR (e.g. missing prefix length or malformed IP), the parse error is wrapped in this error and agent startup (or reload) aborts.","triggerScenarios":"Setting client.bridge_network_subnet in the agent config to a string that net.ParseCIDR cannot parse, such as '10.0.0.0/24x', '10.0.0.0' (no /prefix), or an empty/garbage value; triggered during agent start, initial clientConfig build, or SIGHUP reload via handleReload.","commonSituations":"Typos in the config file, omitting the /prefix suffix, copy-pasting a plain IP instead of a CIDR block, or templating tools rendering an invalid value into the HCL/JSON config.","solutions":["Fix client.bridge_network_subnet in the agent config to a valid IPv4 CIDR, e.g. '10.0.0.0/24'","Verify with `nomad agent -config ... -verify-only` or run the value through a CIDR validator before deploying","If you only have a plain IP, add the desired prefix length, e.g. '192.168.1.10' -> '192.168.1.10/32' or the subnet mask form"],"exampleFix":"// before\nclient {\n  bridge_network_subnet = \"10.0.0.0\"\n}\n// after\nclient {\n  bridge_network_subnet = \"10.0.0.0/24\"\n}","handlingStrategy":"validation","validationCode":"subnet := \"10.0.0.0/24\"\nif _, _, err := net.ParseCIDR(subnet); err != nil {\n    return fmt.Errorf(\"bridge_network_subnet must be a valid CIDR: %w\", err)\n}","typeGuard":"func isValidIPv4CIDR(s string) bool {\n    ip, _, err := net.ParseCIDR(s)\n    return err == nil && ip.To4() != nil\n}","tryCatchPattern":null,"preventionTips":["Always include a prefix length (/n) in bridge_network_subnet","Validate agent config with `nomad agent -verify-only` before restarts","Keep IPv4 and IPv6 values in their respective config fields","Lint HCL/JSON config in CI before deployment"],"tags":["nomad","config-validation","network","cidr"],"backgroundTag":"invalid-cidr-notation","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"}